Package org.faktorips.datatype
Interface EnumDatatype
- All Superinterfaces:
Comparable<Datatype>,Datatype,NamedDatatype,ValueDatatype
- All Known Implementing Classes:
DefaultGenericEnumDatatype,GenericEnumDatatype
A value datatype representing an enumeration of values.
-
Field Summary
Fields inherited from interface org.faktorips.datatype.Datatype
BIG_DECIMAL, BOOLEAN, DECIMAL, DOUBLE, GREGORIAN_CALENDAR, INTEGER, LONG, MONEY, PRIMITIVE_BOOLEAN, PRIMITIVE_INT, PRIMITIVE_LONG, STRING, VOID -
Method Summary
Modifier and TypeMethodDescriptionString[]getAllValueIds(boolean includeNull) Returns the IDs of all values defined in the enum type.default ObjectgetValueByName(String name) This method parses the given string and returns the value as an instance of the class this value datatype represents.Methods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.faktorips.datatype.Datatype
getName, getQualifiedName, hasNullObject, isAbstract, isEnum, isPrimitive, isValueDatatype, isVoidMethods inherited from interface org.faktorips.datatype.NamedDatatype
getValueByName, getValueName, getValueName, isSupportingNamesMethods inherited from interface org.faktorips.datatype.ValueDatatype
areValuesEqual, checkReadyToUse, compare, getDefaultValue, getNullObjectId, getValue, getWrapperType, isImmutable, isMutable, isNull, isParsable, supportsCompare, valueToString
-
Method Details
-
getAllValueIds
Returns the IDs of all values defined in the enum type.- Parameters:
includeNull-trueto get the ID for the NULL-Value included,falsefor not include the NULL-Value. Note that the NULL-Value can be the Javanullor a special case NULL-value ID.
-
getValueByName
Description copied from interface:NamedDatatypeThis 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 byValueDatatype.getValue(String)) but of the name as returned byNamedDatatype.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:
getValueByNamein interfaceNamedDatatype- Parameters:
name- the name representation of a value- Returns:
- the value as instance of the class this datatype represents
-