Package com.kenshoo.pl.entity.spi
Interface PrototypeFieldComplexValidator<T>
-
- Type Parameters:
T-
- All Superinterfaces:
ChangeValidator
public interface PrototypeFieldComplexValidator<T> extends ChangeValidator
Same asFieldComplexValidatorbut operating in terms of "prototypes".
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.stream.Stream<EntityField<?,?>>fetchFields()EntityFieldPrototype<T>getPrototype()ValidationErrorvalidate(T fieldValue, CurrentEntityState currentState)Validates the new value for the field.
-
-
-
Method Detail
-
getPrototype
EntityFieldPrototype<T> getPrototype()
- Returns:
- the field prototype validated by this validator
-
validate
ValidationError validate(T fieldValue, CurrentEntityState currentState)
Validates the new value for the field. 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.
-
-