Package org.hawaiiframework.validation
Class ValidationError
- java.lang.Object
-
- org.hawaiiframework.validation.ValidationError
-
public class ValidationError extends Object
Encapsulates a validation error.- Since:
- 2.0.0
- Author:
- Marcel Overdijk
- See Also:
Validator
,ValidationResult
-
-
Constructor Summary
Constructors Constructor Description ValidationError(String code)
Constructs a newValidationError
with the supplied error code.ValidationError(String field, String code)
Constructs a newValidationError
with the supplied field name and error code.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCode()
Returns the error code.String
getField()
Returns the field name ornull
.String
toString()
-
-
-
Constructor Detail
-
ValidationError
public ValidationError(String code)
Constructs a newValidationError
with the supplied error code.- Parameters:
code
- the error code
-
ValidationError
public ValidationError(String field, String code)
Constructs a newValidationError
with the supplied field name and error code.- Parameters:
field
- the field namecode
- the error code
-
-