com.google.gdata.data.finance
Class TransactionData

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.finance.TransactionData
All Implemented Interfaces:
Extension

public class TransactionData
extends ExtensionPoint

Data for the transction.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Constructor Summary
TransactionData()
          Default mutable constructor.
TransactionData(DateTime date, java.lang.String notes, java.lang.Double shares, java.lang.String type)
          Immutable constructor.
 
Method Summary
 void declareExtensions(ExtensionProfile extProfile)
          Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
 Commission getCommission()
          Returns the commission for the transaction.
 DateTime getDate()
          Returns the date at which the transaction occurred.
static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
          Returns the extension description, specifying whether it is required, and whether it is repeatable.
 java.lang.String getNotes()
          Returns the notes.
 Price getPrice()
          Returns the price of the transaction.
 java.lang.Double getShares()
          Returns the number of shares involved in the transaction.
 java.lang.String getType()
          Returns the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
 boolean hasCommission()
          Returns whether it has the commission for the transaction.
 boolean hasDate()
          Returns whether it has the date at which the transaction occurred.
 boolean hasNotes()
          Returns whether it has the notes.
 boolean hasPrice()
          Returns whether it has the price of the transaction.
 boolean hasShares()
          Returns whether it has the number of shares involved in the transaction.
 boolean hasType()
          Returns whether it has the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
 void setCommission(Commission commission)
          Sets the commission for the transaction.
 void setDate(DateTime date)
          Sets the date at which the transaction occurred.
 void setNotes(java.lang.String notes)
          Sets the notes.
 void setPrice(Price price)
          Sets the price of the transaction.
 void setShares(java.lang.Double shares)
          Sets the number of shares involved in the transaction.
 void setType(java.lang.String type)
          Sets the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
 java.lang.String toString()
           
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addRepeatingExtension, generateCumulativeXmlBlob, getExtension, getExtensions, getHandler, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit
 
Methods inherited from class com.google.gdata.data.AbstractExtension
disableStrictValidation, enableStrictValidation, generate, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, setImmutable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransactionData

public TransactionData()
Default mutable constructor.


TransactionData

public TransactionData(DateTime date,
                       java.lang.String notes,
                       java.lang.Double shares,
                       java.lang.String type)
Immutable constructor.

Parameters:
date - date at which the transaction occurred.
notes - notes.
shares - number of shares involved in the transaction.
type - type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").
Method Detail

declareExtensions

public void declareExtensions(ExtensionProfile extProfile)
Description copied from class: ExtensionPoint
Declares the set of expected Extension types for an ExtensionPoint within the target extension profile. The base implementation does not declare any extensions, but can be overridden by specific types of ExtensionPoints that always contain a well-defined set of extensions.

Overrides:
declareExtensions in class ExtensionPoint
Parameters:
extProfile - the ExtensionProfile to initialize.

getCommission

public Commission getCommission()
Returns the commission for the transaction.

Returns:
commission for the transaction

setCommission

public void setCommission(Commission commission)
Sets the commission for the transaction.

Parameters:
commission - commission for the transaction or null to reset

hasCommission

public boolean hasCommission()
Returns whether it has the commission for the transaction.

Returns:
whether it has the commission for the transaction

getDate

public DateTime getDate()
Returns the date at which the transaction occurred.

Returns:
date at which the transaction occurred

setDate

public void setDate(DateTime date)
Sets the date at which the transaction occurred.

Parameters:
date - date at which the transaction occurred or null to reset

hasDate

public boolean hasDate()
Returns whether it has the date at which the transaction occurred.

Returns:
whether it has the date at which the transaction occurred

getNotes

public java.lang.String getNotes()
Returns the notes.

Returns:
notes

setNotes

public void setNotes(java.lang.String notes)
Sets the notes.

Parameters:
notes - notes or null to reset

hasNotes

public boolean hasNotes()
Returns whether it has the notes.

Returns:
whether it has the notes

getPrice

public Price getPrice()
Returns the price of the transaction.

Returns:
price of the transaction

setPrice

public void setPrice(Price price)
Sets the price of the transaction.

Parameters:
price - price of the transaction or null to reset

hasPrice

public boolean hasPrice()
Returns whether it has the price of the transaction.

Returns:
whether it has the price of the transaction

getShares

public java.lang.Double getShares()
Returns the number of shares involved in the transaction.

Returns:
number of shares involved in the transaction

setShares

public void setShares(java.lang.Double shares)
Sets the number of shares involved in the transaction.

Parameters:
shares - number of shares involved in the transaction or null to reset

hasShares

public boolean hasShares()
Returns whether it has the number of shares involved in the transaction.

Returns:
whether it has the number of shares involved in the transaction

getType

public java.lang.String getType()
Returns the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").

Returns:
type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short")

setType

public void setType(java.lang.String type)
Sets the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").

Parameters:
type - type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short") or null to reset

hasType

public boolean hasType()
Returns whether it has the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short").

Returns:
whether it has the type for the transaction (can be "Buy", "Sell", "Buy to Cover" or "Sell Short")

getDefaultDescription

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object