Class DsfPosition.Builder

  • All Implemented Interfaces:
    org.joda.beans.BeanBuilder<DsfPosition>
    Enclosing class:
    DsfPosition

    public static final class DsfPosition.Builder
    extends org.joda.beans.impl.direct.DirectFieldsBeanBuilder<DsfPosition>
    The bean-builder for DsfPosition.
    • Method Detail

      • get

        public Object get​(String propertyName)
        Specified by:
        get in interface org.joda.beans.BeanBuilder<DsfPosition>
        Overrides:
        get in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<DsfPosition>
      • set

        public DsfPosition.Builder set​(org.joda.beans.MetaProperty<?> property,
                                       Object value)
        Specified by:
        set in interface org.joda.beans.BeanBuilder<DsfPosition>
        Overrides:
        set in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<DsfPosition>
      • info

        public DsfPosition.Builder info​(PositionInfo info)
        Sets the additional position information, defaulted to an empty instance.

        This allows additional information to be attached to the position.

        Parameters:
        info - the new value, not null
        Returns:
        this, for chaining, not null
      • product

        public DsfPosition.Builder product​(Dsf product)
        Sets the DSF that was traded.

        The product captures the contracted financial details.

        Parameters:
        product - the new value, not null
        Returns:
        this, for chaining, not null
      • longQuantity

        public DsfPosition.Builder longQuantity​(double longQuantity)
        Sets the long quantity of the security.

        This is the quantity of the underlying security that is held. The quantity cannot be negative, as that would imply short selling.

        Parameters:
        longQuantity - the new value
        Returns:
        this, for chaining, not null
      • shortQuantity

        public DsfPosition.Builder shortQuantity​(double shortQuantity)
        Sets the short quantity of the security.

        This is the quantity of the underlying security that has been short sold. The quantity cannot be negative, as that would imply the position is long.

        Parameters:
        shortQuantity - the new value
        Returns:
        this, for chaining, not null
      • toString

        public String toString()
        Overrides:
        toString in class org.joda.beans.impl.direct.DirectFieldsBeanBuilder<DsfPosition>