# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.finance
Class PortfolioData

    java.lang.Object
      com.google.gdata.data.AbstractExtension
          com.google.gdata.data.ExtensionPoint
              com.google.gdata.data.finance.PortfolioData

All Implemented Interfaces:
  Extension

    public class PortfolioData

extends ExtensionPoint

Data for the portfolio.

Nested Class Summary

Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
`ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler`

Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension
`AbstractExtension.AttributesHandler`

Field Summary

Fields inherited from class com.google.gdata.data.ExtensionPoint
`xmlBlob`

Fields inherited from class com.google.gdata.data.AbstractExtension
`localName, namespace`

Constructor Summary
`PortfolioData()` Default mutable constructor.
`PortfolioData(java.lang.String currencyCode, java.lang.Double gainPercentage, java.lang.Double return1w, java.lang.Double return1y, java.lang.Double return3m, java.lang.Double return3y, java.lang.Double return4w, java.lang.Double return5y, java.lang.Double returnOverall, java.lang.Double returnYTD)` Immutable constructor.

Method Summary
`protected void` `consumeAttributes(AttributeHelper helper)` Consumes attributes from the attribute helper.
`void` `declareExtensions(ExtensionProfile extProfile)` Declares the set of expected Extension types for an ExtensionPoint within the target extension profile.
`CostBasis` `getCostBasis()` Returns the cost basis of the portfolio in the portfolio default currency.
`java.lang.String` `getCurrencyCode()` Returns the ISO4217 currency code.
`DaysGain` `getDaysGain()` Returns the today's gain for the portfolio in the portfolio default currency.
`static ExtensionDescription` `getDefaultDescription(boolean required, boolean repeatable)` Returns the extension description, specifying whether it is required, and whether it is repeatable.
`Gain` `getGain()` Returns the gain for the portfolio in the portfolio default currency.
`java.lang.Double` `getGainPercentage()` Returns the percentage gain.
`MarketValue` `getMarketValue()` Returns the market value of the portfolio in the portfolio default currency.
`java.lang.Double` `getReturn1w()` Returns the 1 week return (percentage).
`java.lang.Double` `getReturn1y()` Returns the 1 year return (percentage).
`java.lang.Double` `getReturn3m()` Returns the 3 month return (percentage).
`java.lang.Double` `getReturn3y()` Returns the 3 year return (percentage).
`java.lang.Double` `getReturn4w()` Returns the 4 week return (percentage).
`java.lang.Double` `getReturn5y()` Returns the 5 year return (percentage).
`java.lang.Double` `getReturnOverall()` Returns the overall return (percentage).
`java.lang.Double` `getReturnYTD()` Returns the Year-to-date return (percentage).
`boolean` `hasCostBasis()` Returns whether it has the cost basis of the portfolio in the portfolio default currency.
`boolean` `hasCurrencyCode()` Returns whether it has the ISO4217 currency code.
`boolean` `hasDaysGain()` Returns whether it has the today's gain for the portfolio in the portfolio default currency.
`boolean` `hasGain()` Returns whether it has the gain for the portfolio in the portfolio default currency.
`boolean` `hasGainPercentage()` Returns whether it has the percentage gain.
`boolean` `hasMarketValue()` Returns whether it has the market value of the portfolio in the portfolio default currency.
`boolean` `hasReturn1w()` Returns whether it has the 1 week return (percentage).
`boolean` `hasReturn1y()` Returns whether it has the 1 year return (percentage).
`boolean` `hasReturn3m()` Returns whether it has the 3 month return (percentage).
`boolean` `hasReturn3y()` Returns whether it has the 3 year return (percentage).
`boolean` `hasReturn4w()` Returns whether it has the 4 week return (percentage).
`boolean` `hasReturn5y()` Returns whether it has the 5 year return (percentage).
`boolean` `hasReturnOverall()` Returns whether it has the overall return (percentage).
`boolean` `hasReturnYTD()` Returns whether it has the Year-to-date return (percentage).
`protected void` `putAttributes(AttributeGenerator generator)` Puts attributes into the attribute generator.
`void` `setCostBasis(CostBasis costBasis)` Sets the cost basis of the portfolio in the portfolio default currency.
`void` `setCurrencyCode(java.lang.String currencyCode)` Sets the ISO4217 currency code.
`void` `setDaysGain(DaysGain daysGain)` Sets the today's gain for the portfolio in the portfolio default currency.
`void` `setGain(Gain gain)` Sets the gain for the portfolio in the portfolio default currency.
`void` `setGainPercentage(java.lang.Double gainPercentage)` Sets the percentage gain.
`void` `setMarketValue(MarketValue marketValue)` Sets the market value of the portfolio in the portfolio default currency.
`void` `setReturn1w(java.lang.Double return1w)` Sets the 1 week return (percentage).
`void` `setReturn1y(java.lang.Double return1y)` Sets the 1 year return (percentage).
`void` `setReturn3m(java.lang.Double return3m)` Sets the 3 month return (percentage).
`void` `setReturn3y(java.lang.Double return3y)` Sets the 3 year return (percentage).
`void` `setReturn4w(java.lang.Double return4w)` Sets the 4 week return (percentage).
`void` `setReturn5y(java.lang.Double return5y)` Sets the 5 year return (percentage).
`void` `setReturnOverall(java.lang.Double returnOverall)` Sets the overall return (percentage).
`void` `setReturnYTD(java.lang.Double returnYTD)` Sets the Year-to-date return (percentage).
`java.lang.String` `toString()`
`protected void` `validate()` Checks the attributes to see if there are any problems.

Methods inherited from class com.google.gdata.data.ExtensionPoint

`addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getHandler, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildren`

Methods inherited from class com.google.gdata.data.AbstractExtension
`disableStrictValidation, enableStrictValidation, eq, generate, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### PortfolioData

    public PortfolioData()

  Default mutable constructor.

### PortfolioData

    public PortfolioData(java.lang.String currencyCode,
                         java.lang.Double gainPercentage,
                         java.lang.Double return1w,
                         java.lang.Double return1y,
                         java.lang.Double return3m,
                         java.lang.Double return3y,
                         java.lang.Double return4w,
                         java.lang.Double return5y,
                         java.lang.Double returnOverall,
                         java.lang.Double returnYTD)

  Immutable constructor.

  Parameters:
    `currencyCode` - ISO4217 currency code.
    `gainPercentage` - percentage gain.
    `return1w` - 1 week return (percentage).
    `return1y` - 1 year return (percentage).
    `return3m` - 3 month return (percentage).
    `return3y` - 3 year return (percentage).
    `return4w` - 4 week return (percentage).
    `return5y` - 5 year return (percentage).
    `returnOverall` - overall return (percentage).
    `returnYTD` - Year-to-date return (percentage).

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.

### getCostBasis

    public CostBasis getCostBasis()

  Returns the cost basis of the portfolio in the portfolio default currency.

  Returns:
    cost basis of the portfolio in the portfolio default currency

### setCostBasis

    public void setCostBasis(CostBasis costBasis)

  Sets the cost basis of the portfolio in the portfolio default currency.

  Parameters:
    `costBasis` - cost basis of the portfolio in the portfolio default currency or `null` to reset

### hasCostBasis

    public boolean hasCostBasis()

  Returns whether it has the cost basis of the portfolio in the portfolio default currency.

  Returns:
    whether it has the cost basis of the portfolio in the portfolio default currency

### getCurrencyCode

    public java.lang.String getCurrencyCode()

  Returns the ISO4217 currency code.

  Returns:
    ISO4217 currency code

### setCurrencyCode

    public void setCurrencyCode(java.lang.String currencyCode)

  Sets the ISO4217 currency code.

  Parameters:
    `currencyCode` - ISO4217 currency code or `null` to reset

### hasCurrencyCode

    public boolean hasCurrencyCode()

  Returns whether it has the ISO4217 currency code.

  Returns:
    whether it has the ISO4217 currency code

### getDaysGain

    public DaysGain getDaysGain()

  Returns the today's gain for the portfolio in the portfolio default currency.

  Returns:
    today's gain for the portfolio in the portfolio default currency

### setDaysGain

    public void setDaysGain(DaysGain daysGain)

  Sets the today's gain for the portfolio in the portfolio default currency.

  Parameters:
    `daysGain` - today's gain for the portfolio in the portfolio default currency or `null` to reset

### hasDaysGain

    public boolean hasDaysGain()

  Returns whether it has the today's gain for the portfolio in the portfolio default currency.

  Returns:
    whether it has the today's gain for the portfolio in the portfolio default currency

### getGain

    public Gain getGain()

  Returns the gain for the portfolio in the portfolio default currency.

  Returns:
    gain for the portfolio in the portfolio default currency

### setGain

    public void setGain(Gain gain)

  Sets the gain for the portfolio in the portfolio default currency.

  Parameters:
    `gain` - gain for the portfolio in the portfolio default currency or `null` to reset

### hasGain

    public boolean hasGain()

  Returns whether it has the gain for the portfolio in the portfolio default currency.

  Returns:
    whether it has the gain for the portfolio in the portfolio default currency

### getGainPercentage

    public java.lang.Double getGainPercentage()

  Returns the percentage gain.

  Returns:
    percentage gain

### setGainPercentage

    public void setGainPercentage(java.lang.Double gainPercentage)

  Sets the percentage gain.

  Parameters:
    `gainPercentage` - percentage gain or `null` to reset

### hasGainPercentage

    public boolean hasGainPercentage()

  Returns whether it has the percentage gain.

  Returns:
    whether it has the percentage gain

### getMarketValue

    public MarketValue getMarketValue()

  Returns the market value of the portfolio in the portfolio default currency.

  Returns:
    market value of the portfolio in the portfolio default currency

### setMarketValue

    public void setMarketValue(MarketValue marketValue)

  Sets the market value of the portfolio in the portfolio default currency.

  Parameters:
    `marketValue` - market value of the portfolio in the portfolio default currency or `null` to reset

### hasMarketValue

    public boolean hasMarketValue()

  Returns whether it has the market value of the portfolio in the portfolio default currency.

  Returns:
    whether it has the market value of the portfolio in the portfolio default currency

### getReturn1w

    public java.lang.Double getReturn1w()

  Returns the 1 week return (percentage).

  Returns:
    1 week return (percentage)

### setReturn1w

    public void setReturn1w(java.lang.Double return1w)

  Sets the 1 week return (percentage).

  Parameters:
    `return1w` - 1 week return (percentage) or `null` to reset

### hasReturn1w

    public boolean hasReturn1w()

  Returns whether it has the 1 week return (percentage).

  Returns:
    whether it has the 1 week return (percentage)

### getReturn1y

    public java.lang.Double getReturn1y()

  Returns the 1 year return (percentage).

  Returns:
    1 year return (percentage)

### setReturn1y

    public void setReturn1y(java.lang.Double return1y)

  Sets the 1 year return (percentage).

  Parameters:
    `return1y` - 1 year return (percentage) or `null` to reset

### hasReturn1y

    public boolean hasReturn1y()

  Returns whether it has the 1 year return (percentage).

  Returns:
    whether it has the 1 year return (percentage)

### getReturn3m

    public java.lang.Double getReturn3m()

  Returns the 3 month return (percentage).

  Returns:
    3 month return (percentage)

### setReturn3m

    public void setReturn3m(java.lang.Double return3m)

  Sets the 3 month return (percentage).

  Parameters:
    `return3m` - 3 month return (percentage) or `null` to reset

### hasReturn3m

    public boolean hasReturn3m()

  Returns whether it has the 3 month return (percentage).

  Returns:
    whether it has the 3 month return (percentage)

### getReturn3y

    public java.lang.Double getReturn3y()

  Returns the 3 year return (percentage).

  Returns:
    3 year return (percentage)

### setReturn3y

    public void setReturn3y(java.lang.Double return3y)

  Sets the 3 year return (percentage).

  Parameters:
    `return3y` - 3 year return (percentage) or `null` to reset

### hasReturn3y

    public boolean hasReturn3y()

  Returns whether it has the 3 year return (percentage).

  Returns:
    whether it has the 3 year return (percentage)

### getReturn4w

    public java.lang.Double getReturn4w()

  Returns the 4 week return (percentage).

  Returns:
    4 week return (percentage)

### setReturn4w

    public void setReturn4w(java.lang.Double return4w)

  Sets the 4 week return (percentage).

  Parameters:
    `return4w` - 4 week return (percentage) or `null` to reset

### hasReturn4w

    public boolean hasReturn4w()

  Returns whether it has the 4 week return (percentage).

  Returns:
    whether it has the 4 week return (percentage)

### getReturn5y

    public java.lang.Double getReturn5y()

  Returns the 5 year return (percentage).

  Returns:
    5 year return (percentage)

### setReturn5y

    public void setReturn5y(java.lang.Double return5y)

  Sets the 5 year return (percentage).

  Parameters:
    `return5y` - 5 year return (percentage) or `null` to reset

### hasReturn5y

    public boolean hasReturn5y()

  Returns whether it has the 5 year return (percentage).

  Returns:
    whether it has the 5 year return (percentage)

### getReturnOverall

    public java.lang.Double getReturnOverall()

  Returns the overall return (percentage).

  Returns:
    overall return (percentage)

### setReturnOverall

    public void setReturnOverall(java.lang.Double returnOverall)

  Sets the overall return (percentage).

  Parameters:
    `returnOverall` - overall return (percentage) or `null` to reset

### hasReturnOverall

    public boolean hasReturnOverall()

  Returns whether it has the overall return (percentage).

  Returns:
    whether it has the overall return (percentage)

### getReturnYTD

    public java.lang.Double getReturnYTD()

  Returns the Year-to-date return (percentage).

  Returns:
    Year-to-date return (percentage)

### setReturnYTD

    public void setReturnYTD(java.lang.Double returnYTD)

  Sets the Year-to-date return (percentage).

  Parameters:
    `returnYTD` - Year-to-date return (percentage) or `null` to reset

### hasReturnYTD

    public boolean hasReturnYTD()

  Returns whether it has the Year-to-date return (percentage).

  Returns:
    whether it has the Year-to-date return (percentage)

### validate

    protected void validate()

  Description copied from class: `AbstractExtension`
  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.

  Overrides:
    `validate` in class `AbstractExtension`

### 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

### putAttributes

    protected void putAttributes(AttributeGenerator generator)

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

  Overrides:
    `putAttributes` in class `AbstractExtension`
  Parameters:
    `generator` - attribute generator

### consumeAttributes

    protected void consumeAttributes(AttributeHelper helper)
                              throws ParseException

  Description copied from class: `AbstractExtension`
  Consumes attributes from the attribute helper. May also use `AttributeHelper.consumeContent(boolean)` to consume the element's text content. Called from `AbstractExtension.getHandler(com.google.gdata.data.ExtensionProfile, java.lang.String, java.lang.String, org.xml.sax.Attributes)`. Default implementation does nothing, though generally this is discouraged unless there really are no attributes.

  Overrides:
    `consumeAttributes` in class `AbstractExtension`
  Parameters:
    `helper` - attribute helper
  Throws:
    `ParseException` - any parsing exception

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`