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

org.hibernate.validator.cfg.GenericConstraintDef Maven / Gradle / Ivy

Go to download

Following the DRY (Don't Repeat Yourself) principle, Hibernate Validator let's you express your domain constraints once (and only once) and ensure their compliance at various level of your system automatically.

There is a newer version: 9.0.0.Beta3
Show newest version
/*
 * Hibernate Validator, declare and validate application constraints
 *
 * License: Apache License, Version 2.0
 * See the license.txt file in the root directory or .
 */

package org.hibernate.validator.cfg;

import java.lang.annotation.Annotation;

/**
 * A {@link ConstraintDef} class which can be used to configure any constraint
 * type. For this purpose the class defines a generic method
 * {@link GenericConstraintDef#param(String, Object)} which allows to add
 * arbitrary constraint parameters.
 *
 * @author Hardy Ferentschik
 * @author Gunnar Morling
 */
public class GenericConstraintDef extends ConstraintDef, A> {

	public GenericConstraintDef(Class constraintType) {
		super( constraintType );
	}

	public GenericConstraintDef param(String key, Object value) {
		addParameter( key, value );
		return this;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy