public class

Money

extends ExtensionPoint
java.lang.Object
   ↳ com.google.gdata.data.AbstractExtension
     ↳ com.google.gdata.data.ExtensionPoint
       ↳ com.google.gdata.data.extensions.Money

Class Overview

Describes money.

Summary

Constants
String AMOUNT XML "amount" attribute name
String CURRENCYCODE XML "currencyCode" attribute name
String XML_NAME XML element name
Fields
private Double amount Amount
private String currencyCode ISO4217 currency code
[Expand]
Inherited Fields
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
Public Constructors
Money()
Default mutable constructor.
Money(Double amount, String currencyCode)
Immutable constructor.
Public Methods
boolean equals(Object obj)
Double getAmount()
Returns the amount.
String getCurrencyCode()
Returns the ISO4217 currency code.
static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
Returns the extension description, specifying whether it is required, and whether it is repeatable.
boolean hasAmount()
Returns whether it has the amount.
boolean hasCurrencyCode()
Returns whether it has the ISO4217 currency code.
int hashCode()
void setAmount(Double amount)
Sets the amount.
void setCurrencyCode(String currencyCode)
Sets the ISO4217 currency code.
String toString()
Protected Methods
void consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper.
void putAttributes(AttributeGenerator generator)
Puts attributes into the attribute generator.
void validate()
Checks the attributes to see if there are any problems.
[Expand]
Inherited Methods
From class com.google.gdata.data.ExtensionPoint
From class com.google.gdata.data.AbstractExtension
From class java.lang.Object
From interface com.google.gdata.data.Extension

Constants

private static final String AMOUNT

XML "amount" attribute name

Constant Value: "amount"

private static final String CURRENCYCODE

XML "currencyCode" attribute name

Constant Value: "currencyCode"

static final String XML_NAME

XML element name

Constant Value: "money"

Fields

private Double amount

Amount

private String currencyCode

ISO4217 currency code

Public Constructors

public Money ()

Default mutable constructor.

public Money (Double amount, String currencyCode)

Immutable constructor.

Parameters
amount Amount.
currencyCode ISO4217 currency code.

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 static ExtensionDescription getDefaultDescription (boolean required, boolean repeatable)

Returns the extension description, specifying whether it is required, and whether it is repeatable.

Parameters
required Whether it is required
repeatable Whether it is repeatable
Returns
  • extension description

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 void setAmount (Double amount)

Sets the amount.

Parameters
amount Amount or null to reset

public void setCurrencyCode (String currencyCode)

Sets the ISO4217 currency code.

Parameters
currencyCode ISO4217 currency code or null to reset

public String toString ()

Protected Methods

protected void consumeAttributes (AttributeHelper helper)

Consumes attributes from the attribute helper. May also use consumeContent(boolean) to consume the element's text content. Called from getHandler(ExtensionProfile, String, String, Attributes). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
helper Attribute helper

protected void putAttributes (AttributeGenerator generator)

Puts attributes into the attribute generator. Called from generate(XmlWriter, ExtensionProfile). Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

Parameters
generator Attribute generator

protected void validate ()

Checks the attributes to see if there are any problems. Default implementation does nothing, though generally this is discouraged unless there really are no restrictions.