public final class EtdVariant extends Object implements org.joda.beans.ImmutableBean, Serializable
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.
| Modifier and Type | Field and Description |
|---|---|
static EtdVariant |
MONTHLY
The standard Monthly type.
|
| Modifier and Type | Method and 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, such as '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 for
EtdVariant. |
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 |
ofWeekly(int week)
The standard weekly ETD.
|
static EtdVariant |
parse(String code)
Parses the variant short code.
|
String |
toString() |
public static final EtdVariant MONTHLY
public static EtdVariant ofMonthly()
public static EtdVariant ofWeekly(int week)
week - the week numberpublic static EtdVariant ofDaily(int dayOfMonth)
dayOfMonth - the day-of-monthpublic static EtdVariant ofFlexFuture(int dayOfMonth, EtdSettlementType settlementType)
dayOfMonth - the day-of-monthsettlementType - the settlement typepublic static EtdVariant ofFlexOption(int dayOfMonth, EtdSettlementType settlementType, EtdOptionType optionType)
dayOfMonth - the day-of-monthsettlementType - the settlement typeoptionType - the option typepublic static EtdVariant parse(String code)
This expects 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.
code - the variant codepublic boolean isFlex()
public String getCode()
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.
public static org.joda.beans.MetaBean meta()
EtdVariant.public org.joda.beans.MetaBean metaBean()
metaBean in interface org.joda.beans.Beanpublic EtdExpiryType getType()
Flex Futures and Options are always Daily.
public OptionalInt getDateCode()
This will be the week number for Weekly and the day-of-month for Daily.
public Optional<EtdSettlementType> getSettlementType()
public Optional<EtdOptionType> getOptionType()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.