Class TradeInfo

    • Method Detail

      • empty

        public static TradeInfo empty()
        Obtains an empty instance, with no values or attributes.
        Returns:
        the empty instance
      • of

        public static TradeInfo of​(java.time.LocalDate tradeDate)
        Obtains an instance with the specified trade date.
        Parameters:
        tradeDate - the trade date
        Returns:
        the trade information
      • builder

        public static TradeInfoBuilder builder()
        Returns a builder used to create an instance of the bean.
        Returns:
        the builder, not null
      • withId

        public TradeInfo withId​(StandardId identifier)
        Description copied from interface: PortfolioItemInfo
        Returns a copy of this instance with the identifier changed.

        This returns a new instance with the identifier changed. If the specified identifier is null, the existing identifier will be removed. If the specified identifier is non-null, it will become the identifier of the resulting info.

        Specified by:
        withId in interface PortfolioItemInfo
        Parameters:
        identifier - the identifier to set
        Returns:
        a new instance based on this one with the identifier set
      • getAttribute

        public <T> T getAttribute​(AttributeType<T> type)
        Description copied from interface: Attributes
        Gets the attribute associated with the specified type.

        This method obtains the specified attribute. This allows an attribute to be obtained if available.

        If the attribute is not found, an exception is thrown.

        Specified by:
        getAttribute in interface Attributes
        Type Parameters:
        T - the type of the attribute value
        Parameters:
        type - the type to find
        Returns:
        the attribute value
      • findAttribute

        public <T> java.util.Optional<T> findAttribute​(AttributeType<T> type)
        Description copied from interface: Attributes
        Finds the attribute associated with the specified type.

        This method obtains the specified attribute. This allows an attribute to be obtained if available.

        If the attribute is not found, optional empty is returned.

        Specified by:
        findAttribute in interface Attributes
        Type Parameters:
        T - the type of the result
        Parameters:
        type - the type to find
        Returns:
        the attribute value
      • withAttribute

        public <T> TradeInfo withAttribute​(AttributeType<T> type,
                                           T value)
        Description copied from interface: Attributes
        Returns a copy of this instance with the attribute added.

        This returns a new instance with the specified attribute added. The attribute is added using Map.put(type, value) semantics.

        Specified by:
        withAttribute in interface Attributes
        Specified by:
        withAttribute in interface PortfolioItemInfo
        Type Parameters:
        T - the type of the attribute value
        Parameters:
        type - the type providing meaning to the value
        value - the value
        Returns:
        a new instance based on this one with the attribute added
      • toBuilder

        public TradeInfoBuilder toBuilder()
        Returns a builder populated with the values of this instance.
        Returns:
        a builder populated with the values of this instance
      • meta

        public static TradeInfo.Meta meta()
        The meta-bean for TradeInfo.
        Returns:
        the meta-bean, not null
      • getId

        public java.util.Optional<StandardId> getId()
        Gets the primary identifier for the trade, optional.

        The identifier is used to identify the trade. It will typically be an identifier in an external data system.

        A trade may have multiple active identifiers. Any identifier may be chosen here. Certain uses of the identifier, such as storage in a database, require that the identifier does not change over time, and this should be considered best practice.

        Specified by:
        getId in interface PortfolioItemInfo
        Returns:
        the optional value of the property, not null
      • getCounterparty

        public java.util.Optional<StandardId> getCounterparty()
        Gets the counterparty identifier, optional.

        An identifier used to specify the counterparty of the trade.

        Returns:
        the optional value of the property, not null
      • getTradeDate

        public java.util.Optional<java.time.LocalDate> getTradeDate()
        Gets the trade date, optional.
        Returns:
        the optional value of the property, not null
      • getTradeTime

        public java.util.Optional<java.time.LocalTime> getTradeTime()
        Gets the trade time, optional.
        Returns:
        the optional value of the property, not null
      • getZone

        public java.util.Optional<java.time.ZoneId> getZone()
        Gets the trade time-zone, optional.
        Returns:
        the optional value of the property, not null
      • getSettlementDate

        public java.util.Optional<java.time.LocalDate> getSettlementDate()
        Gets the settlement date, optional.
        Returns:
        the optional value of the property, not null
      • getAttributes

        public com.google.common.collect.ImmutableMap<AttributeType<?>,​java.lang.Object> getAttributes()
        Gets the trade attributes.

        Trade attributes provide the ability to associate arbitrary information in a key-value map.

        Returns:
        the value of the property, not null
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object