@Test public void testIntersects() { IpWildcard wc1 = IpWildcard.ipWithWildcardMask(Ip.create(0x00b0000aL), Ip.create(0x00FF00FFL).inverted()); IpWildcard wc2 = IpWildcard.ipWithWildcardMask(Ip.create(0x000cd000L), Ip.create(0x0000FF00L).inverted()); assertTrue("wildcards should overlap", wc1.intersects(wc2)); }
public boolean intersects(IpWildcard other) { long differentIpBits = _ip.asLong() ^ other._ip.asLong(); long canDiffer = _wildcardMask | other._wildcardMask; return (differentIpBits & canDiffer) == differentIpBits; }
IpWildcard implements Serializable, Comparable<IpWildcard> { public boolean intersects(IpWildcard other) { long differentIpBits = _ip.asLong() ^ other._ip.asLong(); long canDiffer = _wildcardMask | other._wildcardMask; return (differentIpBits & canDiffer) == differentIpBits; } }
IpWildcard implements Serializable, Comparable<IpWildcard> { public boolean intersects(IpWildcard other) { long differentIpBits = _ip.asLong() ^ other._ip.asLong(); long canDiffer = _wildcardMask | other._wildcardMask; return (differentIpBits & canDiffer) == differentIpBits; } private  IpWildcard(Ip address, long wildcardMask); }
IpWildcard implements Serializable, Comparable<IpWildcard> { public boolean intersects(IpWildcard other) { long differentIpBits = _ip.asLong() ^ other._ip.asLong(); long canDiffer = _wildcardMask | other._wildcardMask; return (differentIpBits & canDiffer) == differentIpBits; } private  IpWildcard(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, Ip wildcardMask); static IpWildcard create(Prefix prefix); static IpWildcard create(Ip ip); @JsonCreator static IpWildcard parse(String str); boolean containsIp(Ip ip); @Override int compareTo(IpWildcard o); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Nonnull Ip getIp(); @Nonnull Ip getWildcardMaskAsIp(); long getWildcardMask(); long getMask(); boolean intersects(IpWildcard other); boolean isPrefix(); boolean subsetOf(IpWildcard other); boolean supersetOf(IpWildcard other); @Nonnull IpWildcardIpSpace toIpSpace(); Prefix toPrefix(); @JsonValue @Override String toString(); }
IpWildcard implements Serializable, Comparable<IpWildcard> { public boolean intersects(IpWildcard other) { long differentIpBits = _ip.asLong() ^ other._ip.asLong(); long canDiffer = _wildcardMask | other._wildcardMask; return (differentIpBits & canDiffer) == differentIpBits; } private  IpWildcard(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, long wildcardMask); static IpWildcard ipWithWildcardMask(Ip address, Ip wildcardMask); static IpWildcard create(Prefix prefix); static IpWildcard create(Ip ip); @JsonCreator static IpWildcard parse(String str); boolean containsIp(Ip ip); @Override int compareTo(IpWildcard o); @Override boolean equals(@Nullable Object o); @Override int hashCode(); @Nonnull Ip getIp(); @Nonnull Ip getWildcardMaskAsIp(); long getWildcardMask(); long getMask(); boolean intersects(IpWildcard other); boolean isPrefix(); boolean subsetOf(IpWildcard other); boolean supersetOf(IpWildcard other); @Nonnull IpWildcardIpSpace toIpSpace(); Prefix toPrefix(); @JsonValue @Override String toString(); static final IpWildcard ANY; }