public class

Money

extends Element
java.lang.Object
   ↳ com.google.gdata.model.Element
     ↳ com.google.gdata.model.gd.Money

Class Overview

Describes money.

Summary

Fields
public static final AttributeKey<Double> AMOUNT Amount.
public static final AttributeKey<String> CURRENCY_CODE ISO4217 currency code.
public static final ElementKey<Void, Money> KEY The key for this element.
[Expand]
Inherited Fields
From class com.google.gdata.model.Element
Public Constructors
Money()
Constructs an instance using the default key.
Protected Constructors
Money(ElementKey<?, ? extends Money> key)
Subclass constructor, allows subclasses to supply their own element key.
Money(ElementKey<?, ? extends Money> key, Element source)
Constructs a new instance by doing a shallow copy of data from an existing Element instance.
Public Methods
boolean equals(Object obj)
Double getAmount()
Returns the amount.
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(Double amount)
Sets the amount.
Money setCurrencyCode(String currencyCode)
Sets the ISO4217 currency code.
[Expand]
Inherited Methods
From class com.google.gdata.model.Element
From class java.lang.Object

Fields

public static final AttributeKey<Double> AMOUNT

Amount.

public static final AttributeKey<String> CURRENCY_CODE

ISO4217 currency code.

public static final ElementKey<Void, Money> KEY

The key for this element.

Public Constructors

public Money ()

Constructs an instance using the default key.

Protected Constructors

protected Money (ElementKey<?, ? extends Money> key)

Subclass constructor, allows subclasses to supply their own element key.

Parameters
key

protected Money (ElementKey<?, ? extends Money> key, Element source)

Constructs a new instance by doing a shallow copy of data from an existing Element instance. Will use the given ElementKey as the key for the element. This constructor is used when adapting from one element key to another. You cannot call this constructor directly, instead use createElement(ElementKey, Element).

Parameters
key The key to use for this element.
source Source element

Public Methods

public boolean equals (Object obj)

Parameters
obj

public Double getAmount ()

Returns the amount.

Returns
  • amount

public String getCurrencyCode ()

Returns the ISO4217 currency code.

Returns
  • ISO4217 currency code

public boolean hasAmount ()

Returns whether it has the amount.

Returns
  • whether it has the amount

public boolean hasCurrencyCode ()

Returns whether it has the ISO4217 currency code.

Returns
  • whether it has the ISO4217 currency code

public int hashCode ()

public Money lock ()

Locks this element. A locked element cannot have any changes made to its content or its attributes or child elements. This will also lock all attributes and child elements as well. Once this method has been called, this element can be safely published to other threads.

public static void registerMetadata (MetadataRegistry registry)

Registers the metadata for this element.

Parameters
registry

public Money setAmount (Double amount)

Sets the amount.

Parameters
amount Amount or null to reset
Returns
  • this to enable chaining setters

public Money setCurrencyCode (String currencyCode)

Sets the ISO4217 currency code.

Parameters
currencyCode ISO4217 currency code or null to reset
Returns
  • this to enable chaining setters