public class MonetaryAmount
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
A number representing the monetary amount for an offering or transaction.
Modifier and Type | Field and Description |
---|---|
private java.lang.Double |
amount
The numerical amount of an offering or transaction.
|
private java.lang.String |
currencyCode
The currency code of a monetary amount.
|
Constructor and Description |
---|
MonetaryAmount() |
Modifier and Type | Method and Description |
---|---|
MonetaryAmount |
clone() |
boolean |
equals(java.lang.Object obj) |
java.lang.Double |
getAmount()
The numerical amount of an offering or transaction.
|
java.lang.String |
getCurrencyCode()
The currency code of a monetary amount.
|
int |
hashCode() |
void |
setAmount(java.lang.Double amount)
The numerical amount of an offering or transaction.
|
void |
setCurrencyCode(CurrencyCode currencyCode)
The currency code of a monetary amount.
|
void |
setCurrencyCode(java.lang.String currencyCode)
The currency code of a monetary amount.
|
java.lang.String |
toString()
Returns a string representation of this object; useful for testing and
debugging.
|
MonetaryAmount |
withAmount(java.lang.Double amount)
The numerical amount of an offering or transaction.
|
MonetaryAmount |
withCurrencyCode(CurrencyCode currencyCode)
The currency code of a monetary amount.
|
MonetaryAmount |
withCurrencyCode(java.lang.String currencyCode)
The currency code of a monetary amount.
|
private java.lang.Double amount
The numerical amount of an offering or transaction.
private java.lang.String currencyCode
The currency code of a monetary amount. For example, USD
means "U.S. dollars."
public void setAmount(java.lang.Double amount)
The numerical amount of an offering or transaction.
amount
- The numerical amount of an offering or transaction.public java.lang.Double getAmount()
The numerical amount of an offering or transaction.
public MonetaryAmount withAmount(java.lang.Double amount)
The numerical amount of an offering or transaction.
amount
- The numerical amount of an offering or transaction.public void setCurrencyCode(java.lang.String currencyCode)
The currency code of a monetary amount. For example, USD
means "U.S. dollars."
currencyCode
- The currency code of a monetary amount. For example,
USD
means "U.S. dollars."CurrencyCode
public java.lang.String getCurrencyCode()
The currency code of a monetary amount. For example, USD
means "U.S. dollars."
USD
means "U.S. dollars."CurrencyCode
public MonetaryAmount withCurrencyCode(java.lang.String currencyCode)
The currency code of a monetary amount. For example, USD
means "U.S. dollars."
currencyCode
- The currency code of a monetary amount. For example,
USD
means "U.S. dollars."CurrencyCode
public void setCurrencyCode(CurrencyCode currencyCode)
The currency code of a monetary amount. For example, USD
means "U.S. dollars."
currencyCode
- The currency code of a monetary amount. For example,
USD
means "U.S. dollars."CurrencyCode
public MonetaryAmount withCurrencyCode(CurrencyCode currencyCode)
The currency code of a monetary amount. For example, USD
means "U.S. dollars."
currencyCode
- The currency code of a monetary amount. For example,
USD
means "U.S. dollars."CurrencyCode
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public MonetaryAmount clone()
clone
in class java.lang.Object