Class IpWildcard

java.lang.Object
org.batfish.datamodel.IpWildcard
All Implemented Interfaces:
Serializable, Comparable<IpWildcard>

@ParametersAreNonnullByDefault public final class IpWildcard extends Object implements Serializable, Comparable<IpWildcard>
An IP wildcard consisting of a IP address and a wildcard (also expressed as an IP address)
See Also:
  • Field Details

  • Method Details

    • ipWithWildcardMask

      public static IpWildcard ipWithWildcardMask(Ip address, long wildcardMask)
      Return an IpWildcard from the given IP address and wildcardMask.

      Bits that are set in the wildcardMask are "don't care" bits.

    • ipWithWildcardMask

      public static IpWildcard ipWithWildcardMask(Ip address, Ip wildcardMask)
      Return an IpWildcard from the given IP address and wildcardMask.

      Bits that are set in the wildcardMask are "don't care" bits.

      See Also:
    • create

      public static IpWildcard create(Prefix prefix)
    • create

      public static IpWildcard create(Ip ip)
    • parse

      public static IpWildcard parse(String str)
    • containsIp

      public boolean containsIp(Ip ip)
    • compareTo

      public int compareTo(IpWildcard o)
      Specified by:
      compareTo in interface Comparable<IpWildcard>
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getIp

      @Nonnull public Ip getIp()
    • getWildcardMaskAsIp

      @Nonnull public Ip getWildcardMaskAsIp()
    • getWildcardMask

      public long getWildcardMask()
    • getMask

      public long getMask()
    • intersects

      public boolean intersects(IpWildcard other)
      Parameters:
      other - another IpWildcard
      Returns:
      whether the set of IPs matched by this intersects the set of those matched by other.
    • isPrefix

      public boolean isPrefix()
    • subsetOf

      public boolean subsetOf(IpWildcard other)
      Parameters:
      other - another IpWildcard
      Returns:
      whether the set of IPs matched by this is a subset of those matched by other.
    • supersetOf

      public boolean supersetOf(IpWildcard other)
      Parameters:
      other - another IpWildcard
      Returns:
      whether the set of IPs matched by this is a superset of those matched by other.
    • toPrefix

      @Nonnull public Prefix toPrefix()
    • toString

      public String toString()
      Overrides:
      toString in class Object