com.redhat.rhn.common.validator
Class ValidatorResult

java.lang.Object
  extended by com.redhat.rhn.common.validator.ValidatorResult

public class ValidatorResult
extends java.lang.Object

The ValidatorResult class is a container intended to be used by validation methods that return both errors and warnings.


Constructor Summary
ValidatorResult()
           
 
Method Summary
 void addError(java.lang.String key, java.lang.Object... args)
          Add a ValidatorError to the list of errors.
 void addError(ValidatorError error)
          Add a ValidatorError to the list of errors.
 void addWarning(java.lang.String key, java.lang.Object... args)
          Add a ValidatorWarning to the list of warnings.
 void addWarning(ValidatorWarning warning)
          Add a ValidatorWarning to the list of warnings.
 void append(ValidatorResult result)
          Appends the results of the passed in ValidatorResult to this result
 java.util.List<ValidatorError> getErrors()
          Retrieve the list of ValidatorErrors.
 java.lang.String getMessage()
           
 java.util.List<ValidatorWarning> getWarnings()
          Retrieve the list of ValidatorWarnings.
 boolean isEmpty()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidatorResult

public ValidatorResult()
Method Detail

addError

public void addError(ValidatorError error)
Add a ValidatorError to the list of errors.

Parameters:
error - ValidatorError to be added.

addError

public void addError(java.lang.String key,
                     java.lang.Object... args)
Add a ValidatorError to the list of errors.

Parameters:
key - the message key of the error
args - the args that go with the error message.

addWarning

public void addWarning(ValidatorWarning warning)
Add a ValidatorWarning to the list of warnings.

Parameters:
warning - ValidatorWarning to be added.

addWarning

public void addWarning(java.lang.String key,
                       java.lang.Object... args)
Add a ValidatorWarning to the list of warnings.

Parameters:
key - the message key of the warning
args - the args that go with the warning.

getErrors

public java.util.List<ValidatorError> getErrors()
Retrieve the list of ValidatorErrors.

Returns:
List of ValidatorError objects.

getWarnings

public java.util.List<ValidatorWarning> getWarnings()
Retrieve the list of ValidatorWarnings.

Returns:
List of ValidatorWarning objects.

append

public void append(ValidatorResult result)
Appends the results of the passed in ValidatorResult to this result

Parameters:
result - the results to append.

getMessage

public java.lang.String getMessage()
Returns:
TODO

isEmpty

public boolean isEmpty()
Returns:
true if there are no errors or warnings..