Enum CompareType
java.lang.Object
java.lang.Enum<CompareType>
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.CompareType
- All Implemented Interfaces:
Serializable,Comparable<CompareType>
Enum of different ways of comparing a pattern.
- Author:
- Robert Sandell <robert.sandell@sonyericsson.com>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic CompareTypefindByDisplayName(String displayName) Finds a CompareType based on displayName.static CompareTypefindByOperator(char operator) Finds a CompareType based on the operator.Returns a "human readable" name of the instance.Gets a list of all CompareType's displayNames.charReturns the operator, the one-char identifier for the CompareType.booleanTells if the given string matches the given pattern based on the algorithm of this CompareType instance.toString()static CompareTypeReturns the enum constant of this type with the specified name.static CompareType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
PLAIN
Plain equals comparison. -
ANT
ANT style path comparison. -
REG_EXP
Regular expression comparison.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
getDisplayNames
Gets a list of all CompareType's displayNames.- Returns:
- a list of available displaynames.
-
findByDisplayName
Finds a CompareType based on displayName.- Parameters:
displayName- the displayName- Returns:
- the CompareType that matches the displayName or PLAIN if none is found.
-
findByOperator
Finds a CompareType based on the operator.- Parameters:
operator- the operator.- Returns:
- the CompareType that matches the operator or PLAIN if none is found.
-
matches
Tells if the given string matches the given pattern based on the algorithm of this CompareType instance.- Parameters:
pattern- the patternstr- the string- Returns:
- true if the string matches the pattern.
-
getDisplayName
Returns a "human readable" name of the instance.- Returns:
- the display name
-
getOperator
public char getOperator()Returns the operator, the one-char identifier for the CompareType.- Returns:
- the operator.
-
toString
- Overrides:
toStringin classEnum<CompareType>
-