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

pl.ais.commons.bean.validation.Validatable Maven / Gradle / Ivy

package pl.ais.commons.bean.validation;

import pl.ais.commons.bean.validation.constrainable.Constrainable;

import javax.annotation.Nonnull;
import java.util.function.Supplier;

/**
 * Defines the API contract for validatable value.
 *
 * @param  the type of the validatable values
 * @author Warlock, AIS.PL
 * @since 1.0.1
 */
public interface Validatable extends Supplier> {

    /**
     * Verifies if this validatable satisfies given constraints.
     *
     * @param first constraint which should be satisfied
     * @param rest  remaining constraints which should be satisfied
     * @return {@code true} if all constraints are satisfied by this validatable, {@code false} otherwise
     */
    boolean satisfies(@Nonnull Constraint first, Constraint... rest);

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy