Class CurrencyDatatype
- All Implemented Interfaces:
Comparable<Datatype>,Datatype,NamedDatatype,ValueDatatype
-
Field Summary
FieldsFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method parses the given string and returns the value as an instance of the class this value datatype represents.getValueByName(String symbol) This method parses the given string and returns the value as an instance of the class this value datatype represents.getValueByName(String name, Locale locale) This method parses the given string and returns the value as an instance of the class this value datatype represents.getValueName(String currencyCode) Returns a short description of the value of this datatype specified by the ID.getValueName(String currencyCode, Locale locale) Returns a short description of the value of this datatype specified by the ID.booleanReturnstrueif an implementation of this interface supports names that describe the datatype's value.booleanMethods inherited from class org.faktorips.datatype.ValueClassNameDatatype
areValuesEqual, compare, getDefaultValue, getName, getQualifiedName, getWrapperType, hasNullObject, isAbstract, isImmutable, isMutable, isNull, isParsable, isPrimitive, isValueDatatype, valueToStringMethods inherited from class org.faktorips.datatype.AbstractDatatype
checkReadyToUse, compareTo, equals, hashCode, isEnum, isVoid, matchDatatype, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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.ValueDatatype
areValuesEqual, checkReadyToUse, compare, getDefaultValue, getNullObjectId, getWrapperType, isImmutable, isMutable, isNull, isParsable, valueToString
-
Field Details
-
DATATYPE
-
-
Constructor Details
-
CurrencyDatatype
public CurrencyDatatype()
-
-
Method Details
-
getValue
Description copied from class:ValueClassNameDatatypeThis method parses the given string and returns the value as an instance of the class this value datatype represents. 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:
getValuein interfaceValueDatatype- Specified by:
getValuein classValueClassNameDatatype- Parameters:
currencyCode- string representation of the value- Returns:
- The value as instance of the class this datatype represents.
- See Also:
-
supportsCompare
public boolean supportsCompare()- Specified by:
supportsComparein interfaceValueDatatype- Returns:
trueif this datatype is able to compare two values.
-
isSupportingNames
public boolean isSupportingNames()Description copied from interface:NamedDatatypeReturnstrueif an implementation of this interface supports names that describe the datatype's value. E.g. an enum datatype PaymentMode might return the name "annual" for the annual payment mode with ID "1". If this method returnsfalsea call to theNamedDatatype.getValueName(String)method is supposed to throw anIllegalStateException.- Specified by:
isSupportingNamesin interfaceNamedDatatype
-
getValueName
Description copied from interface:NamedDatatypeReturns a short description of the value of this datatype specified by the ID.- Specified by:
getValueNamein interfaceNamedDatatype
-
getValueName
Description copied from interface:NamedDatatypeReturns a short description of the value of this datatype specified by the ID. TheLocalecan be used for internationalization. If no locale is provide theLocale.getDefault()will be used.- Specified by:
getValueNamein interfaceNamedDatatype- Parameters:
currencyCode- the ID for the valuelocale- the locale used for internationalization
-
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:
symbol- the name representation of a value- Returns:
- the value as instance of the class this datatype represents
-
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. TheLocalecan be used for internationalization. If no locale is provide theLocale.getDefault()will be used.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,Locale).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 valuelocale- the locale used for internationalization- Returns:
- the value as instance of the class this datatype represents
-