Class BasicEnvironmentalContext

  • All Implemented Interfaces:
    EnvironmentalContext

    public class BasicEnvironmentalContext
    extends java.lang.Object
    implements EnvironmentalContext
    Basic implementation matches value for equality or as a regular expression if specified. Matches only a single Attribute, and will not match for multiple inputs
    • Method Detail

      • patternContextFor

        public static BasicEnvironmentalContext patternContextFor​(java.lang.String key,
                                                                  java.lang.String value)
        Parameters:
        key - key
        value - value to check for equality and regular expression if it is a valid regular expression
        Returns:
        context with possible regular expression value match
      • staticContextFor

        public static BasicEnvironmentalContext staticContextFor​(java.lang.String key,
                                                                 java.lang.String value)
        Parameters:
        key - key
        value - value to use for equality match
        Returns:
        context with equality matching
      • matches

        public boolean matches​(java.util.Set<Attribute> environment)
        Specified by:
        matches in interface EnvironmentalContext
        Parameters:
        environment - environment
        Returns:
        true if the context matches the input environment
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isValid

        public boolean isValid()
        Specified by:
        isValid in interface EnvironmentalContext
        Returns:
        true if the context definition is valid
      • getKeyUri

        public java.net.URI getKeyUri()