public class Money extends Element
Modifier and Type | Field and Description |
---|---|
static AttributeKey<java.lang.Double> |
AMOUNT
Amount.
|
static AttributeKey<java.lang.String> |
CURRENCY_CODE
ISO4217 currency code.
|
static ElementKey<java.lang.Void,Money> |
KEY
The key for this element.
|
Constructor and Description |
---|
Money()
Constructs an instance using the default key.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Double |
getAmount()
Returns the amount.
|
java.lang.String |
getCurrencyCode()
Returns the ISO4217 currency code.
|
boolean |
hasAmount()
Returns whether it has the amount.
|
boolean |
hasCurrencyCode()
Returns whether it has the ISO4217 currency code.
|
int |
hashCode() |
Money |
lock()
Locks this element.
|
static void |
registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
|
Money |
setAmount(java.lang.Double amount)
Sets the amount.
|
Money |
setCurrencyCode(java.lang.String currencyCode)
Sets the ISO4217 currency code.
|
addElement, addElement, addElement, clear, createElement, createElement, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hasTextValue, isLocked, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, toString, visit
public static final ElementKey<java.lang.Void,Money> KEY
public static final AttributeKey<java.lang.Double> AMOUNT
public static final AttributeKey<java.lang.String> CURRENCY_CODE
public static void registerMetadata(MetadataRegistry registry)
public Money lock()
Element
public java.lang.Double getAmount()
public Money setAmount(java.lang.Double amount)
amount
- amount or null
to resetpublic boolean hasAmount()
public java.lang.String getCurrencyCode()
public Money setCurrencyCode(java.lang.String currencyCode)
currencyCode
- ISO4217 currency code or null
to resetpublic boolean hasCurrencyCode()