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

de.thksystems.validation.beanvalidation.OneNotEmpty Maven / Gradle / Ivy

Go to download

Commons for persistence, hibernate, xstreams, enterprise, spring, servlets, ...

There is a newer version: 3.9.0
Show newest version
package de.thksystems.validation.beanvalidation;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

/**
 * At least one of the given fields must be non-empty (for strings, collections and arrays) or non-null (for anything else).
 * 
 * @author Thomas Kuhlmann (kuhl025), arvato D1CS, extern 
 */
@Documented
@Constraint(validatedBy = OneNotEmptyValidator.class)
@Target({ TYPE })
@Retention(RUNTIME)
public @interface OneNotEmpty {
	String message() default "At least one field must have a non-empty value.";

	Class[] groups() default {};

	Class[] payload() default {};

	/** Name of the fields. */
	String[] fieldnames();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy