com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data
Enum CompareType

java.lang.Object
  extended by java.lang.Enum<CompareType>
      extended by com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.CompareType
All Implemented Interfaces:
Serializable, Comparable<CompareType>

public enum CompareType
extends Enum<CompareType>

Enum of different ways of comparing a pattern.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Enum Constant Summary
ANT
          ANT style path comparison.
PLAIN
          Plain equals comparison.
REG_EXP
          Regular expression comparison.
 
Method Summary
static CompareType findByDisplayName(String displayName)
          Finds a CompareType based on displayName.
static CompareType findByOperator(char operator)
          Finds a CompareType based on the operator.
 String getDisplayName()
          Returns a "human readable" name of the instance.
static List<String> getDisplayNames()
          Gets a list of all CompareType's displayNames.
 char getOperator()
          Returns the operator, the one-char identifier for the CompareType.
 boolean matches(String pattern, String str)
          Tells if the given string matches the given pattern based on the algorithm of this CompareType instance.
 String toString()
           
static CompareType valueOf(String name)
          Returns 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.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

PLAIN

public static final CompareType PLAIN
Plain equals comparison.


ANT

public static final CompareType ANT
ANT style path comparison.


REG_EXP

public static final CompareType REG_EXP
Regular expression comparison.

Method Detail

values

public static CompareType[] 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 (CompareType c : CompareType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static CompareType 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

getDisplayNames

public static List<String> getDisplayNames()
Gets a list of all CompareType's displayNames.

Returns:
a list of available displaynames.

findByDisplayName

public static CompareType findByDisplayName(String displayName)
Finds a CompareType based on displayName.

Parameters:
displayName - the displayName
Returns:
the CompareType that matches the displayName or PLAIN if none is found.

findByOperator

public static CompareType findByOperator(char operator)
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

public boolean matches(String pattern,
                       String str)
Tells if the given string matches the given pattern based on the algorithm of this CompareType instance.

Parameters:
pattern - the pattern
str - the string
Returns:
true if the string matches the pattern.

getDisplayName

public String 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

public String toString()
Overrides:
toString in class Enum<CompareType>


Copyright © 2004-2014. All Rights Reserved.