org.apache.commons.validator

Class ValidatorResult.ResultStatus

protected class ValidatorResult.ResultStatus extends Object implements Serializable

Contains the status of the validation.
Field Summary
Objectresult
booleanvalid
Constructor Summary
ResultStatus(boolean valid, Object result)
Construct a Result status.
Method Summary
ObjectgetResult()
Gets the result returned by a validation method.
booleanisValid()
Tests whether or not the validation passed.
voidsetResult(Object result)
Sets the result returned by a validation method.
voidsetValid(boolean valid)
Sets whether or not the validation passed.

Field Detail

result

private Object result

valid

private boolean valid

Constructor Detail

ResultStatus

public ResultStatus(boolean valid, Object result)
Construct a Result status.

Parameters: valid Whether the validator passed or failed. result Value returned by the validator.

Method Detail

getResult

public Object getResult()
Gets the result returned by a validation method. This can be used to retrieve to the correctly typed value of a date validation for example.

Returns: The value returned by the validation.

isValid

public boolean isValid()
Tests whether or not the validation passed.

Returns: true if the result was good.

setResult

public void setResult(Object result)
Sets the result returned by a validation method. This can be used to retrieve to the correctly typed value of a date validation for example.

Parameters: result The value returned by the validation.

setValid

public void setValid(boolean valid)
Sets whether or not the validation passed.

Parameters: valid Whether the validation passed.

Copyright (c) 2001-2004 Apache Software Foundation