
com.avaje.ebean.validation.Length Maven / Gradle / Ivy
The newest version!
package com.avaje.ebean.validation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.avaje.ebean.validation.factory.LengthValidatorFactory;
/**
* Validate the length of a String property.
*
* You can only apply this to String properties.
*
*/
@ValidatorMeta(factory = LengthValidatorFactory.class)
@Target({ ElementType.FIELD, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
public @interface Length {
/**
* The minimum length of a String. Defaults to 0.
*
* Checks that the string length is greater than or equal to min.
*
*/
int min() default 0;
/**
* The maximum length of a String. Defaults to Integer.MAX_VALUE.
*
* Checks that the string length is less than or equal to max.
*
*/
int max() default Integer.MAX_VALUE;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy