Class Currency
- java.lang.Object
-
- de.hybris.order.calculation.money.Currency
-
public class Currency extends java.lang.Object
Currency object to be used from inside the calculation framework. It simply combines a code and the number of digits available for that currency. Actually this class only exists becauseCurrency
does not support creation of artificial currencies.
-
-
Constructor Summary
Constructors Constructor Description Currency(java.lang.String isocode, int digits)
Creates a new currency with given iso code and digits.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
getDigits()
java.lang.String
getIsoCode()
int
hashCode()
java.lang.String
toString()
static Currency
valueOf(java.lang.String code, int digits)
Shortcut for getting commonly used currency instances.
-
-
-
Method Detail
-
valueOf
public static Currency valueOf(java.lang.String code, int digits)
Shortcut for getting commonly used currency instances. Prefer this toCurrency(String, int)
since this method caches instances.
-
equals
public boolean equals(java.lang.Object obj)
ACurrency
is equal to an object if this object is also aCurrency
and this currency has the same digit count and the isocode is equal (ignore case) to the other isocode.- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getIsoCode
public java.lang.String getIsoCode()
-
getDigits
public int getDigits()
-
-