Class InetAddressSet

  • All Implemented Interfaces:
    java.lang.Iterable<java.lang.String>, java.util.Collection<java.lang.String>, java.util.function.Predicate<>, java.util.Set<java.lang.String>

    public class InetAddressSet
    extends java.util.AbstractSet<java.lang.String>
    implements java.util.Set<java.lang.String>, java.util.function.Predicate<>
    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:

    A single InetAddress either in hostname or address format. All formats supported by InetAddress are accepted. Not ethat using hostname matches may force domain lookups. eg. "[::1]", "", "::ffff:"
    An InetAddress with a integer number of bits to indicate the significant prefix. eg. "" will match from "" to ""
    An inclusive range of InetAddresses. eg. "[a000::1]-[afff::]", ""
    Legacy format
    The legacy format used by IPAddressMap for IPv4 only. eg. "10.10.10-14.0-128"

    This class is designed to work with IncludeExcludeSet

    See Also:
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean add​(java.lang.String pattern)  
      java.util.Iterator<java.lang.String> iterator()  
      boolean remove​(java.lang.Object pattern)  
      int size()  
      boolean test​( address)  
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        addAll, clear, contains, containsAll, isEmpty, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

      • Methods inherited from interface java.util.function.Predicate

        and, negate, or
      • Methods inherited from interface java.util.Set

        addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, spliterator, toArray, toArray
    • Constructor Detail

      • InetAddressSet

        public InetAddressSet()
    • Method Detail

      • add

        public boolean add​(java.lang.String pattern)
        Specified by:
        add in interface java.util.Collection<java.lang.String>
        Specified by:
        add in interface java.util.Set<java.lang.String>
        add in class java.util.AbstractCollection<java.lang.String>
      • remove

        public boolean remove​(java.lang.Object pattern)
        Specified by:
        remove in interface java.util.Collection<java.lang.String>
        Specified by:
        remove in interface java.util.Set<java.lang.String>
        remove in class java.util.AbstractCollection<java.lang.String>
      • iterator

        public java.util.Iterator<java.lang.String> iterator()
        Specified by:
        iterator in interface java.util.Collection<java.lang.String>
        Specified by:
        iterator in interface java.lang.Iterable<java.lang.String>
        Specified by:
        iterator in interface java.util.Set<java.lang.String>
        Specified by:
        iterator in class java.util.AbstractCollection<java.lang.String>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.lang.String>
        Specified by:
        size in interface java.util.Set<java.lang.String>
        Specified by:
        size in class java.util.AbstractCollection<java.lang.String>
      • test

        public boolean test​( address)
        Specified by:
        test in interface java.util.function.Predicate<>