Class OvernightIndexObservation
- java.lang.Object
-
- com.opengamma.strata.basics.index.OvernightIndexObservation
-
- All Implemented Interfaces:
IndexObservation
,Serializable
,org.joda.beans.Bean
,org.joda.beans.ImmutableBean
public final class OvernightIndexObservation extends Object implements IndexObservation, org.joda.beans.ImmutableBean, Serializable
Information about a single observation of an Overnight index.Observing an Overnight index requires knowledge of the index, fixing date, publication date, effective date and maturity date.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OvernightIndexObservation.Builder
The bean-builder forOvernightIndexObservation
.static class
OvernightIndexObservation.Meta
The meta-bean forOvernightIndexObservation
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OvernightIndexObservation.Builder
builder()
Returns a builder used to create an instance of the bean.boolean
equals(Object obj)
Compares this observation to another based on the index and fixing date.Currency
getCurrency()
Gets the currency of the Overnight index.LocalDate
getEffectiveDate()
Gets the effective date of the investment implied by the fixing date.LocalDate
getFixingDate()
Gets the date of the index fixing.OvernightIndex
getIndex()
Gets the Overnight index.LocalDate
getMaturityDate()
Gets the maturity date of the investment implied by the fixing date.LocalDate
getPublicationDate()
Gets the date that the rate implied by the fixing date is published.double
getYearFraction()
Gets the year fraction of the investment implied by the fixing date.int
hashCode()
Returns a hash code based on the index and fixing date.static OvernightIndexObservation.Meta
meta()
The meta-bean forOvernightIndexObservation
.OvernightIndexObservation.Meta
metaBean()
static OvernightIndexObservation
of(OvernightIndex index, LocalDate fixingDate, ReferenceData refData)
Creates anIborRateObservation
from an index and fixing date.OvernightIndexObservation.Builder
toBuilder()
Returns a builder that allows this bean to be mutated.String
toString()
-
-
-
Method Detail
-
of
public static OvernightIndexObservation of(OvernightIndex index, LocalDate fixingDate, ReferenceData refData)
Creates anIborRateObservation
from an index and fixing date.The reference data is used to find the maturity date from the fixing date.
- Parameters:
index
- the indexfixingDate
- the fixing daterefData
- the reference data to use when resolving holiday calendars- Returns:
- the rate observation
-
getCurrency
public Currency getCurrency()
Gets the currency of the Overnight index.- Returns:
- the currency of the index
-
equals
public boolean equals(Object obj)
Compares this observation to another based on the index and fixing date.The publication, effective and maturity dates are ignored.
-
hashCode
public int hashCode()
Returns a hash code based on the index and fixing date.The maturity date is ignored.
-
meta
public static OvernightIndexObservation.Meta meta()
The meta-bean forOvernightIndexObservation
.- Returns:
- the meta-bean, not null
-
builder
public static OvernightIndexObservation.Builder builder()
Returns a builder used to create an instance of the bean.- Returns:
- the builder, not null
-
metaBean
public OvernightIndexObservation.Meta metaBean()
- Specified by:
metaBean
in interfaceorg.joda.beans.Bean
-
getIndex
public OvernightIndex getIndex()
Gets the Overnight index.The rate will be queried from this index.
- Specified by:
getIndex
in interfaceIndexObservation
- Returns:
- the value of the property, not null
-
getFixingDate
public LocalDate getFixingDate()
Gets the date of the index fixing.This is an adjusted date with any business day rule applied. Valid business days are defined by
RateIndex.getFixingCalendar()
.- Returns:
- the value of the property, not null
-
getPublicationDate
public LocalDate getPublicationDate()
Gets the date that the rate implied by the fixing date is published.This is an adjusted date with any business day rule applied. This must be equal to
OvernightIndex.calculatePublicationFromFixing(LocalDate, ReferenceData)
.- Returns:
- the value of the property, not null
-
getEffectiveDate
public LocalDate getEffectiveDate()
Gets the effective date of the investment implied by the fixing date.This is an adjusted date with any business day rule applied. This must be equal to
OvernightIndex.calculateEffectiveFromFixing(LocalDate, ReferenceData)
.- Returns:
- the value of the property, not null
-
getMaturityDate
public LocalDate getMaturityDate()
Gets the maturity date of the investment implied by the fixing date.This is an adjusted date with any business day rule applied. This must be equal to
OvernightIndex.calculateMaturityFromEffective(LocalDate, ReferenceData)
.- Returns:
- the value of the property, not null
-
getYearFraction
public double getYearFraction()
Gets the year fraction of the investment implied by the fixing date.This is calculated using the day count of the index. It represents the fraction of the year between the effective date and the maturity date. Typically the value will be close to 1 for one year and close to 0.5 for six months.
- Returns:
- the value of the property, not null
-
toBuilder
public OvernightIndexObservation.Builder toBuilder()
Returns a builder that allows this bean to be mutated.- Returns:
- the mutable builder, not null
-
-