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

org.kiwiproject.validation.Ipv4Address Maven / Gradle / Ivy

Go to download

Kiwi is a utility library. We really like Google's Guava, and also use Apache Commons. But if they don't have something we need, and we think it is useful, this is where we put it.

There is a newer version: 4.4.0
Show newest version
package org.kiwiproject.validation;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE_USE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

/**
 * The annotated element must have a value that is a valid IPv4 address.
 * 

* See IPv4 on Wikipedia. */ @Documented @Constraint(validatedBy = {Ipv4AddressValidator.class}) @Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE}) @Retention(RUNTIME) public @interface Ipv4Address { String message() default "{org.kiwiproject.validation.Ipv4Address.message}"; Class[] groups() default {}; Class[] payload() default {}; /** * Whether to consider null as valid. The default is false. * * @return true to consider null as valid */ boolean allowNull() default false; }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy