Class AdditionalSelectorConditions


  • public class AdditionalSelectorConditions
    extends java.lang.Object
    Registry class for AdditionalSelectorCondition. Any new selector types with a condition other than Objects.equals(java.lang.Object, java.lang.Object) should be added to this class' static initializer.

    This supersedes the previous mechanism where AdditionalSelectorConditions needed to be explicitly added by each use case. Reverting to the previous mechanism may prove necessary if a selector type is found which requires different conditions for different use cases. To help detect such a case should it occur, register(Class, Class, AdditionalSelectorCondition) will throw an error if multiple conditions are registered for the same type.

    Currently registered selector and data types are:

    • TimestampIntervalType selected by TimestampIntervalType
    • PowerSequencePriceDataType selected by PowerSequencePriceListDataSelectorsType
    • IncentiveDataType selected by IncentiveListDataSelectorsType
    • Method Detail

      • isSelected

        public static <DATA,​SELECTOR> boolean isSelected​(java.lang.Class<DATA> dataClass,
                                                               java.lang.Class<SELECTOR> selectorClass,
                                                               DATA data,
                                                               SELECTOR selector)
        Retrieve an AdditionalSelectorCondition from the registry and check it against the provided selector and data.
        Type Parameters:
        DATA - type of data to select
        SELECTOR - type of selector to select with
        Parameters:
        dataClass - class object for AdditionalSelectorConditions
        selectorClass - class object for AdditionalSelectorConditions
        data - data to select
        selector - selector to select with
        Returns:
        whether the found condition matches, or true if no condition was found.