inet.ipaddr

Class IPAddressStringParameters

  • java.lang.Object
    • inet.ipaddr.IPAddressStringParameters
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<IPAddressStringParameters>


    public class IPAddressStringParameters
    extends java.lang.Object
    implements java.lang.Cloneable, java.lang.Comparable<IPAddressStringParameters>, java.io.Serializable
    This class allows you to control the validation performed by the class IPAddressString. The IPAddressString class uses a default permissive IPAddressStringParameters instance when you do not specify one. If you wish to use parameters different from the default, then use this class. All instances are immutable and must be constructed with the nested Builder class.
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_ALLOW_LEADING_ZEROS

        public static final boolean DEFAULT_ALLOW_LEADING_ZEROS
        See Also:
        Constant Field Values
      • DEFAULT_ALLOW_PREFIX_LENGTH_LEADING_ZEROS

        public static final boolean DEFAULT_ALLOW_PREFIX_LENGTH_LEADING_ZEROS
        See Also:
        Constant Field Values
      • DEFAULT_ALLOW_UNLIMITED_LEADING_ZEROS

        public static final boolean DEFAULT_ALLOW_UNLIMITED_LEADING_ZEROS
        See Also:
        Constant Field Values
      • DEFAULT_EMPTY_IS_LOOPBACK

        public static final boolean DEFAULT_EMPTY_IS_LOOPBACK
        See Also:
        Constant Field Values
      • DEFAULT_ALLOW_PREFIX_ONLY

        public static final boolean DEFAULT_ALLOW_PREFIX_ONLY
        See Also:
        Constant Field Values
      • DEFAULT_ALLOW_WILDCARDED_SEPARATOR

        public static final boolean DEFAULT_ALLOW_WILDCARDED_SEPARATOR
        See Also:
        Constant Field Values
      • DEFAULT_ALLOW_PREFIX_BEYOND_ADDRESS_SIZE

        public static final boolean DEFAULT_ALLOW_PREFIX_BEYOND_ADDRESS_SIZE
        See Also:
        Constant Field Values
      • allowPrefixOnly

        public final boolean allowPrefixOnly
        Allows addresses like /64 which are only prefix lenths. Such addresses are interpreted as the network mask for the given prefix length.
        See Also:
        DEFAULT_ALLOW_PREFIX_ONLY
      • allowAll

        public final boolean allowAll
        Allows the all-encompassing address *, which represents the network of all IPv4 and IPv6 addresses
        See Also:
        DEFAULT_ALLOW_ALL
      • allowPrefix

        public final boolean allowPrefix
        Allows addresses with prefix length like 1.2.0.0/16 Such as an address is interpreted as a subnet. 1.2.0.0/16 is the subnet of addresses with network prefix 1.2
        See Also:
        DEFAULT_ALLOW_PREFIX
      • allowMask

        public final boolean allowMask
        Allows masks to follow valid addresses, such as 1.2.3.4/255.255.0.0 which has the mask 255.255.0.0

        If the mask is the mask for a network prefix length, this is interpreted as the subnet for that network prefix length. Otherwise the address is simply masked by the mask. For instance, 1.2.3.4/255.0.255.0 is 1.0.3.0, while 1.2.3.4/255.255.0.0 is 1.2.0.0/16.

        See Also:
        allowPrefix, DEFAULT_ALLOW_MASK
    • Constructor Detail

      • IPAddressStringParameters

        public IPAddressStringParameters(boolean allowEmpty,
                                         boolean allowAll,
                                         boolean emptyIsLoopback,
                                         boolean allowPrefix,
                                         boolean allowMask,
                                         boolean allowPrefixOnly,
                                         IPv4AddressStringParameters ipv4Options,
                                         IPv6AddressStringParameters ipv6Options)