Package com.opengamma.strata.product
Interface ResolvableSecurityPosition
-
- All Superinterfaces:
CalculationTarget
,PortfolioItem
,Position
,ResolvableCalculationTarget
,SecurityQuantity
- All Known Implementing Classes:
EtdFuturePosition
,EtdOptionPosition
,SecurityPosition
public interface ResolvableSecurityPosition extends Position, ResolvableCalculationTarget
A position that has a security identifier that can be resolved using reference data.This represents those positions that hold a security identifier. It allows the position to be resolved, returning an alternate representation of the same position with complete security information.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SecuritizedProductPosition<?>
resolveTarget(ReferenceData refData)
Resolves the security identifier using the specified reference data.ResolvableSecurityPosition
withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.ResolvableSecurityPosition
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.Position
getInfo, getQuantity, getSecurityId, summarize
-
-
-
-
Method Detail
-
resolveTarget
SecuritizedProductPosition<?> resolveTarget(ReferenceData refData)
Resolves the security identifier using the specified reference data.This takes the security identifier of this position, looks it up in reference data, and returns the equivalent position with full security information. If the security has underlying securities, they will also have been resolved in the result.
The resulting position is bound to data from reference data. If the data changes, the resulting position 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 position
- Throws:
ReferenceDataNotFoundException
- if an identifier cannot be resolved in the reference dataRuntimeException
- if unable to resolve due to an invalid definition
-
withInfo
ResolvableSecurityPosition withInfo(PortfolioItemInfo info)
Returns an instance with the specified info.- Specified by:
withInfo
in interfacePortfolioItem
- Specified by:
withInfo
in interfacePosition
- Parameters:
info
- the new info- Returns:
- the instance with the specified info
-
withQuantity
ResolvableSecurityPosition withQuantity(double quantity)
Returns an instance with the specified quantity.- Specified by:
withQuantity
in interfacePosition
- Parameters:
quantity
- the new quantity- Returns:
- the instance with the specified quantity
-
-