Class FxIndexObservation
- java.lang.Object
-
- com.opengamma.strata.basics.index.FxIndexObservation
-
- All Implemented Interfaces:
IndexObservation,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class FxIndexObservation extends Object implements IndexObservation, org.joda.beans.ImmutableBean, Serializable
Information about a single observation of an FX index.Observing an FX index requires knowledge of the index, fixing date and maturity date.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFxIndexObservation.MetaThe meta-bean forFxIndexObservation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Compares this observation to another based on the index and fixing date.CurrencyPairgetCurrencyPair()Gets the currency pair of the FX index.LocalDategetFixingDate()Gets the date of the index fixing.FxIndexgetIndex()Gets the FX index.LocalDategetMaturityDate()Gets the date of the transfer implied by the fixing date.inthashCode()Returns a hash code based on the index and fixing date.static FxIndexObservation.Metameta()The meta-bean forFxIndexObservation.FxIndexObservation.MetametaBean()static FxIndexObservationof(FxIndex index, LocalDate fixingDate, ReferenceData refData)Creates an instance from an index and fixing date.StringtoString()
-
-
-
Method Detail
-
of
public static FxIndexObservation of(FxIndex index, LocalDate fixingDate, ReferenceData refData)
Creates an instance 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
-
getCurrencyPair
public CurrencyPair getCurrencyPair()
Gets the currency pair of the FX index.- Returns:
- the currency pair of the index
-
equals
public boolean equals(Object obj)
Compares this observation to another based on the index and fixing date.The maturity date is ignored.
-
hashCode
public int hashCode()
Returns a hash code based on the index and fixing date.The maturity date is ignored.
-
meta
public static FxIndexObservation.Meta meta()
The meta-bean forFxIndexObservation.- Returns:
- the meta-bean, not null
-
metaBean
public FxIndexObservation.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getIndex
public FxIndex getIndex()
Gets the FX index.The rate will be queried from this index.
- Specified by:
getIndexin 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
FxIndex.getFixingCalendar().- Returns:
- the value of the property, not null
-
getMaturityDate
public LocalDate getMaturityDate()
Gets the date of the transfer implied by the fixing date.This is an adjusted date with any business day rule applied. This must be equal to
FxIndex.calculateMaturityFromFixing(LocalDate, ReferenceData).- Returns:
- the value of the property, not null
-
-