- All Implemented Interfaces:
Serializable
,Comparable<Moneda>
,Constable
Moneda currency representation `NAME (symbol, rate)`
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Double
Converts `monto` to `destino` currencystatic final boolean
Check if `value` is part of enum Monedafinal BigDecimal
getBase
(BigDecimal monto) Converts to base currency (USD) at self.ratestatic final String
monedaString
(Double monto) Returns String representation of Double `monto`final BigDecimal
rate()
final String
symbol()
static Moneda
Returns the enum constant of this class with the specified name.static Moneda[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
USD
-
CLP
-
EUR
-
GBP
-
JPY
-
KRW
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
symbol
- Returns:
- Currency symbol
-
rate
- Returns:
- Currency rate
-
getBase
Converts to base currency (USD) at self.rate- Parameters:
monto
- amount to convert to base currency- Returns:
- BigDecimal base value
-
convert
Converts `monto` to `destino` currency- Parameters:
destino
- target conversion Currencymonto
- amount- Returns:
- Double conversion
-
esMoneda
Check if `value` is part of enum Moneda- Parameters:
value
- String currency- Returns:
- true if value is an enum Moneda, otherwise returns false
-
monedaString
Returns String representation of Double `monto`- Parameters:
monto
- Double amount for String representation- Returns:
- String representation of `monto`
-