public final class IPv6Subnet extends Subnet<IPv6Address> implements IPv6Range
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isIPv6Subnet(CharSequence s)
Tests whether or not a
CharSequence is a valid IPv6 subnet. |
static boolean |
isIPv6Subnet(CharSequence s,
int start,
int end)
Tests whether or not a portion of a
CharSequence is a valid IPv6 subnet. |
int |
size()
Returns the number of IP addresses in this IP range.
|
Spliterator<IPv6Address> |
spliterator() |
static Optional<IPv6Subnet> |
tryValueOfIPv6(CharSequence cidrNotation)
Attempts to return an IPv6 subnet represented by a
CharSequence. |
static Optional<IPv6Subnet> |
tryValueOfIPv6(CharSequence cidrNotation,
int start,
int end)
Attempts to return an IPv6 subnet represented by a portion of a
CharSequence. |
static IPv6Subnet |
valueOf(CharSequence cidrNotation)
Returns an IPv6 subnet represented by a CIDR notation.
|
static IPv6Subnet |
valueOf(CharSequence routingPrefix,
int prefixLength)
Returns an IPv6 subnet represented by a routing prefix and a prefix length.
|
static IPv6Subnet |
valueOf(CharSequence cidrNotation,
int start,
int end)
Returns an IPv6 subnet represented by a CIDR notation.
|
static IPv6Subnet |
valueOf(IPv6Address routingPrefix,
int prefixLength)
Returns an IPv6 subnet represented by a routing prefix and a prefix length.
|
from, isSubnet, isSubnet, prefixLength, routingPrefix, to, toString, tryValueOf, tryValueOf, valueOfequals, hashCodeclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, clear, contains, contains, containsAll, equals, forEach, from, hashCode, isEmpty, iterator, remove, removeAll, removeIf, retainAll, to, toArray, toArrayparallelStream, streampublic int size()
IPRangesize in interface IPRange<IPv6Address>size in interface Collection<IPv6Address>public Spliterator<IPv6Address> spliterator()
spliterator in interface Iterable<IPv6Address>spliterator in interface Collection<IPv6Address>public static IPv6Subnet valueOf(CharSequence cidrNotation)
cidrNotation - The CIDR notation representing the IPv6 subnet.NullPointerException - If the given CIDR notation is null.IllegalArgumentException - If the given CIDR notation is invalid.public static IPv6Subnet valueOf(CharSequence cidrNotation, int start, int end)
cidrNotation - The CIDR notation representing the IPv6 subnet.start - The index in the CharSequence where the CIDR notation starts, inclusive.end - The index in the CharSequence where the CIDR notation ends, exclusive.NullPointerException - If the given CIDR notation is null.IndexOutOfBoundsException - If the start index is negative, or if the end index is larger than the length of the CharSequence,
or if the start index is larger than the end index.IllegalArgumentException - If the given CIDR notation is invalid.public static Optional<IPv6Subnet> tryValueOfIPv6(CharSequence cidrNotation)
CharSequence.cidrNotation - The possible CIDR notation representing the IPv6 subnet.Optional with the IPv6 subnet represented by the given CIDR notation,
or Optional.empty() if the given CIDR notation is null or invalid.public static Optional<IPv6Subnet> tryValueOfIPv6(CharSequence cidrNotation, int start, int end)
CharSequence.cidrNotation - The possible CIDR notation representing the IPv6 subnet.start - The index in the CharSequence where the CIDR notation starts, inclusive.end - The index in the CharSequence where the CIDR notation ends, exclusive.Optional with the IPv6 subnet represented by the given CIDR notation,
or Optional.empty() if the given CIDR notation is null or invalid.IndexOutOfBoundsException - If the start index is negative, or if the end index is larger than the length of the CharSequence,
or if the start index is larger than the end index (unless if the CharSequence is null).public static IPv6Subnet valueOf(IPv6Address routingPrefix, int prefixLength)
ffff:ffff:: is valid for prefix length 32, but ffff:ffff::1 is not.routingPrefix - The routing prefix of the IPv6 subnet.prefixLength - The length of the prefix of the IPv6 subnet.NullPointerException - If the given routing prefix is null.IllegalArgumentException - If the given prefix length is not valid for the IP address,
or if the given routing prefix is not the start of the IPv6 subnet of the given prefix length that
contains the routing prefix.public static IPv6Subnet valueOf(CharSequence routingPrefix, int prefixLength)
ffff:ffff:: is valid for prefix length 32, but ffff:ffff::1 is not.routingPrefix - The routing prefix of the IPv6 subnet.prefixLength - The length of the prefix of the IPv6 subnet.NullPointerException - If the given routing prefix is null.IllegalArgumentException - If the given routing prefix does not represent a valid IP address,
or if the given prefix length is not valid for the IP address,
or if the given routing prefix is not the start of the IPv6 subnet of the given prefix length that
contains the routing prefix.valueOf(IPv6Address, int)public static boolean isIPv6Subnet(CharSequence s)
CharSequence is a valid IPv6 subnet.s - The CharSequence to test.true if the CharSequence is a valid IPv6 subnet, or false otherwise.public static boolean isIPv6Subnet(CharSequence s, int start, int end)
CharSequence is a valid IPv6 subnet.s - The CharSequence to test.start - The index in the CharSequence to start checking at, inclusive.end - The index in the CharSequence to end checking at, exclusive.true if the CharSequence is a valid IPv6 subnet, or false otherwise.IndexOutOfBoundsException - If the start index is negative, or if the end index is larger than the length of the CharSequence,
or if the start index is larger than the end index (unless if the CharSequence is null).Copyright © 2019–2023. All rights reserved.