org.beanfabrics.validation
Class ValidationState

java.lang.Object
  extended by org.beanfabrics.validation.ValidationState
Direct Known Subclasses:
CompositeValidationState

public class ValidationState
extends java.lang.Object

The ValidationState is the result of a call to ValidationRule.validate() and indicates that this rule has found some invalid state. It contains a human readable text message which usually is reported to the application user.


Constructor Summary
ValidationState(java.lang.String message)
          Constructs a new instance with the given message.
 
Method Summary
static ValidationState create(java.lang.String message)
          Factory-method for creating a ValidationState from the specified message or null if the message is null.
 boolean equals(java.lang.Object other)
          Returns true when this instance is equal to the given object.
 java.lang.String getMessage()
          Returns the message for this instance.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationState

public ValidationState(java.lang.String message)
                throws java.lang.IllegalArgumentException
Constructs a new instance with the given message.

Parameters:
message - the message text of this ValidationState
Throws:
java.lang.IllegalArgumentException - when message is null
Method Detail

create

public static ValidationState create(java.lang.String message)
Factory-method for creating a ValidationState from the specified message or null if the message is null.

Parameters:
message - String
Returns:
the ValidationState if message is not null, otherwise returns null

getMessage

public java.lang.String getMessage()
Returns the message for this instance.

Returns:
String

equals

public boolean equals(java.lang.Object other)
Returns true when this instance is equal to the given object.

Overrides:
equals in class java.lang.Object
Parameters:
other - Object to compare this instance to
Returns:
boolean true if this instance and the given object are equal, else false

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object