Class ConditionFactory.KeyRegexpCondition

    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean negateResult
      If we should negate the result of the match.
      java.util.regex.Pattern pattern
      A predicate used to match a the regexp against the key.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeyRegexpCondition​(java.util.regex.Pattern pattern, boolean negateResult)
      Creates a new KeyPatternCondition
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean applies​(Tagged osm)
      Checks if the condition applies in the given Tagged element.
      Tag asTag​(Tagged p)
      Get the matched key and the corresponding value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • pattern

        public final java.util.regex.Pattern pattern
        A predicate used to match a the regexp against the key. Only used if the match type is regexp.
      • negateResult

        public final boolean negateResult
        If we should negate the result of the match.
    • Constructor Detail

      • KeyRegexpCondition

        public KeyRegexpCondition​(java.util.regex.Pattern pattern,
                                  boolean negateResult)
        Creates a new KeyPatternCondition
        Parameters:
        pattern - The regular expression for matching keys.
        negateResult - If we should negate the result.
    • Method Detail

      • asTag

        public Tag asTag​(Tagged p)
        Get the matched key and the corresponding value.

        WARNING: This ignores negateResult.

        WARNING: For regexp, the regular expression is returned instead of a key if the match failed.

        Specified by:
        asTag in interface Condition.TagCondition
        Parameters:
        p - The primitive to get the value from.
        Returns:
        The tag.
      • toString

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