public final class BillTrade extends Object implements SecuritizedProductTrade<Bill>, ResolvableTrade<ResolvedBillTrade>, org.joda.beans.ImmutableBean, Serializable
A trade in an underlying Bill.
| Modifier and Type | Class and Description |
|---|---|
static class |
BillTrade.Builder
The bean-builder for
BillTrade. |
static class |
BillTrade.Meta
The meta-bean for
BillTrade. |
| Modifier and Type | Method and Description |
|---|---|
static BillTrade.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 at which the bill was traded, in decimal form.
|
Bill |
getProduct()
Gets the bill that was traded.
|
double |
getQuantity()
Gets the quantity that was traded.
|
int |
hashCode() |
static BillTrade.Meta |
meta()
The meta-bean for
BillTrade. |
BillTrade.Meta |
metaBean() |
static BillTrade |
ofPrice(TradeInfo info,
Bill product,
double quantity,
double price)
Generates a Bill trade instance from the price.
|
static BillTrade |
ofYield(TradeInfo info,
Bill product,
double quantity,
double yield)
Generates a Bill trade instance where the price is computed from the traded yield.
|
ResolvedBillTrade |
resolve(ReferenceData refData)
Resolves this trade using the specified reference data.
|
PortfolioItemSummary |
summarize()
Summarizes the portfolio item.
|
BillTrade.Builder |
toBuilder()
Returns a builder that allows this bean to be mutated.
|
String |
toString() |
BillTrade |
withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.
|
BillTrade |
withPrice(double price)
Returns an instance with the specified price.
|
BillTrade |
withQuantity(double quantity)
Returns an instance with the specified quantity.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetIdgetCurrency, getSecurityIdpublic static BillTrade ofYield(TradeInfo info, Bill product, double quantity, double yield)
info - the additional trade informationproduct - the bill that was tradedquantity - the quantity that was tradedyield - the yield at which the bill was tradedpublic static BillTrade ofPrice(TradeInfo info, Bill product, double quantity, double price)
info - the additional trade informationproduct - the bill that was tradedquantity - the quantity that was tradedprice - the price at which the bill was tradedpublic ResolvedBillTrade resolve(ReferenceData refData)
ResolvableTrade
This converts this trade to the equivalent resolved form.
All ReferenceDataId identifiers in this instance will be resolved.
The resulting ResolvedTrade is optimized for pricing.
Resolved objects may be bound to data that changes over time, such as holiday calendars. If the data changes, such as the addition of a new holiday, the resolved form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
resolve in interface Resolvable<ResolvedBillTrade>resolve in interface ResolvableTrade<ResolvedBillTrade>refData - the reference data to use when resolvingpublic BillTrade withInfo(PortfolioItemInfo info)
SecuritizedProductTradewithInfo in interface PortfolioItemwithInfo in interface ProductTradewithInfo in interface ResolvableTrade<ResolvedBillTrade>withInfo in interface SecuritizedProductTrade<Bill>withInfo in interface SecurityQuantityTradewithInfo in interface Tradeinfo - the new infopublic BillTrade withQuantity(double quantity)
SecuritizedProductTradewithQuantity in interface SecuritizedProductPortfolioItem<Bill>withQuantity in interface SecuritizedProductTrade<Bill>withQuantity in interface SecurityQuantityTradequantity - the new quantitypublic BillTrade withPrice(double price)
SecuritizedProductTradewithPrice in interface SecuritizedProductTrade<Bill>withPrice in interface SecurityQuantityTradeprice - the new pricepublic PortfolioItemSummary summarize()
PortfolioItemThis provides a summary, including a human readable description.
summarize in interface PortfolioItemsummarize in interface Tradepublic static BillTrade.Meta meta()
BillTrade.public static BillTrade.Builder builder()
public BillTrade.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 Bill getProduct()
The product captures the contracted financial details of the trade.
getProduct in interface ProductTradegetProduct in interface SecuritizedProductPortfolioItem<Bill>public double getQuantity()
This will be positive if buying and negative if selling.
getQuantity in interface SecurityQuantitypublic double getPrice()
getPrice in interface SecurityQuantityTradepublic BillTrade.Builder toBuilder()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.