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 Detail

      • standard

        static SensitivityCsvInfoResolver standard()
        Obtains an instance that uses the standard set of reference data.
        Returns:
        the loader
      • of

        static SensitivityCsvInfoResolver of​(ReferenceData refData)
        Obtains an instance that uses the specified set of reference data.
        Parameters:
        refData - the reference data
        Returns:
        the loader
      • getReferenceData

        ReferenceData getReferenceData()
        Gets the reference data being used.
        Returns:
        the reference data
      • isInfoColumn

        default boolean isInfoColumn​(java.lang.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 update PortfolioItemInfo.

        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 parse
        info - 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
      • 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