public final class EtdContractGroupId extends Object implements Serializable
This is used to group similar ETD contracts together for the purpose of allocating risk.
The identifier is formed of two parts, the exchange and the code defined by the exchange.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Checks if this identifier equals another identifier.
|
EtdContractGroupCode |
getCode()
Gets the contract group code, as defined by the exchange.
|
ExchangeId |
getExchangeId()
Gets the exchange identifier.
|
int |
hashCode()
Returns a suitable hash code for the identifier.
|
static EtdContractGroupId |
of(ExchangeId exchangeId,
EtdContractGroupCode contractGroupCode)
Creates an instance from the exchange identifier and group code.
|
static EtdContractGroupId |
of(String exchangeId,
String contractGroupCode)
Obtains an instance from the exchange identifier and group code.
|
static EtdContractGroupId |
parse(String str)
Parses an
StandardId from a formatted scheme and value. |
String |
toString()
Returns the identifier in a standard string format.
|
public static EtdContractGroupId of(String exchangeId, String contractGroupCode)
exchangeId - the exchange identifiercontractGroupCode - the code defined by the exchangeIllegalArgumentException - if either value is invalidpublic static EtdContractGroupId of(ExchangeId exchangeId, EtdContractGroupCode contractGroupCode)
exchangeId - the exchange identifiercontractGroupCode - the code defined by the exchangepublic static EtdContractGroupId parse(String str)
StandardId from a formatted scheme and value.
This parses the identifier from the form produced by toString()
which is '$exchange::$code'.
str - the identifier to parseIllegalArgumentException - if the identifier cannot be parsedpublic ExchangeId getExchangeId()
public EtdContractGroupCode getCode()
public boolean equals(Object obj)
The comparison checks the name.
public int hashCode()
public String toString()
The returned string is in the form '$exchange::$code'.
This is suitable for use with parse(String).
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.