de.jstacs.parameters.validation
Interface Constraint

All Superinterfaces:
Cloneable, Storable
All Known Implementing Classes:
SimpleStaticConstraint

public interface Constraint
extends Storable, Cloneable

Interface for a constraint that must be fulfilled in a ConstraintValidator.

Author:
Jan Grau

Field Summary
static int EQUALS
          The condition is equality
static int GEQ
          The condition is greater or equal
static int GT
          The condition is greater than
static int LEQ
          The condition is less or equal
static int LT
          The condition is less than
 
Method Summary
 boolean check(Object value)
          Checks value for the constraint defined in the Constraint.
 Constraint clone()
          This method returns a deep copy of the current instance.
 String getErrorMessage()
          Returns the message of the last error (missed constraint) or null if the constraint was fulfilled by the last checked value.
 
Methods inherited from interface de.jstacs.Storable
toXML
 

Field Detail

EQUALS

static final int EQUALS
The condition is equality

See Also:
Constant Field Values

LT

static final int LT
The condition is less than

See Also:
Constant Field Values

GT

static final int GT
The condition is greater than

See Also:
Constant Field Values

LEQ

static final int LEQ
The condition is less or equal

See Also:
Constant Field Values

GEQ

static final int GEQ
The condition is greater or equal

See Also:
Constant Field Values
Method Detail

check

boolean check(Object value)
Checks value for the constraint defined in the Constraint. If the constraint is fulfilled, true is returned.

Parameters:
value - the Object to be checked
Returns:
true if the constraint is fulfilled, false otherwise

getErrorMessage

String getErrorMessage()
Returns the message of the last error (missed constraint) or null if the constraint was fulfilled by the last checked value.

Returns:
the message of the last error or null

clone

Constraint clone()
                 throws CloneNotSupportedException
This method returns a deep copy of the current instance.

Returns:
a deep copy of the current instance
Throws:
CloneNotSupportedException - if the Constraint could not be cloned
See Also:
Cloneable