Annotation Interface IPAddress


@Documented @Retention(RUNTIME) @Target({METHOD,FIELD,PARAMETER,TYPE_USE}) @Constraint(validatedBy=Validator.class) public @interface IPAddress
Validates that a string looks like an IP address. A string is considered to be a valid IP address if it looks like a dotted quad.
Author:
Donal Fellows
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether the empty string is allowed.
    Message on constraint violated.
    boolean
    Whether null is allowed.
  • Element Details

    • nullOK

      boolean nullOK
      Whether null is allowed. It defaults to being disallowed.
      Returns:
      Whether to accept null.
      Default:
      false
    • emptyOK

      boolean emptyOK
      Whether the empty string is allowed. It defaults to being disallowed.
      Returns:
      Whether to accept the empty string.
      Default:
      false
    • message

      String message
      Message on constraint violated.
      Returns:
      Message
      Default:
      "\'${validatedValue}\' is a bad IPv4 address"