@Test public void testVersion() { IpAddress ipAddress; ipAddress = IpAddress.valueOf("0.0.0.0"); assertThat(ipAddress.version(), is(IpAddress.Version.INET)); ipAddress = IpAddress.valueOf("::"); assertThat(ipAddress.version(), is(IpAddress.Version.INET6)); }
public Version version() { return this.version; }
IpAddress implements Comparable<IpAddress> { public Version version() { return this.version; } }
IpAddress implements Comparable<IpAddress> { public Version version() { return this.version; } protected  IpAddress(Version version, byte[] value); }
IpAddress implements Comparable<IpAddress> { public Version version() { return this.version; } 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 Version version() { return this.version; } 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; }