Package com.opengamma.strata.product
Class TradeInfoBuilder
- java.lang.Object
-
- com.opengamma.strata.product.TradeInfoBuilder
-
- All Implemented Interfaces:
PortfolioItemInfoBuilder<TradeInfo>
public final class TradeInfoBuilder extends Object implements PortfolioItemInfoBuilder<TradeInfo>
Builder to createTradeInfo.This builder allows a
TradeInfoto be created.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TradeInfoBuilderaddAttribute(AttributeType<T> attributeType, T attributeValue)Adds a trade attribute to the map of attributes.TradeInfobuild()Builds the trade information.TradeInfoBuildercounterparty(StandardId counterparty)Sets the counterparty identifier, optional.TradeInfoBuilderid(StandardId id)Sets the primary identifier for the trade, optional.TradeInfoBuildersettlementDate(LocalDate settlementDate)Sets the settlement date, optional.TradeInfoBuildertradeDate(LocalDate tradeDate)Sets the trade date, optional.TradeInfoBuildertradeTime(LocalTime tradeTime)Sets the trade time, optional.TradeInfoBuilderzone(ZoneId zone)Sets the trade time-zone, optional.
-
-
-
Method Detail
-
id
public TradeInfoBuilder id(StandardId id)
Sets the primary identifier for the trade, optional.The identifier is used to identify the trade.
- Specified by:
idin interfacePortfolioItemInfoBuilder<TradeInfo>- Parameters:
id- the identifier- Returns:
- this, for chaining
-
counterparty
public TradeInfoBuilder counterparty(StandardId counterparty)
Sets the counterparty identifier, optional.An identifier used to specify the counterparty of the trade.
- Parameters:
counterparty- the counterparty- Returns:
- this, for chaining
-
tradeDate
public TradeInfoBuilder tradeDate(LocalDate tradeDate)
Sets the trade date, optional.- Parameters:
tradeDate- the trade date- Returns:
- this, for chaining
-
tradeTime
public TradeInfoBuilder tradeTime(LocalTime tradeTime)
Sets the trade time, optional.- Parameters:
tradeTime- the trade time- Returns:
- this, for chaining
-
zone
public TradeInfoBuilder zone(ZoneId zone)
Sets the trade time-zone, optional.- Parameters:
zone- the trade zone- Returns:
- this, for chaining
-
settlementDate
public TradeInfoBuilder settlementDate(LocalDate settlementDate)
Sets the settlement date, optional.- Parameters:
settlementDate- the settlement date- Returns:
- this, for chaining
-
addAttribute
public <T> TradeInfoBuilder addAttribute(AttributeType<T> attributeType, T attributeValue)
Adds a trade attribute to the map of attributes.The attribute is added using
Map.put(type, value)semantics.- Specified by:
addAttributein interfacePortfolioItemInfoBuilder<TradeInfo>- 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 TradeInfo build()
Builds the trade information.- Specified by:
buildin interfacePortfolioItemInfoBuilder<TradeInfo>- Returns:
- the trade information
-
-