Class EnumContextDefinition<T extends Enum<T>>

    • Method Detail

      • deserialize

        public final @Nullable T deserialize​(String userValue)
        Description copied from class: ContextDefinition
        Given a string (which may be in user format), return a parsed object.
        Specified by:
        deserialize in class ContextDefinition<T extends Enum<T>>
        Parameters:
        userValue - the value as a string, such as when provided by user input
        Returns:
        V a deserialized value, or null if unsuccessful
      • matches

        public boolean matches​(T ownVal,
                               T testVal)
        Description copied from class: ContextDefinition
        Get whether two values match.
        Overrides:
        matches in class ContextDefinition<T extends Enum<T>>
        Parameters:
        ownVal - the defined value
        testVal - the value being tested against
        Returns:
        whether testVal is an element of ownVal
      • suggestValues

        public Set<TsuggestValues​(CalculatedSubject subject)
        Description copied from class: ContextDefinition
        Given a subject, suggest a set of values that may be valid for this context. This need not be an exhaustive list, or could even be an empty list, but allows providing users possible suggestions to what sensible values for a context may be.
        Overrides:
        suggestValues in class ContextDefinition<T extends Enum<T>>
        Parameters:
        subject - a subject to query for environment information
        Returns:
        a set of possible values