Class Currency
- java.lang.Object
-
- de.hybris.order.calculation.money.Currency
-
public class Currency extends java.lang.ObjectCurrency 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 becauseCurrencydoes 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 booleanequals(java.lang.Object obj)intgetDigits()java.lang.StringgetIsoCode()inthashCode()java.lang.StringtoString()static CurrencyvalueOf(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)
ACurrencyis equal to an object if this object is also aCurrencyand this currency has the same digit count and the isocode is equal (ignore case) to the other isocode.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getIsoCode
public java.lang.String getIsoCode()
-
getDigits
public int getDigits()
-
-