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
TradeInfo
to be created.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> TradeInfoBuilder
addAttribute(AttributeType<T> attributeType, T attributeValue)
Adds a trade attribute to the map of attributes.TradeInfo
build()
Builds the trade information.TradeInfoBuilder
counterparty(StandardId counterparty)
Sets the counterparty identifier, optional.TradeInfoBuilder
id(StandardId id)
Sets the primary identifier for the trade, optional.TradeInfoBuilder
settlementDate(LocalDate settlementDate)
Sets the settlement date, optional.TradeInfoBuilder
tradeDate(LocalDate tradeDate)
Sets the trade date, optional.TradeInfoBuilder
tradeTime(LocalTime tradeTime)
Sets the trade time, optional.TradeInfoBuilder
zone(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:
id
in 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:
addAttribute
in 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:
build
in interfacePortfolioItemInfoBuilder<TradeInfo>
- Returns:
- the trade information
-
-