Package com.opengamma.strata.product.etd
Class EtdFutureTrade
- java.lang.Object
-
- com.opengamma.strata.product.etd.EtdFutureTrade
-
- All Implemented Interfaces:
CalculationTarget,ResolvableCalculationTarget,EtdTrade,PortfolioItem,ResolvableSecurityTrade,SecurityQuantity,SecurityQuantityTrade,Trade,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class EtdFutureTrade extends Object implements EtdTrade, ResolvableSecurityTrade, org.joda.beans.ImmutableBean, Serializable
A trade representing an ETD future.A trade in an underlying
EtdFutureSecurity.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEtdFutureTrade.BuilderThe bean-builder forEtdFutureTrade.static classEtdFutureTrade.MetaThe meta-bean forEtdFutureTrade.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EtdFutureTrade.Builderbuilder()Returns a builder used to create an instance of the bean.booleanequals(Object obj)TradeInfogetInfo()Gets the additional trade information, defaulted to an empty instance.doublegetPrice()Gets the price that was traded, in decimal form.doublegetQuantity()Gets the quantity that was traded.EtdFutureSecuritygetSecurity()Gets the security that was traded.inthashCode()static EtdFutureTrade.Metameta()The meta-bean forEtdFutureTrade.EtdFutureTrade.MetametaBean()static EtdFutureTradeof(TradeInfo tradeInfo, EtdFutureSecurity security, double quantity, double price)Obtains an instance from trade information, security, quantity and price.PortfolioItemSummarysummarize()Summarizes the portfolio item.EtdFutureTrade.BuildertoBuilder()Returns a builder that allows this bean to be mutated.StringtoString()EtdFutureTradewithInfo(PortfolioItemInfo info)Returns an instance with the specified info.EtdFutureTradewithPrice(double price)Returns an instance with the specified price.EtdFutureTradewithQuantity(double quantity)Returns an instance with the specified quantity.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.etd.EtdTrade
getCurrency, getSecurityId, getType
-
Methods inherited from interface com.opengamma.strata.product.PortfolioItem
getId
-
Methods inherited from interface com.opengamma.strata.product.ResolvableSecurityTrade
resolveTarget
-
-
-
-
Method Detail
-
of
public static EtdFutureTrade of(TradeInfo tradeInfo, EtdFutureSecurity security, double quantity, double price)
Obtains an instance from trade information, security, quantity and price.- Parameters:
tradeInfo- the trade informationsecurity- the security that was tradedquantity- the quantity that was tradedprice- the price that was traded- Returns:
- the trade
-
summarize
public PortfolioItemSummary summarize()
Description copied from interface:PortfolioItemSummarizes the portfolio item.This provides a summary, including a human readable description.
- Specified by:
summarizein interfacePortfolioItem- Specified by:
summarizein interfaceTrade- Returns:
- the summary of the item
-
withInfo
public EtdFutureTrade withInfo(PortfolioItemInfo info)
Description copied from interface:SecurityQuantityTradeReturns an instance with the specified info.- Specified by:
withInfoin interfacePortfolioItem- Specified by:
withInfoin interfaceResolvableSecurityTrade- Specified by:
withInfoin interfaceSecurityQuantityTrade- Specified by:
withInfoin interfaceTrade- Parameters:
info- the new info- Returns:
- the instance with the specified info
-
withQuantity
public EtdFutureTrade withQuantity(double quantity)
Description copied from interface:SecurityQuantityTradeReturns an instance with the specified quantity.- Specified by:
withQuantityin interfaceResolvableSecurityTrade- Specified by:
withQuantityin interfaceSecurityQuantityTrade- Parameters:
quantity- the new quantity- Returns:
- the instance with the specified quantity
-
withPrice
public EtdFutureTrade withPrice(double price)
Description copied from interface:SecurityQuantityTradeReturns an instance with the specified price.- Specified by:
withPricein interfaceResolvableSecurityTrade- Specified by:
withPricein interfaceSecurityQuantityTrade- Parameters:
price- the new price- Returns:
- the instance with the specified price
-
meta
public static EtdFutureTrade.Meta meta()
The meta-bean forEtdFutureTrade.- Returns:
- the meta-bean, not null
-
builder
public static EtdFutureTrade.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public EtdFutureTrade.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getInfo
public TradeInfo getInfo()
Gets the additional trade information, defaulted to an empty instance.This allows additional information to be attached to the trade.
- Specified by:
getInfoin interfacePortfolioItem- Specified by:
getInfoin interfaceTrade- Returns:
- the value of the property, not null
-
getSecurity
public EtdFutureSecurity getSecurity()
Gets the security that was traded.- Specified by:
getSecurityin interfaceEtdTrade- Returns:
- the value of the property, not null
-
getQuantity
public double getQuantity()
Gets the quantity that was traded.This is the number of contracts that were traded. This will be positive if buying and negative if selling.
- Specified by:
getQuantityin interfaceSecurityQuantity- Returns:
- the value of the property
-
getPrice
public double getPrice()
Gets the price that was traded, in decimal form.This is the price agreed when the trade occurred.
- Specified by:
getPricein interfaceSecurityQuantityTrade- Returns:
- the value of the property
-
toBuilder
public EtdFutureTrade.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-