Class EtdVariant

  • All Implemented Interfaces:
    Serializable, org.joda.beans.Bean, org.joda.beans.ImmutableBean

    public final class EtdVariant
    extends Object
    implements org.joda.beans.ImmutableBean, 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 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 org.joda.beans.MetaBean meta()
        The meta-bean for EtdVariant.
        Returns:
        the meta-bean, not null
      • metaBean

        public org.joda.beans.MetaBean metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • 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 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 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 Optional<EtdOptionType> getOptionType()
        Gets the optional option type, 'American' or 'European', populated for Flex Options.
        Returns:
        the optional value of the property, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object