Class ImmutableFloatingRateName
- java.lang.Object
-
- com.opengamma.strata.basics.index.ImmutableFloatingRateName
-
- All Implemented Interfaces:
FloatingRate,FloatingRateName,Named,Serializable,org.joda.beans.Bean,org.joda.beans.ImmutableBean
public final class ImmutableFloatingRateName extends Object implements FloatingRateName, org.joda.beans.ImmutableBean, Serializable
An immutable floating rate index name, such as Libor, Euribor or US Fed Fund.This is the standard immutable implementation of
FloatingRateName.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableFloatingRateName.MetaThe meta-bean forImmutableFloatingRateName.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetExternalName()Gets the external name, typically from FpML, such as 'GBP-LIBOR-BBA'.OptionalIntgetFixingDateOffsetDays()Gets the fixing date offset, in days, optional.FloatingRateNamegetFloatingRateName()Gets the associated floating rate name.StringgetIndexName()Gets the root of the name of the index, such as 'GBP-LIBOR', to which the tenor is appended.StringgetName()Gets the name that uniquely identifies this floating rate, such as 'GBP-LIBOR'.Set<Tenor>getTenors()Gets the active tenors that are applicable for this floating rate.FloatingRateTypegetType()Gets the type of the index.inthashCode()static ImmutableFloatingRateName.Metameta()The meta-bean forImmutableFloatingRateName.ImmutableFloatingRateName.MetametaBean()FloatingRateNamenormalized()Gets the normalized form of the floating rate name.static ImmutableFloatingRateNameof(String externalName, String indexName, FloatingRateType type)Obtains an instance from the specified external name, index name and type.static ImmutableFloatingRateNameof(String externalName, String indexName, FloatingRateType type, int fixingDateOffsetDays)Obtains an instance from the specified external name, index name and type.IborIndextoIborIndex(Tenor tenor)Checks and returns an Ibor index.DaysAdjustmenttoIborIndexFixingOffset()Checks and returns the fixing offset associated with the Ibor index.OvernightIndextoOvernightIndex()Converts to anOvernightIndex.PriceIndextoPriceIndex()Converts to anPriceIndex.StringtoString()Returns the name of the index.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.basics.index.FloatingRateName
getCurrency, getDefaultTenor, toFloatingRateIndex, toFloatingRateIndex
-
-
-
-
Method Detail
-
of
public static ImmutableFloatingRateName of(String externalName, String indexName, FloatingRateType type)
Obtains an instance from the specified external name, index name and type.- Parameters:
externalName- the unique nameindexName- the name of the indextype- the type - Ibor, Overnight or Price- Returns:
- the name
- Throws:
IllegalArgumentException- if the name is not known
-
of
public static ImmutableFloatingRateName of(String externalName, String indexName, FloatingRateType type, int fixingDateOffsetDays)
Obtains an instance from the specified external name, index name and type.- Parameters:
externalName- the unique nameindexName- the name of the indextype- the type - Ibor, Overnight or PricefixingDateOffsetDays- the fixing date offset, in days, negative to use the standard- Returns:
- the name
- Throws:
IllegalArgumentException- if the name is not known
-
getName
public String getName()
Description copied from interface:FloatingRateNameGets the name that uniquely identifies this floating rate, such as 'GBP-LIBOR'.This name is used in serialization and can be parsed using
FloatingRateName.of(String).- Specified by:
getNamein interfaceFloatingRateName- Specified by:
getNamein interfaceNamed- Returns:
- the external name
-
getFloatingRateName
public FloatingRateName getFloatingRateName()
Description copied from interface:FloatingRateGets the associated floating rate name.- Specified by:
getFloatingRateNamein interfaceFloatingRate- Returns:
- the floating rate name
-
getTenors
public Set<Tenor> getTenors()
Description copied from interface:FloatingRateNameGets the active tenors that are applicable for this floating rate.Overnight and Price indices will return an empty set.
- Specified by:
getTenorsin interfaceFloatingRateName- Returns:
- the available tenors
-
normalized
public FloatingRateName normalized()
Description copied from interface:FloatingRateNameGets the normalized form of the floating rate name.The normalized for is the name that Strata uses for the index. For example, the normalized form of 'GBP-LIBOR-BBA' is 'GBP-LIBOR', and the normalized form of 'EUR-EURIBOR-Reuters' is 'EUR-EURIBOR'. Note that for Ibor indices, the tenor is not present.
- Specified by:
normalizedin interfaceFloatingRateName- Returns:
- the normalized name
-
toIborIndex
public IborIndex toIborIndex(Tenor tenor)
Description copied from interface:FloatingRateNameChecks and returns an Ibor index.If this name represents an Ibor index, then this method returns the matching
IborIndex. If not, an exception is thrown.- Specified by:
toIborIndexin interfaceFloatingRateName- Parameters:
tenor- the tenor of the index- Returns:
- the index
-
toIborIndexFixingOffset
public DaysAdjustment toIborIndexFixingOffset()
Description copied from interface:FloatingRateNameChecks and returns the fixing offset associated with the Ibor index.If this name represents an Ibor index, then this method returns the associated fixing offset. If not, an exception is thrown.
This method exists primarily to handle DKK CIBOR, where there are two floating rate names but only one underlying index. The CIBOR index itself has a convention where the fixing date is 2 days before the reset date and the effective date is 2 days after the fixing date, matching the name "DKK-CIBOR2-DKNA13". The alternative name, "DKK-CIBOR-DKNA13", has the fixing date equal to the reset date, but with the effective date two days later.
- Specified by:
toIborIndexFixingOffsetin interfaceFloatingRateName- Returns:
- the fixing offset applicable to the index
-
toOvernightIndex
public OvernightIndex toOvernightIndex()
Description copied from interface:FloatingRateNameConverts to anOvernightIndex.If this name represents an Overnight index, then this method returns the matching
OvernightIndex. If not, an exception is thrown.- Specified by:
toOvernightIndexin interfaceFloatingRateName- Returns:
- the index
-
toPriceIndex
public PriceIndex toPriceIndex()
Description copied from interface:FloatingRateNameConverts to anPriceIndex.If this name represents a price index, then this method returns the matching
PriceIndex. If not, an exception is thrown.- Specified by:
toPriceIndexin interfaceFloatingRateName- Returns:
- the index
-
toString
public String toString()
Returns the name of the index.
-
meta
public static ImmutableFloatingRateName.Meta meta()
The meta-bean forImmutableFloatingRateName.- Returns:
- the meta-bean, not null
-
metaBean
public ImmutableFloatingRateName.Meta metaBean()
- Specified by:
metaBeanin interfaceorg.joda.beans.Bean
-
getExternalName
public String getExternalName()
Gets the external name, typically from FpML, such as 'GBP-LIBOR-BBA'.- Returns:
- the value of the property, not empty
-
getIndexName
public String getIndexName()
Gets the root of the name of the index, such as 'GBP-LIBOR', to which the tenor is appended. This name matches that used byIborIndexorOvernightIndex. Typically, multipleFloatingRateNamenames map to one Ibor or Overnight index.- Returns:
- the value of the property, not empty
-
getType
public FloatingRateType getType()
Gets the type of the index.- Specified by:
getTypein interfaceFloatingRateName- Returns:
- the value of the property, not null
-
getFixingDateOffsetDays
public OptionalInt getFixingDateOffsetDays()
Gets the fixing date offset, in days, optional. This is used when a floating rate name implies a non-standard fixing date offset. This is only used for Ibor Indices, and currently only for DKK CIBOR.- Returns:
- the optional value of the property, not null
-
-