

package org.pentaho.big.data.kettle.plugins.formats.impl;


/**
 * Enum with valid list of Nullable values - used for the Nullable combo box
 * <p>
 * Also contains convience methods to get the default value and return a list of values as string to populate combo box
 */
public enum NullableValuesEnum {
  YES( "Yes" ),
  NO( "No" );

  private String value;

  NullableValuesEnum( String value ) {
    this.value = value;
  }

  public String getValue() {
    return value;
  }

  public static NullableValuesEnum getDefaultValue() {
    return NullableValuesEnum.YES;
  }

  public static String[] getValuesArr() {
    String[] valueArr = new String[ NullableValuesEnum.values().length ];

    int i = 0;

    for ( NullableValuesEnum nullValueEnum : NullableValuesEnum.values() ) {
      valueArr[ i++ ] = nullValueEnum.getValue();
    }

    return valueArr;
  }
}
