- Type Parameters:
T
- type of value
- All Known Implementing Classes:
Validatable
public interface IValidatable<T>
Interface representing any object that can be validated.
- Since:
- 1.2.6
- Author:
- Igor Vaynberg (ivaynberg)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
error
(IValidationError error) Reports an error against thisIValidatable
's value.getModel()
Returns the model of the component being validatedgetValue()
Retrieves the value to be validated.boolean
isValid()
Queries the current state of thisIValidatable
instance.
-
Method Details
-
getValue
Retrieves the value to be validated.- Returns:
- the value to be validated
-
error
Reports an error against thisIValidatable
's value. Multiple errors can be reported by calling this method multiple times.- Parameters:
error
- anIValidationError
to be reported
-
isValid
boolean isValid()Queries the current state of thisIValidatable
instance.IValidatable
s should assume they are valid untilerror(IValidationError)
is called.- Returns:
true
if the object is in a valid state,false
if otherwise
-
getModel
Returns the model of the component being validated- Returns:
- component's model
-