Class EtdContractSpecBuilder


  • public final class EtdContractSpecBuilder
    extends Object
    A builder for building instances of EtdContractSpec.
    • 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
      • 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 attribute
        attributeValue - the value of the attribute
        Returns:
        this builder