Enum SwapLegType

  • All Implemented Interfaces:
    Named, NamedEnum, java.io.Serializable, java.lang.Comparable<SwapLegType>

    public enum SwapLegType
    extends java.lang.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
      FIXED
      A fixed rate swap leg.
      IBOR
      A floating rate swap leg based on an Ibor index.
      INFLATION
      A floating rate swap leg based on an price index.
      OTHER
      A swap leg that is not based on a Fixed, Ibor, Overnight or Inflation rate.
      OVERNIGHT
      A floating rate swap leg based on an Overnight index.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isFixed()
      Checks if the type is 'Fixed'.
      boolean isFloat()
      Checks if the type is floating, defined as 'Ibor', 'Overnight' or 'Inflation'.
      static SwapLegType of​(java.lang.String name)
      Obtains an instance from the specified name.
      java.lang.String toString()
      Returns the formatted name of the type.
      static SwapLegType valueOf​(java.lang.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.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.opengamma.strata.collect.named.NamedEnum

        getName
    • 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​(java.lang.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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • of

        public static SwapLegType of​(java.lang.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:
        java.lang.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 java.lang.String toString()
        Returns the formatted name of the type.
        Overrides:
        toString in class java.lang.Enum<SwapLegType>
        Returns:
        the formatted string representing the type