Class InetAddressSet
- All Implemented Interfaces:
Iterable<String>, Collection<String>, Predicate<InetAddress>, Set<String>
public class InetAddressSet
extends AbstractSet<String>
implements Set<String>, Predicate<InetAddress>
A set of InetAddress patterns.
This is a Set of String patterns that are used to match
a Predicate over InetAddress for containment semantics.
The patterns that may be set are:
- InetAddress
- A single InetAddress either in hostname or address format.
All formats supported by
InetAddressare accepted. Not ethat using hostname matches may force domain lookups. eg. "[::1]", "1.2.3.4", "::ffff:127.0.0.1" - InetAddress/CIDR
- An InetAddress with a integer number of bits to indicate the significant prefix. eg. "192.168.0.0/16" will match from "192.168.0.0" to "192.168.255.255"
- InetAddress-InetAddress
- An inclusive range of InetAddresses. eg. "[a000::1]-[afff::]", "192.168.128.0-192.168.128.255"
- Legacy format
- The legacy format used by
IPAddressMapfor IPv4 only. eg. "10.10.10-14.0-128"
This class is designed to work with IncludeExcludeSet
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static class(package private) static class(package private) static class(package private) static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleaniterator()private InetAddressSet.InetPatternnewInetRange(String pattern) booleanintsize()booleantest(InetAddress address) Methods inherited from class AbstractSet
equals, hashCode, removeAllMethods inherited from class AbstractCollection
addAll, clear, contains, containsAll, isEmpty, retainAll, toArray, toArray, toStringMethods inherited from interface Collection
parallelStream, removeIf, stream
-
Field Details
-
_patterns
-
-
Constructor Details
-
InetAddressSet
public InetAddressSet()
-
-
Method Details
-
add
- Specified by:
addin interfaceCollection<String>- Specified by:
addin interfaceSet<String>- Overrides:
addin classAbstractCollection<String>
-
newInetRange
-
remove
- Specified by:
removein interfaceCollection<String>- Specified by:
removein interfaceSet<String>- Overrides:
removein classAbstractCollection<String>
-
iterator
-
size
public int size()- Specified by:
sizein interfaceCollection<String>- Specified by:
sizein interfaceSet<String>- Specified by:
sizein classAbstractCollection<String>
-
test
- Specified by:
testin interfacePredicate<InetAddress>
-