public final class SecurityTrade extends Object implements ResolvableSecurityTrade, org.joda.beans.ImmutableBean, Serializable
This trade represents a trade in a security, defined by a quantity and price.
The security is referenced using SecurityId.
The identifier may be looked up in ReferenceData.
The reference may be to any kind of security, including equities, bonds and exchange traded derivatives (ETD).
| Modifier and Type | Class and Description |
|---|---|
static class |
SecurityTrade.Builder
The bean-builder for
SecurityTrade. |
static class |
SecurityTrade.Meta
The meta-bean for
SecurityTrade. |
| Modifier and Type | Method and Description |
|---|---|
static SecurityTrade.Builder |
builder()
Returns a builder used to create an instance of the bean.
|
boolean |
equals(Object obj) |
TradeInfo |
getInfo()
Gets the additional trade information, defaulted to an empty instance.
|
double |
getPrice()
Gets the price agreed when the trade occurred.
|
double |
getQuantity()
Gets the quantity that was traded.
|
SecurityId |
getSecurityId()
Gets the identifier of the security that was traded.
|
int |
hashCode() |
static SecurityTrade.Meta |
meta()
The meta-bean for
SecurityTrade. |
SecurityTrade.Meta |
metaBean() |
static SecurityTrade |
of(TradeInfo tradeInfo,
SecurityId securityId,
double quantity,
double price)
Obtains an instance from trade information, identifier, quantity and price.
|
PortfolioItemSummary |
summarize()
Summarizes the portfolio item.
|
SecurityTrade.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
SecurityTrade |
withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.
|
SecurityTrade |
withPrice(double price)
Returns an instance with the specified price.
|
SecurityTrade |
withQuantity(double quantity)
Returns an instance with the specified quantity.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitresolveTargetgetIdpublic static SecurityTrade of(TradeInfo tradeInfo, SecurityId securityId, double quantity, double price)
tradeInfo - the trade informationsecurityId - the identifier of the underlying securityquantity - 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 SecurityTrade withInfo(PortfolioItemInfo info)
ResolvableSecurityTradewithInfo in interface PortfolioItemwithInfo in interface ResolvableSecurityTradewithInfo in interface SecurityQuantityTradewithInfo in interface Tradeinfo - the new infopublic SecurityTrade withQuantity(double quantity)
ResolvableSecurityTradewithQuantity in interface ResolvableSecurityTradewithQuantity in interface SecurityQuantityTradequantity - the new quantitypublic SecurityTrade withPrice(double price)
ResolvableSecurityTradewithPrice in interface ResolvableSecurityTradewithPrice in interface SecurityQuantityTradeprice - the new pricepublic static SecurityTrade.Meta meta()
SecurityTrade.public static SecurityTrade.Builder builder()
public SecurityTrade.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 SecurityId getSecurityId()
This identifier uniquely identifies the security within the system.
getSecurityId in interface SecurityQuantitypublic double getQuantity()
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 SecurityTrade.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.