Class Bill
- java.lang.Object
-
- com.opengamma.strata.product.bond.Bill
-
- All Implemented Interfaces:
Resolvable<ResolvedBill>
,Product
,SecuritizedProduct
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class Bill extends Object implements SecuritizedProduct, Resolvable<ResolvedBill>, org.joda.beans.ImmutableBean, Serializable
A bill.A bill is a financial instrument that represents a unique fixed payment.
Price and yield
Strata uses decimal yields and prices for bills in the trade model, pricers and market data. For example, a price of 99.32% is represented in Strata by 0.9932 and a yield of 1.32% is represented by 0.0132.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Bill.Builder
The bean-builder forBill
.static class
Bill.Meta
The meta-bean forBill
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Bill.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
Currency
getCurrency()
Gets the currency that the security is traded in.DayCount
getDayCount()
Gets the day count convention applicable.LegalEntityId
getLegalEntityId()
Gets the legal entity identifier.AdjustablePayment
getNotional()
Gets the adjustable notional payment of the bill notional, the amount must be positive.SecurityId
getSecurityId()
Gets the security identifier.DaysAdjustment
getSettlementDateOffset()
Gets the number of days between valuation date and settlement date.BillYieldConvention
getYieldConvention()
Gets yield convention.int
hashCode()
static Bill.Meta
meta()
The meta-bean forBill
.Bill.Meta
metaBean()
double
priceFromYield(double yield, LocalDate settlementDate)
Computes the price from the yield at a given settlement date.ResolvedBill
resolve(ReferenceData refData)
Resolves this object using the specified reference data.Bill.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
double
yieldFromPrice(double price, LocalDate settlementDate)
Computes the yield from the price at a given settlement date.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.product.Product
allPaymentCurrencies, isCrossCurrency
-
Methods inherited from interface com.opengamma.strata.product.SecuritizedProduct
allCurrencies
-
-
-
-
Method Detail
-
getCurrency
public Currency getCurrency()
Description copied from interface:SecuritizedProduct
Gets the currency that the security is traded in.- Specified by:
getCurrency
in interfaceSecuritizedProduct
- Returns:
- the trading currency
-
priceFromYield
public double priceFromYield(double yield, LocalDate settlementDate)
Computes the price from the yield at a given settlement date.- Parameters:
yield
- the yieldsettlementDate
- the settlement date- Returns:
- the price
-
yieldFromPrice
public double yieldFromPrice(double price, LocalDate settlementDate)
Computes the yield from the price at a given settlement date.- Parameters:
price
- the pricesettlementDate
- the settlement date- Returns:
- the yield
-
resolve
public ResolvedBill resolve(ReferenceData refData)
Description copied from interface:Resolvable
Resolves this object using the specified reference data.This converts the object implementing this interface to the equivalent resolved form. All
ReferenceDataId
identifiers in this instance will be resolved. The resolved form will typically be a type that 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.
- Specified by:
resolve
in interfaceResolvable<ResolvedBill>
- Parameters:
refData
- the reference data to use when resolving- Returns:
- the resolved instance
-
meta
public static Bill.Meta meta()
The meta-bean forBill
.- Returns:
- the meta-bean, not null
-
builder
public static Bill.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public Bill.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getSecurityId
public SecurityId getSecurityId()
Gets the security identifier.This identifier uniquely identifies the security within the system.
- Specified by:
getSecurityId
in interfaceSecuritizedProduct
- Returns:
- the value of the property, not null
-
getNotional
public AdjustablePayment getNotional()
Gets the adjustable notional payment of the bill notional, the amount must be positive.- Returns:
- the value of the property, not null
-
getDayCount
public DayCount getDayCount()
Gets the day count convention applicable.The conversion from dates to a numerical value is made based on this day count.
- Returns:
- the value of the property, not null
-
getYieldConvention
public BillYieldConvention getYieldConvention()
Gets yield convention.The convention defines how to convert from yield to price and inversely.
- Returns:
- the value of the property, not null
-
getLegalEntityId
public LegalEntityId getLegalEntityId()
Gets the legal entity identifier.This identifier is used for the legal entity that issues the bill.
- Returns:
- the value of the property, not null
-
getSettlementDateOffset
public DaysAdjustment getSettlementDateOffset()
Gets the number of days between valuation date and settlement date.It is usually one business day for US and UK bills and two days for Euroland government bills.
- Returns:
- the value of the property, not null
-
toBuilder
public Bill.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-