uk.gov.service.payments.commons.api.validation.MapValueLength Maven / Gradle / Ivy
package uk.gov.service.payments.commons.api.validation;
import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
@Target({FIELD, PARAMETER, ANNOTATION_TYPE})
@Retention(RUNTIME)
@Constraint(validatedBy = MapValueAsStringLengthValidator.class)
public @interface MapValueLength {
String message() default "values must be between {min} and {max}";
Class>[] groups() default { };
Class extends Payload>[] payload() default { };
int min() default 0;
int max() default Integer.MAX_VALUE;
@Target({ FIELD, PARAMETER})
@Retention(RUNTIME)
@interface List {
MapValueLength[] value();
}
}