@Test public void testIsMulticast() { IpAddress v4Unicast = IpAddress.valueOf("10.0.0.1"); IpAddress v4Multicast = IpAddress.valueOf("224.0.0.1"); IpAddress v6Unicast = IpAddress.valueOf("1000::1"); IpAddress v6Multicast = IpAddress.valueOf("ff02::1"); assertFalse(v4Unicast.isMulticast()); assertTrue(v4Multicast.isMulticast()); assertFalse(v6Unicast.isMulticast()); assertTrue(v6Multicast.isMulticast()); }
public boolean isMulticast() { return isIp4() ? Ip4Prefix.IPV4_MULTICAST_PREFIX.contains(this.getIp4Address()) : Ip6Prefix.IPV6_MULTICAST_PREFIX.contains(this.getIp6Address()); }
IpAddress implements Comparable<IpAddress> { public boolean isMulticast() { return isIp4() ? Ip4Prefix.IPV4_MULTICAST_PREFIX.contains(this.getIp4Address()) : Ip6Prefix.IPV6_MULTICAST_PREFIX.contains(this.getIp6Address()); } }
IpAddress implements Comparable<IpAddress> { public boolean isMulticast() { return isIp4() ? Ip4Prefix.IPV4_MULTICAST_PREFIX.contains(this.getIp4Address()) : Ip6Prefix.IPV6_MULTICAST_PREFIX.contains(this.getIp6Address()); } protected  IpAddress(Version version, byte[] value); }
IpAddress implements Comparable<IpAddress> { public boolean isMulticast() { return isIp4() ? Ip4Prefix.IPV4_MULTICAST_PREFIX.contains(this.getIp4Address()) : Ip6Prefix.IPV6_MULTICAST_PREFIX.contains(this.getIp6Address()); } protected  IpAddress(Version version, byte[] value); Version version(); boolean isIp4(); boolean isIp6(); Ip4Address getIp4Address(); Ip6Address getIp6Address(); byte[] toOctets(); static int byteLength(Version version); static IpAddress valueOf(int value); static IpAddress valueOf(Version version, byte[] value); static IpAddress valueOf(Version version, byte[] value,
                                    int offset); static IpAddress valueOf(InetAddress inetAddress); static IpAddress valueOf(String value); static IpAddress makeMaskPrefix(Version version, int prefixLength); static IpAddress makeMaskedAddress(final IpAddress address,
                                              int prefixLength); boolean isZero(); boolean isSelfAssigned(); boolean isMulticast(); @Override int compareTo(IpAddress o); @Override int hashCode(); @Override boolean equals(Object obj); @Override /* * (non-Javadoc) * The string representation of the IP address: "x.x.x.x" for IPv4 * addresses, or ':' separated string for IPv6 addresses. * * @see java.lang.Object#toString() */ String toString(); IpPrefix toIpPrefix(); }
IpAddress implements Comparable<IpAddress> { public boolean isMulticast() { return isIp4() ? Ip4Prefix.IPV4_MULTICAST_PREFIX.contains(this.getIp4Address()) : Ip6Prefix.IPV6_MULTICAST_PREFIX.contains(this.getIp6Address()); } protected  IpAddress(Version version, byte[] value); Version version(); boolean isIp4(); boolean isIp6(); Ip4Address getIp4Address(); Ip6Address getIp6Address(); byte[] toOctets(); static int byteLength(Version version); static IpAddress valueOf(int value); static IpAddress valueOf(Version version, byte[] value); static IpAddress valueOf(Version version, byte[] value,
                                    int offset); static IpAddress valueOf(InetAddress inetAddress); static IpAddress valueOf(String value); static IpAddress makeMaskPrefix(Version version, int prefixLength); static IpAddress makeMaskedAddress(final IpAddress address,
                                              int prefixLength); boolean isZero(); boolean isSelfAssigned(); boolean isMulticast(); @Override int compareTo(IpAddress o); @Override int hashCode(); @Override boolean equals(Object obj); @Override /* * (non-Javadoc) * The string representation of the IP address: "x.x.x.x" for IPv4 * addresses, or ':' separated string for IPv6 addresses. * * @see java.lang.Object#toString() */ String toString(); IpPrefix toIpPrefix(); static final int INET_BYTE_LENGTH; static final int INET_BIT_LENGTH; static final int INET6_BYTE_LENGTH; static final int INET6_BIT_LENGTH; }