Package com.opengamma.strata.product
Class PositionInfoBuilder
- java.lang.Object
-
- com.opengamma.strata.product.PositionInfoBuilder
-
- All Implemented Interfaces:
PortfolioItemInfoBuilder<PositionInfo>
public final class PositionInfoBuilder extends Object implements PortfolioItemInfoBuilder<PositionInfo>
Builder to createPositionInfo.This builder allows a
PositionInfoto be created.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> PositionInfoBuilderaddAttribute(AttributeType<T> attributeType, T attributeValue)Adds a position attribute to the map of attributes.PositionInfobuild()Builds the position information.PositionInfoBuilderid(StandardId id)Sets the primary identifier for the position, optional.
-
-
-
Method Detail
-
id
public PositionInfoBuilder id(StandardId id)
Sets the primary identifier for the position, optional.The identifier is used to identify the position.
- Specified by:
idin interfacePortfolioItemInfoBuilder<PositionInfo>- Parameters:
id- the identifier- Returns:
- this, for chaining
-
addAttribute
public <T> PositionInfoBuilder addAttribute(AttributeType<T> attributeType, T attributeValue)
Adds a position attribute to the map of attributes.The attribute is added using
Map.put(type, value)semantics.- Specified by:
addAttributein interfacePortfolioItemInfoBuilder<PositionInfo>- Type Parameters:
T- the type of the value- Parameters:
attributeType- the type providing meaning to the valueattributeValue- the value- Returns:
- this, for chaining
-
build
public PositionInfo build()
Builds the position information.- Specified by:
buildin interfacePortfolioItemInfoBuilder<PositionInfo>- Returns:
- the position information
-
-