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
PositionInfo
to be created.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> PositionInfoBuilder
addAttribute(AttributeType<T> attributeType, T attributeValue)
Adds a position attribute to the map of attributes.PositionInfo
build()
Builds the position information.PositionInfoBuilder
id(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:
id
in 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:
addAttribute
in 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:
build
in interfacePortfolioItemInfoBuilder<PositionInfo>
- Returns:
- the position information
-
-