public class TransactionData extends ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
Constructor and Description |
---|
TransactionData()
Default mutable constructor.
|
TransactionData(DateTime date,
java.lang.String notes,
java.lang.Double shares,
java.lang.String type)
Immutable constructor.
|
Modifier and Type | Method and Description |
---|---|
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() |
addExtension, addRepeatingExtension, generateCumulativeXmlBlob, getExtension, getExtensions, getHandler, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit
disableStrictValidation, enableStrictValidation, generate, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, setImmutable
public TransactionData()
public TransactionData(DateTime date, java.lang.String notes, java.lang.Double shares, java.lang.String type)
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").public void declareExtensions(ExtensionProfile extProfile)
ExtensionPoint
declareExtensions
in class ExtensionPoint
extProfile
- the ExtensionProfile to initialize.public Commission getCommission()
public void setCommission(Commission commission)
commission
- commission for the transaction or null
to
resetpublic boolean hasCommission()
public DateTime getDate()
public void setDate(DateTime date)
date
- date at which the transaction occurred or null
to
resetpublic boolean hasDate()
public java.lang.String getNotes()
public void setNotes(java.lang.String notes)
notes
- notes or null
to resetpublic boolean hasNotes()
public Price getPrice()
public void setPrice(Price price)
price
- price of the transaction or null
to resetpublic boolean hasPrice()
public java.lang.Double getShares()
public void setShares(java.lang.Double shares)
shares
- number of shares involved in the transaction or
null
to resetpublic boolean hasShares()
public java.lang.String getType()
public void setType(java.lang.String type)
type
- type for the transaction (can be "Buy", "Sell", "Buy to Cover"
or "Sell Short") or null
to resetpublic boolean hasType()
public static ExtensionDescription getDefaultDescription(boolean required, boolean repeatable)
required
- whether it is requiredrepeatable
- whether it is repeatablepublic java.lang.String toString()
toString
in class java.lang.Object