Enum RegexpFlag

  • All Implemented Interfaces:
    Serializable, Comparable<RegexpFlag>

    public enum RegexpFlag
    extends Enum<RegexpFlag>
    Regular expression syntax flags. Each flag represents optional syntax support in the regular expression:
    • INTERSECTION - Support for intersection notation: &lt;expression&gt; &amp; &lt;expression&gt;
    • COMPLEMENT - Support for complement notation: &lt;expression&gt; &amp; &lt;expression&gt;
    • EMPTY - Support for the empty language symbol: #
    • ANYSTRING - Support for the any string symbol: @
    • INTERVAL - Support for numerical interval notation: &lt;n-m&gt;
    • NONE - Disable support for all syntax options
    • ALL - Enables support for all syntax options
    See Also:
    RegexpQueryBuilder.flags(RegexpFlag...), RegexpQueryBuilder.flags(RegexpFlag...)
    • Enum Constant Detail

      • INTERSECTION

        public static final RegexpFlag INTERSECTION
        Enables intersection of the form: &lt;expression&gt; &amp; &lt;expression&gt;
      • COMPLEMENT

        public static final RegexpFlag COMPLEMENT
        Enables complement expression of the form: ~&lt;expression&gt;
      • EMPTY

        public static final RegexpFlag EMPTY
        Enables empty language expression: #
      • ANYSTRING

        public static final RegexpFlag ANYSTRING
        Enables any string expression: @
      • INTERVAL

        public static final RegexpFlag INTERVAL
        Enables numerical interval expression: &lt;n-m&gt;
      • NONE

        public static final RegexpFlag NONE
        Disables all available option flags
      • ALL

        public static final RegexpFlag ALL
        Enables all available option flags
    • Method Detail

      • values

        public static RegexpFlag[] 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 (RegexpFlag c : RegexpFlag.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RegexpFlag valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • value

        public int value()
      • resolveValue

        public static int resolveValue​(String flags)
        Resolves the combined OR'ed value for the given list of regular expression flags. The given flags must follow the following syntax:

        flag_name(|flag_name)*

        Where flag_name is one of the following:

        • INTERSECTION
        • COMPLEMENT
        • EMPTY
        • ANYSTRING
        • INTERVAL
        • NONE
        • ALL

        Example: INTERSECTION|COMPLEMENT|EMPTY

        Parameters:
        flags - A string representing a list of regular expression flags
        Returns:
        The combined OR'ed value for all the flags