public class ConstraintFactory extends Object
Modifier and Type | Field and Description |
---|---|
Expression |
ANYTHING
Always passes
|
Expression |
AS_RECORDED
Special expression to indicate that a recorded argument on this position should
not be changed.
|
ClassConstraintFactory |
clazz
A factory with expressions for checking attributes of java.lang.Class objects.
|
Expression |
FALSE
Checks if the checked actual value is a boolen and false
|
MethodConstraintFactory |
method
A factory with expressions for checking methods.
|
Expression |
NoChange
Deprecated.
Use AS_RECORDED instead
|
Expression |
NOT_NULL
Checks if the checked actual value is a boolen and not null.
|
Expression |
NULL
Passes if the checked actual value is null
|
Expression |
TRUE
Checks if the checked actual value is a boolen and true
|
Constructor and Description |
---|
ConstraintFactory() |
Modifier and Type | Method and Description |
---|---|
Expression |
containing(String string)
Passes if the actual string is containing the value of string
|
Expression |
endingWith(String string)
Passes if the actual string ends with the value of string
|
Expression |
eq(boolean ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(byte ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(char ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(double ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(float ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(int ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(long ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(Object ref)
Passes if the reference is equal to the actual object.
|
Expression |
eq(short ref)
Passes if the reference is equal to the actual object.
|
Expression |
ge(byte ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
ge(char ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
ge(double ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
ge(float ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
ge(int ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
ge(long ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
ge(Object ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
ge(short ref)
Passes if the actual is greater than or equal to the reference.
|
Expression |
gt(byte ref)
Passes if the actual is greater than the reference.
|
Expression |
gt(char ref)
Passes if the actual is greater than the reference.
|
Expression |
gt(double ref)
Passes if the actual is greater than the reference.
|
Expression |
gt(float ref)
Passes if the actual is greater than the reference.
|
Expression |
gt(int ref)
Passes if the actual is greater than the reference.
|
Expression |
gt(long ref)
Passes if the actual is greater than the reference.
|
Expression |
gt(Object ref)
Passes if the actual is greater than the reference.
|
Expression |
gt(short ref)
Passes if the actual is greater than the reference.
|
Expression |
instanceOf(Class clazz)
Passes if the actual object is an instance of the class passed as the parameter clazz.
|
Expression |
le(byte ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
le(char ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
le(double ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
le(float ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
le(int ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
le(long ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
le(Object ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
le(short ref)
Passes if the actual is less than or equal to the reference.
|
Expression |
lt(byte ref)
Passes if the actual is less than the reference.
|
Expression |
lt(char ref)
Passes if the actual is less than the reference.
|
Expression |
lt(double ref)
Passes if the actual is less than the reference.
|
Expression |
lt(float ref)
Passes if the actual is less than the reference.
|
Expression |
lt(int ref)
Passes if the actual is less than the reference.
|
Expression |
lt(long ref)
Passes if the actual is less than the reference.
|
Expression |
lt(Object ref)
Passes if the actual is less than the reference.
|
Expression |
lt(short ref)
Passes if the actual is less than the reference.
|
Expression |
not(Expression expression)
Inverts an expression
|
Expression |
same(Object ref)
Passes if the actual object is the same reference as the ref object.
|
Expression |
startingWith(String string)
Passes if the actual string begins with the value of string
|
public final Expression AS_RECORDED
public final Expression NoChange
public final Expression NULL
public final Expression TRUE
public final Expression FALSE
public final Expression NOT_NULL
public final Expression ANYTHING
public final ClassConstraintFactory clazz
public final MethodConstraintFactory method
public Expression same(Object ref)
ref
- the reference to check againstpublic Expression instanceOf(Class clazz)
clazz
- The class to check if the actual object is an instance of.public Expression eq(Object ref)
ref
- the reference to check againstpublic Expression eq(boolean ref)
ref
- the reference to check againstpublic Expression eq(long ref)
ref
- the reference to check againstpublic Expression eq(int ref)
ref
- the reference to check againstpublic Expression eq(short ref)
ref
- the reference to check againstpublic Expression eq(byte ref)
ref
- the reference to check againstpublic Expression eq(double ref)
ref
- the reference to check againstpublic Expression eq(float ref)
ref
- the reference to check againstpublic Expression eq(char ref)
ref
- the reference to check againstpublic Expression gt(Object ref)
ref
- the reference to check againstpublic Expression gt(long ref)
ref
- the reference to check againstpublic Expression gt(int ref)
ref
- the reference to check againstpublic Expression gt(short ref)
ref
- the reference to check againstpublic Expression gt(byte ref)
ref
- the reference to check againstpublic Expression gt(double ref)
ref
- the reference to check againstpublic Expression gt(float ref)
ref
- the reference to check againstpublic Expression gt(char ref)
ref
- the reference to check againstpublic Expression ge(Object ref)
ref
- the reference to check againstpublic Expression ge(long ref)
ref
- the reference to check againstpublic Expression ge(int ref)
ref
- the reference to check againstpublic Expression ge(short ref)
ref
- the reference to check againstpublic Expression ge(byte ref)
ref
- the reference to check againstpublic Expression ge(double ref)
ref
- the reference to check againstpublic Expression ge(float ref)
ref
- the reference to check againstpublic Expression ge(char ref)
ref
- the reference to check againstpublic Expression lt(Object ref)
i
- the reference to check againstpublic Expression lt(long ref)
ref
- the reference to check againstpublic Expression lt(int ref)
ref
- the reference to check againstpublic Expression lt(short ref)
ref
- the reference to check againstpublic Expression lt(byte ref)
ref
- the reference to check againstpublic Expression lt(double ref)
ref
- the reference to check againstpublic Expression lt(float ref)
ref
- the reference to check againstpublic Expression lt(char ref)
ref
- the reference to check againstpublic Expression le(Object ref)
ref
- the reference to check againstpublic Expression le(long ref)
ref
- the reference to check againstpublic Expression le(int ref)
ref
- the reference to check againstpublic Expression le(short ref)
ref
- the reference to check againstpublic Expression le(byte ref)
ref
- the reference to check againstpublic Expression le(double ref)
ref
- the reference to check againstpublic Expression le(float ref)
ref
- the reference to check againstspublic Expression le(char ref)
ref
- the reference to check againstpublic Expression not(Expression expression)
expression
- the expression to invertpublic Expression containing(String string)
string
- the String that the actual object must contain for this expression to passpublic Expression startingWith(String string)
string
- the String that the actual object must begin with for this expression to passpublic Expression endingWith(String string)
string
- the String that the actual object must end with for this expression to passCopyright © 2005-2013 Agical AB. All Rights Reserved.