Enum LikePatternSyntax

  • All Implemented Interfaces:
    Serializable, Comparable<LikePatternSyntax>

    public enum LikePatternSyntax
    extends Enum<LikePatternSyntax>
    Enum defining available syntaxes for a match pattern in a LIKE-clause. While databases typically require SQL syntax, human user expect GLOB syntax in search forms. Therefore this enum also supports conversion from one syntax to another.
    Since:
    3.0.0
    • Method Detail

      • values

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

        public static LikePatternSyntax 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
      • getAny

        public char getAny()
        Returns:
        the wildcard character that matches any string including the empty string.
      • getSingle

        public char getSingle()
        Returns:
        the wildcard character that matches exactly one single character.
      • autoDetect

        public static LikePatternSyntax autoDetect​(String pattern)
        Parameters:
        pattern - the string value that may be a pattern.
        Returns:
        the LikePatternSyntax for the given pattern or null if the given pattern does not contain any wildcards.