Class EtdContractSpecId
- java.lang.Object
-
- com.opengamma.strata.product.etd.EtdContractSpecId
-
- All Implemented Interfaces:
ReferenceDataId<EtdContractSpec>,Serializable
public final class EtdContractSpecId extends Object implements ReferenceDataId<EtdContractSpec>, Serializable
An identifier for an ETD product.This identifier is used to obtain an
EtdContractSpecfromReferenceData.An ETD product identifier uniquely identifies an ETD product within the system. The only restriction placed on the identifier is that it is sufficiently unique for the reference data lookup. As such, it is acceptable to use an identifier from a well-known global or vendor symbology.
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Checks if this identifier equals another identifier.Class<EtdContractSpec>getReferenceDataType()Gets the type of data this identifier refers to.StandardIdgetStandardId()Gets the standard two-part identifier.inthashCode()Returns a suitable hash code for the identifier.static EtdContractSpecIdof(StandardId standardId)Creates an instance from a standard two-part identifier.static EtdContractSpecIdof(String scheme, String value)Obtains an instance from a scheme and value.static EtdContractSpecIdparse(String str)Parses anStandardIdfrom a formatted scheme and value.StringtoString()Returns the identifier in a standard string format.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.opengamma.strata.basics.ReferenceDataId
queryValueOrNull
-
-
-
-
Method Detail
-
of
public static EtdContractSpecId of(String scheme, String value)
Obtains an instance from a scheme and value.The scheme and value are used to produce a
StandardId, where more information is available on how schemes and values relate to industry identifiers.The scheme must be non-empty and match the regular expression '
[A-Za-z0-9:/+.=_-]*'. This permits letters, numbers, colon, forward-slash, plus, dot, equals, underscore and dash. If necessary, the scheme can be encoded usingStandardId.encodeScheme(String).The value must be non-empty and match the regular expression '
[!-z][ -z]*'.- Parameters:
scheme- the scheme of the identifier, not emptyvalue- the value of the identifier, not empty- Returns:
- the identifier
- Throws:
IllegalArgumentException- if the scheme or value is invalid
-
of
public static EtdContractSpecId of(StandardId standardId)
Creates an instance from a standard two-part identifier.- Parameters:
standardId- the underlying standard two-part identifier- Returns:
- the identifier
-
parse
public static EtdContractSpecId parse(String str)
Parses anStandardIdfrom a formatted scheme and value.This parses the identifier from the form produced by
toString()which is '$scheme~$value'.- Parameters:
str- the identifier to parse- Returns:
- the identifier
- Throws:
IllegalArgumentException- if the identifier cannot be parsed
-
getStandardId
public StandardId getStandardId()
Gets the standard two-part identifier.- Returns:
- the standard two-part identifier
-
getReferenceDataType
public Class<EtdContractSpec> getReferenceDataType()
Gets the type of data this identifier refers to.A
EtdProductIdrefers to aSecurity.- Specified by:
getReferenceDataTypein interfaceReferenceDataId<EtdContractSpec>- Returns:
- the type of the reference data this identifier refers to
-
equals
public boolean equals(Object obj)
Checks if this identifier equals another identifier.The comparison checks the name.
-
hashCode
public int hashCode()
Returns a suitable hash code for the identifier.
-
toString
public String toString()
Returns the identifier in a standard string format.The returned string is in the form '
$scheme~$value'. This is suitable for use withparse(String). For example, if the scheme is 'OG-Future' and the value is 'ECAG-FGBL-Mar14' then the result is 'OG-Future~ECAG-FGBL-Mar14'.
-
-