Enum SwapLegType
- java.lang.Object
-
- java.lang.Enum<SwapLegType>
-
- com.opengamma.strata.product.swap.SwapLegType
-
- All Implemented Interfaces:
Named,NamedEnum,Serializable,Comparable<SwapLegType>
public enum SwapLegType extends Enum<SwapLegType> implements NamedEnum
The type of a swap leg.This provides a high-level categorization of a swap leg. This is useful when it is necessary to find a specific leg.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FIXEDA fixed rate swap leg.IBORA floating rate swap leg based on an Ibor index.INFLATIONA floating rate swap leg based on an price index.OTHERA swap leg that is not based on a Fixed, Ibor, Overnight or Inflation rate.OVERNIGHTA floating rate swap leg based on an Overnight index.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisFixed()Checks if the type is 'Fixed'.booleanisFloat()Checks if the type is floating, defined as 'Ibor', 'Overnight' or 'Inflation'.static SwapLegTypeof(String name)Obtains an instance from the specified name.StringtoString()Returns the formatted name of the type.static SwapLegTypevalueOf(String name)Returns the enum constant of this type with the specified name.static SwapLegType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FIXED
public static final SwapLegType FIXED
A fixed rate swap leg. All periods in this leg must have a fixed rate.
-
IBOR
public static final SwapLegType IBOR
A floating rate swap leg based on an Ibor index.This kind of leg may include some fixed periods, such as in a stub or where the first rate is specified in the contract.
-
OVERNIGHT
public static final SwapLegType OVERNIGHT
A floating rate swap leg based on an Overnight index.This kind of leg may include some fixed periods, such as in a stub or where the first rate is specified in the contract.
-
INFLATION
public static final SwapLegType INFLATION
A floating rate swap leg based on an price index.This kind of leg may include some reference dates where the index rate is specified.
-
OTHER
public static final SwapLegType OTHER
A swap leg that is not based on a Fixed, Ibor, Overnight or Inflation rate.
-
-
Method Detail
-
values
public static SwapLegType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SwapLegType c : SwapLegType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SwapLegType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
of
public static SwapLegType of(String name)
Obtains an instance from the specified name.Parsing handles the mixed case form produced by
toString()and the upper and lower case variants of the enum constant name.- Parameters:
name- the name to parse- Returns:
- the type
- Throws:
IllegalArgumentException- if the name is not known
-
isFixed
public boolean isFixed()
Checks if the type is 'Fixed'.- Returns:
- true if fixed, false otherwise
-
isFloat
public boolean isFloat()
Checks if the type is floating, defined as 'Ibor', 'Overnight' or 'Inflation'.- Returns:
- true if floating, false otherwise
-
toString
public String toString()
Returns the formatted name of the type.- Overrides:
toStringin classEnum<SwapLegType>- Returns:
- the formatted string representing the type
-
-