Class EtdVariant

  • All Implemented Interfaces:
    java.io.Serializable, Bean, ImmutableBean

    public final class EtdVariant
    extends java.lang.Object
    implements ImmutableBean, java.io.Serializable
    The variant of an exchange traded derivative (ETD).

    Most ETDs are monthly, where there is one expiry date per month, but a few are issued weekly or daily.

    A special category of ETD are flex futures and options. These have additional contract flexibility, with a settlement type and option type.

    See Also:
    Serialized Form
    • Field Detail

      • MONTHLY

        public static final EtdVariant MONTHLY
        The standard Monthly type.
    • Method Detail

      • ofMonthly

        public static EtdVariant ofMonthly()
        The standard monthly ETD.
        Returns:
        the variant
      • ofWeekly

        public static EtdVariant ofWeekly​(int week)
        The standard weekly ETD.
        Parameters:
        week - the week number
        Returns:
        the variant
      • ofDaily

        public static EtdVariant ofDaily​(int dayOfMonth)
        The standard daily ETD.
        Parameters:
        dayOfMonth - the day-of-month
        Returns:
        the variant
      • ofFlexFuture

        public static EtdVariant ofFlexFuture​(int dayOfMonth,
                                              EtdSettlementType settlementType)
        The standard monthly ETD.
        Parameters:
        dayOfMonth - the day-of-month
        settlementType - the settlement type
        Returns:
        the variant
      • ofFlexOption

        public static EtdVariant ofFlexOption​(int dayOfMonth,
                                              EtdSettlementType settlementType,
                                              EtdOptionType optionType)
        The standard monthly ETD.
        Parameters:
        dayOfMonth - the day-of-month
        settlementType - the settlement type
        optionType - the option type
        Returns:
        the variant
      • isFlex

        public boolean isFlex()
        Checks if the variant is a Flex Future or Flex Option.
        Returns:
        true if this is a Flex Future or Flex Option
      • getCode

        public java.lang.String getCode()
        Gets the short code that describes the variant.

        This is an empty string for Monthly, the week number prefixed by 'W' for Weekly, the day number for daily, with a suffix of the settlement type and option type codes.

        Returns:
        the short code
      • meta

        public static MetaBean meta()
        The meta-bean for EtdVariant.
        Returns:
        the meta-bean, not null
      • getType

        public EtdExpiryType getType()
        Gets the type of ETD - Monthly, Weekly or Daily.

        Flex Futures and Options are always Daily.

        Returns:
        the value of the property, not null
      • getDateCode

        public java.util.OptionalInt getDateCode()
        Gets the optional date code, populated for Weekly and Daily.

        This will be the week number for Weekly and the day-of-week for Daily.

        Returns:
        the optional value of the property, not null
      • getSettlementType

        public java.util.Optional<EtdSettlementType> getSettlementType()
        Gets the optional settlement type, such as 'Cash' or 'Physical', populated for Flex Futures and Flex Options.
        Returns:
        the optional value of the property, not null
      • getOptionType

        public java.util.Optional<EtdOptionType> getOptionType()
        Gets the optional option type, 'American' or 'European', populated for Flex Options.
        Returns:
        the optional value of the property, not null
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object