public final class GenericSecurityTrade extends Object implements SecuritizedProductTrade<GenericSecurity>, org.joda.beans.ImmutableBean, Serializable
This trade represents a trade in a security, defined by a quantity and price. The security is embedded directly, however the underlying product model is not available. The security may be of any kind, including equities, bonds and exchange traded derivatives (ETD).
| Modifier and Type | Class and Description |
|---|---|
static class |
GenericSecurityTrade.Builder
The bean-builder for
GenericSecurityTrade. |
static class |
GenericSecurityTrade.Meta
The meta-bean for
GenericSecurityTrade. |
| Modifier and Type | Method and Description |
|---|---|
static GenericSecurityTrade.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
Currency |
getCurrency()
Gets the currency of the trade.
|
TradeInfo |
getInfo()
Gets the additional trade information, defaulted to an empty instance.
|
double |
getPrice()
Gets the price that was traded, in decimal form.
|
GenericSecurity |
getProduct()
Gets the underlying product that was agreed when the trade occurred.
|
double |
getQuantity()
Gets the quantity that was traded.
|
GenericSecurity |
getSecurity()
Gets the security that was traded.
|
SecurityId |
getSecurityId()
Gets the security identifier.
|
int |
hashCode() |
static GenericSecurityTrade.Meta |
meta()
The meta-bean for
GenericSecurityTrade. |
GenericSecurityTrade.Meta |
metaBean() |
static GenericSecurityTrade |
of(TradeInfo tradeInfo,
GenericSecurity security,
double quantity,
double price)
Obtains an instance from trade information, security, quantity and price.
|
PortfolioItemSummary |
summarize()
Summarizes the portfolio item.
|
GenericSecurityTrade.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
GenericSecurityTrade |
withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.
|
GenericSecurityTrade |
withPrice(double price)
Returns an instance with the specified price.
|
GenericSecurityTrade |
withQuantity(double quantity)
Returns an instance with the specified quantity.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetIdpublic static GenericSecurityTrade of(TradeInfo tradeInfo, GenericSecurity security, double quantity, double price)
tradeInfo - the trade informationsecurity - the security that was tradedquantity - the quantity that was tradedprice - the price that was tradedpublic PortfolioItemSummary summarize()
PortfolioItemThis provides a summary, including a human readable description.
summarize in interface PortfolioItemsummarize in interface Tradepublic SecurityId getSecurityId()
SecurityQuantityThis identifier uniquely identifies the security within the system.
getSecurityId in interface SecuritizedProductPortfolioItem<GenericSecurity>getSecurityId in interface SecurityQuantitypublic GenericSecurity getProduct()
ProductTradeThe product captures the contracted financial details of the trade.
getProduct in interface ProductTradegetProduct in interface SecuritizedProductPortfolioItem<GenericSecurity>public GenericSecurityTrade withInfo(PortfolioItemInfo info)
SecuritizedProductTradewithInfo in interface PortfolioItemwithInfo in interface ProductTradewithInfo in interface SecuritizedProductTrade<GenericSecurity>withInfo in interface SecurityQuantityTradewithInfo in interface Tradeinfo - the new infopublic GenericSecurityTrade withQuantity(double quantity)
SecuritizedProductTradewithQuantity in interface SecuritizedProductPortfolioItem<GenericSecurity>withQuantity in interface SecuritizedProductTrade<GenericSecurity>withQuantity in interface SecurityQuantityTradequantity - the new quantitypublic GenericSecurityTrade withPrice(double price)
SecuritizedProductTradewithPrice in interface SecuritizedProductTrade<GenericSecurity>withPrice in interface SecurityQuantityTradeprice - the new pricepublic Currency getCurrency()
This is typically the same as the currency of the product.
getCurrency in interface SecuritizedProductPortfolioItem<GenericSecurity>public static GenericSecurityTrade.Meta meta()
GenericSecurityTrade.public static GenericSecurityTrade.Builder builder()
public GenericSecurityTrade.Meta metaBean()
metaBean in interface org.joda.beans.Beanpublic TradeInfo getInfo()
This allows additional information to be attached to the trade.
getInfo in interface PortfolioItemgetInfo in interface Tradepublic GenericSecurity getSecurity()
public double getQuantity()
This is the number of contracts that were traded. This will be positive if buying and negative if selling.
getQuantity in interface SecurityQuantitypublic double getPrice()
This is the price agreed when the trade occurred.
getPrice in interface SecurityQuantityTradepublic GenericSecurityTrade.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.