Enum AmountRepresentation
- All Implemented Interfaces:
Serializable, Comparable<AmountRepresentation>, java.lang.constant.Constable
Enumeration of available strategies used by
MoneySerializer and MoneyDeserializer
to represent amounts of Money.-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDecimal number representation, where amount is (de)serialized as decimal number equal toMoney's amount, e.g.Decimal string representation, where amount is (de)serialized as string containing decimal number equal toMoney's amount, e.g.Minor currency unit representation, where amount is (de)serialized as long integer equal toMoney's amount expressed in minor currency unit, e.g. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AmountRepresentationReturns the enum constant of this type with the specified name.static AmountRepresentation[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
DECIMAL_NUMBER
Decimal number representation, where amount is (de)serialized as decimal number equal toMoney's amount, e.g.12.34forMoney.parse("EUR 12.34").- See Also:
-
DECIMAL_STRING
Decimal string representation, where amount is (de)serialized as string containing decimal number equal toMoney's amount, e.g."12.34"forMoney.parse("EUR 12.34").- See Also:
-
MINOR_CURRENCY_UNIT
Minor currency unit representation, where amount is (de)serialized as long integer equal toMoney's amount expressed in minor currency unit, e.g.1234forMoney.parse("EUR 12.34"),12345forMoney.parse("KWD 12.345")or12forMoney.parse("JPY 12").- See Also:
-
-
Constructor Details
-
AmountRepresentation
private AmountRepresentation()
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-