Enum StringMatchType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<StringMatchType>

    public enum StringMatchType
    extends java.lang.Enum<StringMatchType>
    Enumeration of different string matching types available within Curator triggers.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      ALL_WORDS_CONTAINED
      Returns true if each word (regular expression word boundary separated) in the needle occurs in the set of words (regular expression word boundary separated) in the haystack, regardless of order.
      CASE_INSENSITIVE_ALL_WORDS_CONTAINED
      Returns true if each word (regular expression word boundary separated) in the needle occurs in the set of words (regular expression word boundary separated) in the haystack, ignoring case differences and regardless of order.
      CASE_INSENSITIVE_EXACT
      Returns true if the lower-cased (in default locale) haystack contains the same sequence of characters as the lower-cased (in default locale) needle.
      CASE_INSENSITIVE_SUBSTRING
      Returns true if the lower-cased (in default locale) haystack contains the lower-cased (in default locale) needle.
      EXACT
      Returns true if the haystack and the needle contain the same sequence of characters.
      NUMERIC_GREATER_THAN
      Returns true if the needle is greater than the haystack after both are converted to floats with Float.parseFloat.
      NUMERIC_LESS_THAN
      Returns true if the needle is less than the haystack after both are converted to floats with Float.parseFloat.
      REGULAR_EXPRESSION
      Returns true if haystack matches the regular expression defined by needle.
      SUBSTRING
      Returns true if the haystack contains the needle.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static org.apache.logging.log4j.Logger log  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private StringMatchType()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract java.lang.Boolean matches​(java.lang.String needle, java.lang.String haystack)
      Returns whether needle is present in haystack for a given type of string match.
      static StringMatchType valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static StringMatchType[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • EXACT

        public static final StringMatchType EXACT
        Returns true if the haystack and the needle contain the same sequence of characters.
      • CASE_INSENSITIVE_EXACT

        public static final StringMatchType CASE_INSENSITIVE_EXACT
        Returns true if the lower-cased (in default locale) haystack contains the same sequence of characters as the lower-cased (in default locale) needle.
      • SUBSTRING

        public static final StringMatchType SUBSTRING
        Returns true if the haystack contains the needle.
      • CASE_INSENSITIVE_SUBSTRING

        public static final StringMatchType CASE_INSENSITIVE_SUBSTRING
        Returns true if the lower-cased (in default locale) haystack contains the lower-cased (in default locale) needle.
      • REGULAR_EXPRESSION

        public static final StringMatchType REGULAR_EXPRESSION
        Returns true if haystack matches the regular expression defined by needle. Note, needle expression must match the entire haystack.
      • ALL_WORDS_CONTAINED

        public static final StringMatchType ALL_WORDS_CONTAINED
        Returns true if each word (regular expression word boundary separated) in the needle occurs in the set of words (regular expression word boundary separated) in the haystack, regardless of order.
      • CASE_INSENSITIVE_ALL_WORDS_CONTAINED

        public static final StringMatchType CASE_INSENSITIVE_ALL_WORDS_CONTAINED
        Returns true if each word (regular expression word boundary separated) in the needle occurs in the set of words (regular expression word boundary separated) in the haystack, ignoring case differences and regardless of order.
      • NUMERIC_GREATER_THAN

        public static final StringMatchType NUMERIC_GREATER_THAN
        Returns true if the needle is greater than the haystack after both are converted to floats with Float.parseFloat.
      • NUMERIC_LESS_THAN

        public static final StringMatchType NUMERIC_LESS_THAN
        Returns true if the needle is less than the haystack after both are converted to floats with Float.parseFloat.
    • Field Detail

      • log

        private static final org.apache.logging.log4j.Logger log
    • Constructor Detail

      • StringMatchType

        private StringMatchType()
    • Method Detail

      • values

        public static StringMatchType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (StringMatchType c : StringMatchType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static StringMatchType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • matches

        public abstract java.lang.Boolean matches​(java.lang.String needle,
                                                  java.lang.String haystack)
        Returns whether needle is present in haystack for a given type of string match.