Class SecurityTrade

    • Method Detail

      • of

        public static SecurityTrade of​(TradeInfo tradeInfo,
                                       SecurityId securityId,
                                       double quantity,
                                       double price)
        Obtains an instance from trade information, identifier, quantity and price.
        Parameters:
        tradeInfo - the trade information
        securityId - the identifier of the underlying security
        quantity - the quantity that was traded
        price - the price that was traded
        Returns:
        the trade
      • meta

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

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

        public SecurityTrade.Meta metaBean()
        Specified by:
        metaBean in interface org.joda.beans.Bean
      • getInfo

        public TradeInfo getInfo()
        Gets the additional trade information, defaulted to an empty instance.

        This allows additional information to be attached to the trade.

        Specified by:
        getInfo in interface PortfolioItem
        Specified by:
        getInfo in interface Trade
        Returns:
        the value of the property, not null
      • getSecurityId

        public SecurityId getSecurityId()
        Gets the identifier of the security that was traded.

        This identifier uniquely identifies the security within the system.

        Specified by:
        getSecurityId in interface SecurityQuantity
        Returns:
        the value of the property, not null
      • getQuantity

        public double getQuantity()
        Gets the quantity that was traded.

        This will be positive if buying and negative if selling.

        Specified by:
        getQuantity in interface SecurityQuantity
        Returns:
        the value of the property
      • getPrice

        public double getPrice()
        Gets the price agreed when the trade occurred.

        This is the price agreed when the trade occurred.

        Specified by:
        getPrice in interface SecurityQuantityTrade
        Returns:
        the value of the property
      • toBuilder

        public SecurityTrade.Builder toBuilder()
        Returns a builder that allows this bean to be mutated.
        Returns:
        the mutable builder, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object