Package com.opengamma.strata.product.etd
Class EtdVariant
- java.lang.Object
-
- com.opengamma.strata.product.etd.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 Summary
Fields Modifier and Type Field Description static EtdVariant
MONTHLY
The standard Monthly type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getCode()
Gets the short code that describes the variant.OptionalInt
getDateCode()
Gets the optional date code, populated for Weekly and Daily.Optional<EtdOptionType>
getOptionType()
Gets the optional option type, 'American' or 'European', populated for Flex Options.Optional<EtdSettlementType>
getSettlementType()
Gets the optional settlement type, such as 'Cash' or 'Physical', populated for Flex Futures and Flex Options.EtdExpiryType
getType()
Gets the type of ETD - Monthly, Weekly or Daily.int
hashCode()
boolean
isFlex()
Checks if the variant is a Flex Future or Flex Option.static org.joda.beans.MetaBean
meta()
The meta-bean forEtdVariant
.org.joda.beans.MetaBean
metaBean()
static EtdVariant
ofDaily(int dayOfMonth)
The standard daily ETD.static EtdVariant
ofFlexFuture(int dayOfMonth, EtdSettlementType settlementType)
The flex future.static EtdVariant
ofFlexOption(int dayOfMonth, EtdSettlementType settlementType, EtdOptionType optionType)
The flex option.static EtdVariant
ofMonthly()
The standard monthly ETD.static EtdVariant
ofMonthly(EtdSettlementType settlementType)
The monthly ETD with specific settlement type.static EtdVariant
ofWeekly(int week)
The standard weekly ETD.String
toString()
-
-
-
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
-
ofMonthly
public static EtdVariant ofMonthly(EtdSettlementType settlementType)
The monthly ETD with specific settlement type.- Parameters:
settlementType
- the settlement type- 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 flex future.- Parameters:
dayOfMonth
- the day-of-monthsettlementType
- the settlement type- Returns:
- the variant
-
ofFlexOption
public static EtdVariant ofFlexOption(int dayOfMonth, EtdSettlementType settlementType, EtdOptionType optionType)
The flex option.- Parameters:
dayOfMonth
- the day-of-monthsettlementType
- the settlement typeoptionType
- 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 forEtdVariant
.- Returns:
- the meta-bean, not null
-
metaBean
public org.joda.beans.MetaBean metaBean()
- Specified by:
metaBean
in interfaceorg.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
-
-