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 class
ImmutableFloatingRateName.Meta
The meta-bean forImmutableFloatingRateName
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getExternalName()
Gets the external name, typically from FpML, such as 'GBP-LIBOR-BBA'.OptionalInt
getFixingDateOffsetDays()
Gets the fixing date offset, in days, optional.FloatingRateName
getFloatingRateName()
Gets the associated floating rate name.String
getIndexName()
Gets the root of the name of the index, such as 'GBP-LIBOR', to which the tenor is appended.String
getName()
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.FloatingRateType
getType()
Gets the type of the index.int
hashCode()
static ImmutableFloatingRateName.Meta
meta()
The meta-bean forImmutableFloatingRateName
.ImmutableFloatingRateName.Meta
metaBean()
FloatingRateName
normalized()
Gets the normalized form of the floating rate name.static ImmutableFloatingRateName
of(String externalName, String indexName, FloatingRateType type)
Obtains an instance from the specified external name, index name and type.static ImmutableFloatingRateName
of(String externalName, String indexName, FloatingRateType type, int fixingDateOffsetDays)
Obtains an instance from the specified external name, index name and type.IborIndex
toIborIndex(Tenor tenor)
Checks and returns an Ibor index.DaysAdjustment
toIborIndexFixingOffset()
Checks and returns the fixing offset associated with the Ibor index.OvernightIndex
toOvernightIndex()
Converts to anOvernightIndex
.PriceIndex
toPriceIndex()
Converts to anPriceIndex
.String
toString()
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:FloatingRateName
Gets 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:
getName
in interfaceFloatingRateName
- Specified by:
getName
in interfaceNamed
- Returns:
- the external name
-
getFloatingRateName
public FloatingRateName getFloatingRateName()
Description copied from interface:FloatingRate
Gets the associated floating rate name.- Specified by:
getFloatingRateName
in interfaceFloatingRate
- Returns:
- the floating rate name
-
getTenors
public Set<Tenor> getTenors()
Description copied from interface:FloatingRateName
Gets the active tenors that are applicable for this floating rate.Overnight and Price indices will return an empty set.
- Specified by:
getTenors
in interfaceFloatingRateName
- Returns:
- the available tenors
-
normalized
public FloatingRateName normalized()
Description copied from interface:FloatingRateName
Gets 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:
normalized
in interfaceFloatingRateName
- Returns:
- the normalized name
-
toIborIndex
public IborIndex toIborIndex(Tenor tenor)
Description copied from interface:FloatingRateName
Checks 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:
toIborIndex
in interfaceFloatingRateName
- Parameters:
tenor
- the tenor of the index- Returns:
- the index
-
toIborIndexFixingOffset
public DaysAdjustment toIborIndexFixingOffset()
Description copied from interface:FloatingRateName
Checks 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:
toIborIndexFixingOffset
in interfaceFloatingRateName
- Returns:
- the fixing offset applicable to the index
-
toOvernightIndex
public OvernightIndex toOvernightIndex()
Description copied from interface:FloatingRateName
Converts to anOvernightIndex
.If this name represents an Overnight index, then this method returns the matching
OvernightIndex
. If not, an exception is thrown.- Specified by:
toOvernightIndex
in interfaceFloatingRateName
- Returns:
- the index
-
toPriceIndex
public PriceIndex toPriceIndex()
Description copied from interface:FloatingRateName
Converts to anPriceIndex
.If this name represents a price index, then this method returns the matching
PriceIndex
. If not, an exception is thrown.- Specified by:
toPriceIndex
in 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:
metaBean
in 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 byIborIndex
orOvernightIndex
. Typically, multipleFloatingRateName
names 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:
getType
in 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
-
-