Package com.opengamma.strata.loader.csv
Interface SensitivityCsvInfoResolver
-
public interface SensitivityCsvInfoResolver
Resolves additional information when parsing sensitivity CSV files.Data loaded from a CSV may contain additional information that needs to be captured. This plugin point allows the additional CSV columns to be parsed and captured.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CurveName
checkCurveName(CurveName curveName)
Checks the parsed curve name, potentially altering the value.default Tenor
checkSensitivityTenor(Tenor tenor)
Checks the parsed sensitivity tenor, potentially altering the value.ReferenceData
getReferenceData()
Gets the reference data being used.default boolean
isInfoColumn(String headerLowerCase)
Checks if the column header is an info column that this resolver will parse.default boolean
isTenorRequired()
Checks whether a tenor is required.static SensitivityCsvInfoResolver
of(ReferenceData refData)
Obtains an instance that uses the specified set of reference data.default PortfolioItemInfo
parseSensitivityInfo(CsvRow row, PortfolioItemInfo info)
Parses attributes to updatePortfolioItemInfo
.static SensitivityCsvInfoResolver
standard()
Obtains an instance that uses the standard set of reference data.
-
-
-
Method Detail
-
standard
static SensitivityCsvInfoResolver standard()
Obtains an instance that uses the standard set of reference data.- Returns:
- the resolver
-
of
static SensitivityCsvInfoResolver of(ReferenceData refData)
Obtains an instance that uses the specified set of reference data.- Parameters:
refData
- the reference data- Returns:
- the resolver
-
getReferenceData
ReferenceData getReferenceData()
Gets the reference data being used.- Returns:
- the reference data
-
isInfoColumn
default boolean isInfoColumn(String headerLowerCase)
Checks if the column header is an info column that this resolver will parse.- Parameters:
headerLowerCase
- the header case, in lower case (ENGLISH) form- Returns:
- true if the header is for an info column
-
parseSensitivityInfo
default PortfolioItemInfo parseSensitivityInfo(CsvRow row, PortfolioItemInfo info)
Parses attributes to updatePortfolioItemInfo
.If it is available, the sensitivity ID will have been set before this method is called. It may be altered if necessary, although this is not recommended.
- Parameters:
row
- the CSV row to parseinfo
- the info to update and return- Returns:
- the updated info
-
isTenorRequired
default boolean isTenorRequired()
Checks whether a tenor is required.This defaults to true, ensuring that the metadata will implement
TenoredParameterMetadata
. Override to set it to false.- Returns:
- true if the tenor is required, false to allow date-based sensitvities
-
checkSensitivityTenor
default Tenor checkSensitivityTenor(Tenor tenor)
Checks the parsed sensitivity tenor, potentially altering the value.The input is the tenor exactly as parsed. The default implementation normalizes it and ensures that it does not contain a combination of years/months and days.
- Parameters:
tenor
- the tenor to check and potentially alter- Returns:
- the potentially adjusted tenor
- Throws:
ParseFailureException
- if the tenor is invalid
-
checkCurveName
default CurveName checkCurveName(CurveName curveName)
Checks the parsed curve name, potentially altering the value.The input is the curve name exactly as parsed. The default implementation simply returns it.
- Parameters:
curveName
- the curve name to check and potentially alter- Returns:
- the potentially adjusted curve name
-
-