org.hibernate.validator.cfg.GenericConstraintDef Maven / Gradle / Ivy
/*
* 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;
}
}