org.unitils.reflectionassert
Enum ReflectionComparatorMode

java.lang.Object
  extended by java.lang.Enum<ReflectionComparatorMode>
      extended by org.unitils.reflectionassert.ReflectionComparatorMode
All Implemented Interfaces:
Serializable, Comparable<ReflectionComparatorMode>

public enum ReflectionComparatorMode
extends Enum<ReflectionComparatorMode>

Modes defining how to compare two values. No mode means strict comparison. Each of the modes specify some form of leniency when comparing the values:

The modes can be combined if needed.

Author:
Tim Ducheyne, Filip Neven

Enum Constant Summary
IGNORE_DEFAULTS
          Ignore fields that do not have a default value for the left-hand (expected) side
LENIENT_DATES
          Do not compare the actual time/date value, just that both left-hand (expected) and right-hand side are null or not null.
LENIENT_ORDER
          Do not compare the order of collections and arrays.
 
Method Summary
static ReflectionComparatorMode valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ReflectionComparatorMode[] 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, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

IGNORE_DEFAULTS

public static final ReflectionComparatorMode IGNORE_DEFAULTS
Ignore fields that do not have a default value for the left-hand (expected) side


LENIENT_DATES

public static final ReflectionComparatorMode LENIENT_DATES
Do not compare the actual time/date value, just that both left-hand (expected) and right-hand side are null or not null.


LENIENT_ORDER

public static final ReflectionComparatorMode LENIENT_ORDER
Do not compare the order of collections and arrays. Only check that all values of the left-hand (expected) side collection or array are also contained in the right-hand (actual) side and vice versa.

Method Detail

values

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

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

valueOf

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


Copyright © 2011. All Rights Reserved.