Package com.kenshoo.pl.entity.spi
Interface FieldComplexValidator<E extends EntityType<E>,T>
-
- Type Parameters:
E- entity typeT- data type of the field being validated
- All Superinterfaces:
ChangeValidator
public interface FieldComplexValidator<E extends EntityType<E>,T> extends ChangeValidator
A validator that checks one field and uses parent entity fields for the verification. For instance, a validator that checks that a bid doesn't exceed campaign budget, would implement this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.stream.Stream<EntityField<?,?>>fetchFields()ValidationErrorvalidate(T fieldValue, CurrentEntityState currentState)Called by the framework to validate the value.EntityField<E,T>validatedField()
-
-
-
Method Detail
-
validatedField
EntityField<E,T> validatedField()
- Returns:
- the field validated by this validator
-
validate
ValidationError validate(T fieldValue, CurrentEntityState currentState)
Called by the framework to validate the value. The implementation can query theentityonly for the fields it has declared infetchFields().- Parameters:
fieldValue- new value of the fieldcurrentState- existing entity- Returns:
- a validation error if any,
nullif none
-
fetchFields
java.util.stream.Stream<EntityField<?,?>> fetchFields()
- Returns:
- a list of fields to fetch. Can contain only parent entities fields.
-
-