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

org.nuiton.validator.NuitonValidator Maven / Gradle / Ivy

The newest version!
/*
 * #%L
 * Validation :: API
 * %%
 * Copyright (C) 2021 - 2024 Ultreia.io
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * .
 * #L%
 */
package org.nuiton.validator;

import java.util.Set;

/**
 * Contract of a validator.
 * 

* To obtain validator, see the {@link NuitonValidatorProvider} api. * * @author Tony Chemit - [email protected] * @see NuitonValidatorProviders * @see NuitonValidatorProvider * @since 2.0 */ public interface NuitonValidator { /** * Validates the given object and returns the result of validation. * * @param object the object to validate * @param validationContext optional validation context * @return the result of validation for the given object * @throws NullPointerException if object is {@code null}. */ NuitonValidatorResult validate(O object, NuitonValidationContext validationContext) throws NullPointerException; /** * Obtains the model of the validator. * * @return the model of the validator */ NuitonValidatorModel getModel(); /** * Obtains the set of effective scopes for the validator : means the very * scopes that the validator is dealing with. *

* This is a subset of the model authorized scopes. * * @return the set of effective scopes of the validator */ Set getEffectiveScopes(); /** * Obtains the set of effective fields for the validator : means the very * fields validated by the validator. *

* This is a sub set of fields of the object to validate. * * @return the set of effective fields of the validator */ Set getEffectiveFields(); /** * Obtains the set of effective fields for the validator for the given scope * : means the very fields validated by the validator. *

* This is a subset of effective fields of the validator. * * @param scope given scope to use * @return the set of effective fields of the validator for the given scope */ Set getEffectiveFields(NuitonValidatorScope scope); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy