Package com.kenshoo.pl.entity.spi
Interface FieldValidator<E extends EntityType<E>,T>
-
- Type Parameters:
E- entity typeT- type of the validated field
- All Superinterfaces:
ChangeValidator
- All Known Implementing Classes:
NullFieldValidatorImpl
public interface FieldValidator<E extends EntityType<E>,T> extends ChangeValidator
The simplest form of a validator - validates a single field value without using any external information. For example, may be used to validate that the value of a field is positive.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ValidationErrorvalidate(T fieldValue)Validates the value.EntityField<E,T>validatedField()
-
-
-
Method Detail
-
validatedField
EntityField<E,T> validatedField()
- Returns:
- the field validated by the validator
-
validate
ValidationError validate(T fieldValue)
Validates the value.- Parameters:
fieldValue- new value of the field- Returns:
- validation error or
nullif none
-
-