All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kenshoo.pl.entity.spi.FieldValidator Maven / Gradle / Ivy

Go to download

A Java persistence layer based on JOOQ for high performance and business flow support.

There is a newer version: 0.1.121-jooq-3.16.3
Show newest version
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);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy