Interface MarketDataFilter<T,​I extends MarketDataId<T>>

  • Type Parameters:
    T - the type of the market data handled by the filter
    I - the type of the market data ID handled by the filter

    public interface MarketDataFilter<T,​I extends MarketDataId<T>>
    Encapsulates a rule or set of rules to decide whether a perturbation applies to a piece of market data.

    A ScenarioPerturbation encapsulates a specific change to a piece of market data, such as a parallel shift. An implementation of this filter interface defines when the perturbation should be used. For example, a filter could apply to all yield curves whose currency is USD, or quoted prices of equity securities in the energy sector.

    Implementations must be immutable and thread-safe beans.

    • Method Detail

      • ofIdType

        static <T> MarketDataFilter<T,​MarketDataId<T>> ofIdType​(java.lang.Class<? extends MarketDataId<T>> type)
        Obtains a filter that matches any value with the specified identifier type.
        Type Parameters:
        T - the type of market data handled by the filter
        Parameters:
        type - the type that is matched by this filter
        Returns:
        a filter matching the specified type
      • ofId

        static <T> MarketDataFilter<T,​MarketDataId<T>> ofId​(MarketDataId<T> id)
        Obtains a filter that matches the specified identifier.
        Type Parameters:
        T - the type of market data handled by the filter
        Parameters:
        id - the identifier that is matched by this filter
        Returns:
        a filter matching the specified identifier
      • ofName

        static <T> MarketDataFilter<T,​NamedMarketDataId<T>> ofName​(MarketDataName<T> name)
        Obtains a filter that matches the specified name.
        Type Parameters:
        T - the type of market data handled by the filter
        Parameters:
        name - the name that is matched by this filter
        Returns:
        a filter matching the specified name
      • getMarketDataIdType

        java.lang.Class<?> getMarketDataIdType()
        Returns the type of market data ID handled by this filter.

        This should correspond to the type parameter I.

        Returns:
        the type of market data ID handled by this filter
      • matches

        boolean matches​(I marketDataId,
                        MarketDataBox<T> marketData,
                        ReferenceData refData)
        Applies the filter to a market data ID and the corresponding market data value and returns true if the filter matches.
        Parameters:
        marketDataId - the ID of a piece of market data
        marketData - the market data value
        refData - the reference data
        Returns:
        true if the filter matches