Enum Comparator
- java.lang.Object
-
- java.lang.Enum<Comparator>
-
- org.jenkinsci.plugins.pipeline.modeldefinition.when.utils.Comparator
-
- All Implemented Interfaces:
Serializable
,Comparable<Comparator>
public enum Comparator extends Enum<Comparator>
Utility for selecting a way to compare two strings.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
compare(String pattern, String actual)
Compare the two stringsabstract boolean
compare(String pattern, String actual, boolean caseSensitive)
Compare the two stringsstatic Comparator
get(String name, Comparator defaultValue)
org.jvnet.localizer.Localizable
getDisplayName()
static ListBoxModel
getSelectOptions(boolean emptySelection, Comparator top)
static Comparator
valueOf(String name)
Returns the enum constant of this type with the specified name.static Comparator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
GLOB
public static final Comparator GLOB
ANT style "glob" pattern.
-
REGEXP
public static final Comparator REGEXP
Regular expression
-
EQUALS
public static final Comparator EQUALS
String equals
-
-
Method Detail
-
values
public static Comparator[] 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 (Comparator c : Comparator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Comparator 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 nameNullPointerException
- if the argument is null
-
getDisplayName
public org.jvnet.localizer.Localizable getDisplayName()
-
compare
public abstract boolean compare(String pattern, String actual, boolean caseSensitive)
Compare the two strings- Parameters:
pattern
- the pattern/value to check foractual
- the value to checkcaseSensitive
- whether the comparison will be case-sensitive. Only for the GLOB comparator- Returns:
- true if matching
-
compare
public abstract boolean compare(String pattern, String actual)
Compare the two strings- Parameters:
pattern
- the pattern/value to check foractual
- the value to check- Returns:
- true if matching
-
get
public static Comparator get(String name, Comparator defaultValue)
-
getSelectOptions
public static ListBoxModel getSelectOptions(boolean emptySelection, Comparator top)
-
-