Class Ip6Prefix


  • public final class Ip6Prefix
    extends IpPrefix
    The class representing an IPv6 network address. This class is immutable.
    • Method Detail

      • address

        public Ip6Address address()
        Returns the IPv6 address value of the prefix.
        Overrides:
        address in class IpPrefix
        Returns:
        the IPv6 address value of the prefix
      • valueOf

        public static Ip6Prefix valueOf​(byte[] address,
                                        int prefixLength)
        Converts a byte array and a prefix length into an IPv6 prefix.
        Parameters:
        address - the IPv6 address value stored in network byte order
        prefixLength - the prefix length
        Returns:
        an IPv6 prefix
        Throws:
        java.lang.IllegalArgumentException - if the prefix length value is invalid
      • valueOf

        public static Ip6Prefix valueOf​(Ip6Address address,
                                        int prefixLength)
        Converts an IPv6 address and a prefix length into an IPv6 prefix.
        Parameters:
        address - the IPv6 address
        prefixLength - the prefix length
        Returns:
        an IPv6 prefix
        Throws:
        java.lang.IllegalArgumentException - if the prefix length value is invalid
      • valueOf

        public static Ip6Prefix valueOf​(java.lang.String address)
        Converts a CIDR (slash) notation string (e.g., "1111:2222::/64") into an IPv6 prefix.
        Parameters:
        address - an IP prefix in string form (e.g.,"1111:2222::/64")
        Returns:
        an IPv6 prefix
        Throws:
        java.lang.IllegalArgumentException - if the arguments are invalid