Package com.opengamma.strata.product
Class SecurityPosition.Builder
- java.lang.Object
-
- org.joda.beans.impl.direct.DirectFieldsBeanBuilder<SecurityPosition>
-
- com.opengamma.strata.product.SecurityPosition.Builder
-
- All Implemented Interfaces:
org.joda.beans.BeanBuilder<SecurityPosition>
- Enclosing class:
- SecurityPosition
public static final class SecurityPosition.Builder extends org.joda.beans.impl.direct.DirectFieldsBeanBuilder<SecurityPosition>
The bean-builder forSecurityPosition
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecurityPosition
build()
Object
get(String propertyName)
SecurityPosition.Builder
info(PositionInfo info)
Sets the additional position information, defaulted to an empty instance.SecurityPosition.Builder
longQuantity(double longQuantity)
Sets the long quantity of the security.SecurityPosition.Builder
securityId(SecurityId securityId)
Sets the identifier of the underlying security.SecurityPosition.Builder
set(String propertyName, Object newValue)
SecurityPosition.Builder
set(org.joda.beans.MetaProperty<?> property, Object value)
SecurityPosition.Builder
shortQuantity(double shortQuantity)
Sets the quantity that was traded.String
toString()
-
-
-
Method Detail
-
get
public Object get(String propertyName)
- Specified by:
get
in interfaceorg.joda.beans.BeanBuilder<SecurityPosition>
- Overrides:
get
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<SecurityPosition>
-
set
public SecurityPosition.Builder set(String propertyName, Object newValue)
-
set
public SecurityPosition.Builder set(org.joda.beans.MetaProperty<?> property, Object value)
- Specified by:
set
in interfaceorg.joda.beans.BeanBuilder<SecurityPosition>
- Overrides:
set
in classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<SecurityPosition>
-
build
public SecurityPosition build()
-
info
public SecurityPosition.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
-
securityId
public SecurityPosition.Builder securityId(SecurityId securityId)
Sets the identifier of the underlying security.This identifier uniquely identifies the security within the system.
- Parameters:
securityId
- the new value, not null- Returns:
- this, for chaining, not null
-
longQuantity
public SecurityPosition.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 SecurityPosition.Builder shortQuantity(double shortQuantity)
Sets the quantity that was traded.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 classorg.joda.beans.impl.direct.DirectFieldsBeanBuilder<SecurityPosition>
-
-