com.kenshoo.pl.entity.spi.FieldValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of persistence-layer Show documentation
Show all versions of persistence-layer Show documentation
A Java persistence layer based on JOOQ for high performance and business flow support.
package com.kenshoo.pl.entity.spi;
import com.kenshoo.pl.entity.EntityField;
import com.kenshoo.pl.entity.EntityType;
import com.kenshoo.pl.entity.ValidationError;
/**
* 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.
*
* @param entity type
* @param type of the validated field
*/
public interface FieldValidator, T> extends ChangeValidator {
/**
* @return the field validated by the validator
*/
EntityField validatedField();
/**
* Validates the value.
*
* @param fieldValue new value of the field
* @return validation error or null
if none
*/
ValidationError validate(T fieldValue);
}