Package com.six.timapi
Class Amount
- java.lang.Object
-
- com.six.timapi.Amount
-
- Direct Known Subclasses:
AmountDcc
,AmountDiscount
,AmountFinal
,LoyaltyDiscount
public class Amount extends Object
Contains the amount for transactions. The amount can be specified in minor units as integer value or in major units as floating point value.
-
-
Constructor Summary
Constructors Constructor Description Amount(double amount, Currency currency)
Create amount using major units.Amount(double amount, Currency currency, int exponent)
Create amount using major units and custom exponent.Amount(int amount, Currency currency)
Create amount using minor units.Amount(int amount, Currency currency, int exponent)
Create amount using minor units.Amount(long amount, Currency currency)
Create amount using minor units.Amount(long amount, Currency currency, int exponent)
Create amount using minor units.Amount(Amount amount)
Create copy of amount.Amount(com.six.timapi.internal.TimSavedState savedState)
For internal use only.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.six.timapi.internal.TimSavedState
createSavedState(String name)
For internal use only.long
getAmount()
Amount in minor units as integer value.Currency
getCurrency()
Currency to use for transaction.double
getDecimalValue()
Amount in major units as floating point value.int
getExponent()
Exponent.int
getIntAmount()
Amount in minor units as integer value.void
setAmount(long amount)
Set amount in minor units as integer value.void
setCurrency(Currency currency)
Set currency to use for transaction.void
setDecimalValue(double value)
Set amount in major units as floating point value.void
setExponent(int exponent)
Set exponent.void
setIntAmount(int amount)
Set amount in minor units as integer value.String
toString()
String representation for debugging purpose.
-
-
-
Constructor Detail
-
Amount
public Amount(int amount, Currency currency)
Create amount using minor units.
-
Amount
public Amount(int amount, Currency currency, int exponent)
Create amount using minor units.
-
Amount
public Amount(long amount, Currency currency)
Create amount using minor units.
-
Amount
public Amount(long amount, Currency currency, int exponent)
Create amount using minor units.
-
Amount
public Amount(double amount, Currency currency)
Create amount using major units.
-
Amount
public Amount(double amount, Currency currency, int exponent)
Create amount using major units and custom exponent.
-
Amount
public Amount(Amount amount)
Create copy of amount.
-
Amount
public Amount(com.six.timapi.internal.TimSavedState savedState)
For internal use only.
-
-
Method Detail
-
getIntAmount
public int getIntAmount()
Amount in minor units as integer value.
-
setIntAmount
public void setIntAmount(int amount)
Set amount in minor units as integer value.
-
getAmount
public long getAmount()
Amount in minor units as integer value.
-
setAmount
public void setAmount(long amount)
Set amount in minor units as integer value.
-
getDecimalValue
public double getDecimalValue()
Amount in major units as floating point value.
-
setDecimalValue
public void setDecimalValue(double value)
Set amount in major units as floating point value.
-
getCurrency
public Currency getCurrency()
Currency to use for transaction.
-
setCurrency
public void setCurrency(Currency currency)
Set currency to use for transaction. Also sets the exponent.
-
getExponent
public int getExponent()
Exponent.
-
setExponent
public void setExponent(int exponent)
Set exponent.
-
toString
public String toString()
String representation for debugging purpose.
-
createSavedState
public com.six.timapi.internal.TimSavedState createSavedState(String name)
For internal use only.
-
-