com.ibm.team.fvt.tests.utils
Enum StringComparisonCriterion

java.lang.Object
  extended by java.lang.Enum<StringComparisonCriterion>
      extended by com.ibm.team.fvt.tests.utils.StringComparisonCriterion
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<StringComparisonCriterion>

public enum StringComparisonCriterion
extends java.lang.Enum<StringComparisonCriterion>

Enumeration to define a list of comparison criteria for matching two strings.


Enum Constant Summary
CONTAINS
           
ENDSWITH
           
EQUALS
           
STARTSWITH
           
 
Method Summary
abstract  boolean compare(java.lang.String text1, java.lang.String text2)
          Compare the two given strings in the corresponding criterion.
static StringComparisonCriterion valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static StringComparisonCriterion[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

EQUALS

public static final StringComparisonCriterion EQUALS

ENDSWITH

public static final StringComparisonCriterion ENDSWITH

STARTSWITH

public static final StringComparisonCriterion STARTSWITH

CONTAINS

public static final StringComparisonCriterion CONTAINS
Method Detail

values

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

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

valueOf

public static StringComparisonCriterion valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

compare

public abstract boolean compare(java.lang.String text1,
                                java.lang.String text2)
Compare the two given strings in the corresponding criterion.

Parameters:
text1 - First string
text2 - Second string
Returns:
true if the 2 strings match in the corresponding criterion or false otherwise.