Interface EnumDatatype

All Superinterfaces:
Comparable<Datatype>, Datatype, NamedDatatype, ValueDatatype
All Known Implementing Classes:
DefaultGenericEnumDatatype, GenericEnumDatatype

public interface EnumDatatype extends NamedDatatype
A value datatype representing an enumeration of values.
  • Method Details

    • getAllValueIds

      String[] getAllValueIds(boolean includeNull)
      Returns the IDs of all values defined in the enum type.
      Parameters:
      includeNull - true to get the ID for the NULL-Value included, false for not include the NULL-Value. Note that the NULL-Value can be the Java null or a special case NULL-value ID.
    • getValueByName

      default Object getValueByName(String name)
      Description copied from interface: NamedDatatype
      This method parses the given string and returns the value as an instance of the class this value datatype represents.

      The difference to ValueDatatype.getValue(String) is that the given string is not a representation of the ID (as used by ValueDatatype.getValue(String)) but of the name as returned by NamedDatatype.getValueName(String).

      Use with caution: During development time Faktor-IPS maintains all values with their string representation. This allows to change the value's datatype without the need to convert the value from one class to another (e.g. if the string representation is 42 you can change the datatype from integer to string without converting the integer object to a string object.

      Specified by:
      getValueByName in interface NamedDatatype
      Parameters:
      name - the name representation of a value
      Returns:
      the value as instance of the class this datatype represents