Package eu.simuline.testhelpers
Enum Assert.CmpObj
- java.lang.Object
-
- java.lang.Enum<Assert.CmpObj>
-
- eu.simuline.testhelpers.Assert.CmpObj
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<Assert.CmpObj>
public static enum Assert.CmpObj extends java.lang.Enum<Assert.CmpObj>
Represents an ordering relation. To be used as a parameter for the methodsAssert.assertIs(Assert.CmpObj, Comparable, Object),Assert.assertIs(Assert.CmpObj, Object, Object, Comparator)and variants thereof.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringmessageCore part of the message when the relation fails.
-
Constructor Summary
Constructors Modifier Constructor Description privateCmpObj(java.lang.String message)Creates a newCmpObjwith the given fractin of message; also the implementation of methodisValid(int)has to be provided hereafter.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private booleaninvokeCompareTo(java.lang.Comparable<?> expected, java.lang.Object actual)Returnsexpected.compareTo(actual)if possible.(package private) abstract booleanisValid(int flag3)Returns whetherisValidmethod here.static Assert.CmpObjvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static Assert.CmpObj[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LESS_EQ
public static final Assert.CmpObj LESS_EQ
-
LESS
public static final Assert.CmpObj LESS
-
GREATER
public static final Assert.CmpObj GREATER
-
GREATER_EQ
public static final Assert.CmpObj GREATER_EQ
-
EQUAL
public static final Assert.CmpObj EQUAL
-
NOT_EQUAL
public static final Assert.CmpObj NOT_EQUAL
-
-
Constructor Detail
-
CmpObj
private CmpObj(java.lang.String message)
Creates a newCmpObjwith the given fractin of message; also the implementation of methodisValid(int)has to be provided hereafter.- Parameters:
message- aStringvalue
-
-
Method Detail
-
values
public static Assert.CmpObj[] 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 (Assert.CmpObj c : Assert.CmpObj.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Assert.CmpObj 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 namejava.lang.NullPointerException- if the argument is null
-
isValid
abstract boolean isValid(int flag3)
Returns whetherisValidmethod here.- Parameters:
flag3- anintwhich is the output of a methodComparable.compareTo(T)orComparator.compare(T, T).- Returns:
- a
booleanvalue signifying whetherflag3is allowed.
-
invokeCompareTo
private boolean invokeCompareTo(java.lang.Comparable<?> expected, java.lang.Object actual)Returnsexpected.compareTo(actual)if possible.- Parameters:
expected- an instance of anObject.actual- anObjectornull.- Returns:
- the
intvalue which results in invokingexpected.compare(actual). - Throws:
java.lang.IllegalArgumentException--
if
expectedis not an instance ofComparableand in particular forexpected == null, -
if invoking
expected.compareTo(actual)raises an exception.
-
if
java.lang.IllegalStateException- ifexpected.compare(actual)is evaluated foractual == nullwithout throwing an exception as specified forComparable.compareTo(T).
-
-