Package com.opengamma.strata.product
Interface ResolvableSecurityTrade
-
- All Superinterfaces:
CalculationTarget
,PortfolioItem
,ResolvableCalculationTarget
,SecurityQuantity
,SecurityQuantityTrade
,Trade
- All Known Implementing Classes:
EtdFutureTrade
,EtdOptionTrade
,SecurityTrade
public interface ResolvableSecurityTrade extends SecurityQuantityTrade, ResolvableCalculationTarget
A trade that has a security identifier that can be resolved using reference data.This represents those trades that hold a security identifier. It allows the trade to be resolved, returning an alternate representation of the same trade with complete security information.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default SecuritizedProductTrade<?>
resolveTarget(ReferenceData refData)
Resolves the security identifier using the specified reference data.ResolvableSecurityTrade
withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.ResolvableSecurityTrade
withPrice(double price)
Returns an instance with the specified price.ResolvableSecurityTrade
withQuantity(double quantity)
Returns an instance with the specified quantity.-
Methods inherited from interface com.opengamma.strata.product.PortfolioItem
getId
-
Methods inherited from interface com.opengamma.strata.product.SecurityQuantity
getQuantity, getSecurityId
-
Methods inherited from interface com.opengamma.strata.product.SecurityQuantityTrade
getPrice
-
-
-
-
Method Detail
-
resolveTarget
default SecuritizedProductTrade<?> resolveTarget(ReferenceData refData)
Resolves the security identifier using the specified reference data.This takes the security identifier of this trade, looks it up in reference data, and returns the equivalent trade with full security information. If the security has underlying securities, they will also have been resolved in the result.
The resulting trade is bound to data from reference data. If the data changes, the resulting trade form will not be updated. Care must be taken when placing the resolved form in a cache or persistence layer.
- Specified by:
resolveTarget
in interfaceResolvableCalculationTarget
- Parameters:
refData
- the reference data to use when resolving- Returns:
- the resolved trade
- Throws:
ReferenceDataNotFoundException
- if an identifier cannot be resolved in the reference dataRuntimeException
- if unable to resolve due to an invalid definition
-
withInfo
ResolvableSecurityTrade withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.- Specified by:
withInfo
in interfacePortfolioItem
- Specified by:
withInfo
in interfaceSecurityQuantityTrade
- Specified by:
withInfo
in interfaceTrade
- Parameters:
info
- the new info- Returns:
- the instance with the specified info
-
withQuantity
ResolvableSecurityTrade withQuantity(double quantity)
Returns an instance with the specified quantity.- Specified by:
withQuantity
in interfaceSecurityQuantityTrade
- Parameters:
quantity
- the new quantity- Returns:
- the instance with the specified quantity
-
withPrice
ResolvableSecurityTrade withPrice(double price)
Returns an instance with the specified price.- Specified by:
withPrice
in interfaceSecurityQuantityTrade
- Parameters:
price
- the new price- Returns:
- the instance with the specified price
-
-