io.avaje.validation.constraints.Length Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of avaje-validator-constraints Show documentation
Show all versions of avaje-validator-constraints Show documentation
avaje validator constraint annotations
The newest version!
package io.avaje.validation.constraints;
import java.lang.annotation.*;
import static java.lang.annotation.ElementType.*;
/**
* The annotated string length must be between the specified boundaries (included).
*
* Supported types are:
*
* - {@code CharSequence} (length of character sequence is evaluated)
*
- {@code String} (length of character sequence is evaluated)
*
*/
@Constraint
@Target({METHOD, FIELD, ANNOTATION_TYPE, PARAMETER, TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Repeatable(Length.List.class)
public @interface Length {
String message() default "{avaje.Length.message}";
Class>[] groups() default {};
int min() default 0;
int max() default Integer.MAX_VALUE;
@Target({ElementType.METHOD, ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@interface List {
Length[] value();
}
}