Package com.opengamma.strata.product.etd
Class EtdContractSpecBuilder
- java.lang.Object
-
- com.opengamma.strata.product.etd.EtdContractSpecBuilder
-
public final class EtdContractSpecBuilder extends Object
A builder for building instances ofEtdContractSpec
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> EtdContractSpecBuilder
addAttribute(AttributeType<T> attributeType, T attributeValue)
Adds an attribute to the builder.EtdContractSpec
build()
Builds a new specification from the data in this builder.EtdContractSpecBuilder
contractCode(EtdContractCode contractCode)
Sets the code of the contract specification as given by the exchange in clearing and margining.EtdContractSpecBuilder
description(String description)
Sets the description of the contract specification.EtdContractSpecBuilder
exchangeId(ExchangeId exchangeId)
Sets the ID of the exchange where the instruments derived from the contract specification are traded.EtdContractSpecBuilder
id(EtdContractSpecId id)
Sets the ID of the contract specification.EtdContractSpecBuilder
priceInfo(SecurityPriceInfo priceInfo)
Sets the information about the security price - currency, tick size, tick value, contract size.EtdContractSpecBuilder
type(EtdType productType)
Sets the type of the contract specification.
-
-
-
Method Detail
-
build
public EtdContractSpec build()
Builds a new specification from the data in this builder.- Returns:
- a specification instance built from the data in this builder
-
id
public EtdContractSpecBuilder id(EtdContractSpecId id)
Sets the ID of the contract specification.- Parameters:
id
- the ID- Returns:
- the ID of the template
-
type
public EtdContractSpecBuilder type(EtdType productType)
Sets the type of the contract specification.- Parameters:
productType
- the new value, not null- Returns:
- this, for chaining, not null
-
exchangeId
public EtdContractSpecBuilder exchangeId(ExchangeId exchangeId)
Sets the ID of the exchange where the instruments derived from the contract specification are traded.- Parameters:
exchangeId
- the new value, not null- Returns:
- this, for chaining, not null
-
contractCode
public EtdContractSpecBuilder contractCode(EtdContractCode contractCode)
Sets the code of the contract specification as given by the exchange in clearing and margining.- Parameters:
contractCode
- the new value, not empty- Returns:
- this, for chaining, not null
-
description
public EtdContractSpecBuilder description(String description)
Sets the description of the contract specification.- Parameters:
description
- the new value, not empty- Returns:
- this, for chaining, not null
-
priceInfo
public EtdContractSpecBuilder priceInfo(SecurityPriceInfo priceInfo)
Sets the information about the security price - currency, tick size, tick value, contract size.- Parameters:
priceInfo
- the new value, not null- Returns:
- this, for chaining, not null
-
addAttribute
public <T> EtdContractSpecBuilder addAttribute(AttributeType<T> attributeType, T attributeValue)
Adds an attribute to the builder.Only one attribute is stored for each attribute type. If this method is called multiple times with the same attribute type the previous attribute value will be replaced.
- Type Parameters:
T
- the type of the attribute- Parameters:
attributeType
- the type of the attributeattributeValue
- the value of the attribute- Returns:
- this builder
-
-