public class IPv6Address extends IPAddress<IPv6Address>
Modifier and Type | Field and Description |
---|---|
static IPv6Address |
FULL_MASK |
static IPv6Address |
NO_MASK |
static IPv6Address |
NONE |
Modifier and Type | Method and Description |
---|---|
IPv6Address |
and(IPv6Address other)
Perform a low level AND operation on the bits of two IPAddress> objects
|
IPv6Address |
applyMask(IPv6Address mask) |
int |
asCidrMaskLength()
If this IPAddress represents a valid CIDR style netmask (see
isCidrMask()) returns the length of the prefix (the number of "1" bits).
|
int |
compareTo(IPv6Address o) |
boolean |
equals(Object obj) |
byte[] |
getBytes() |
IPVersion |
getIpVersion() |
int |
getLength() |
int |
getUnsignedShortWord(int i) |
int |
getZeroCompressStart()
get the index of the first word where to apply IPv6 zero compression
|
int |
hashCode() |
boolean |
isBroadcast()
Checks if the IPAddress is the global broadcast address
255.255.255.255 in case of IPv4
|
boolean |
isCidrMask()
Checks if this IPAddress represents a valid CIDR style netmask, i.e.,
it has a set of leading "1" bits followed by only "0" bits
|
IPv6Address |
not()
Returns a new IPAddress object with the bits inverted
|
static IPv6Address |
of(byte[] address) |
static IPv6Address |
of(long raw1,
long raw2)
construct an IPv6 adress from two 64 bit integers representing the first and
second 8-byte blocks of the address.
|
static IPv6Address |
of(String string)
parse an IPv6Address from its conventional string representation.
|
IPv6Address |
or(IPv6Address other)
Perform a low level OR operation on the bits of two IPAddress> objects
|
void |
putTo(com.google.common.hash.PrimitiveSink sink) |
static IPv6Address |
read16Bytes(org.jboss.netty.buffer.ChannelBuffer c) |
String |
toString() |
String |
toString(boolean zeroCompression,
boolean leadingZeros) |
void |
write16Bytes(org.jboss.netty.buffer.ChannelBuffer c) |
public static final IPv6Address NONE
public static final IPv6Address NO_MASK
public static final IPv6Address FULL_MASK
public IPVersion getIpVersion()
getIpVersion
in class IPAddress<IPv6Address>
public boolean isCidrMask()
IPAddress
isCidrMask
in class IPAddress<IPv6Address>
public int asCidrMaskLength()
IPAddress
asCidrMaskLength
in class IPAddress<IPv6Address>
public boolean isBroadcast()
IPAddress
isBroadcast
in class IPAddress<IPv6Address>
public IPv6Address and(IPv6Address other)
IPAddress
and
in class IPAddress<IPv6Address>
public IPv6Address or(IPv6Address other)
IPAddress
or
in class IPAddress<IPv6Address>
public IPv6Address not()
IPAddress
not
in class IPAddress<IPv6Address>
public static IPv6Address of(byte[] address)
@Nonnull public static IPv6Address of(@Nonnull String string) throws IllegalArgumentException
Expects up to 8 groups of 16-bit hex words seperated by colons (e.g., 2001:db8:85a3:8d3:1319:8a2e:370:7348).
Supports zero compression (e.g., 2001:db8::7348). Does not currently support embedding a dotted-quad IPv4 address into the IPv6 address (e.g., 2001:db8::192.168.0.1).
string
- a string representation of an IPv6 addressNullPointerException
- if string is nullIllegalArgumentException
- if string is not a valid IPv6Addresspublic static IPv6Address of(long raw1, long raw2)
raw1
- - the first 8 byte block of the addressraw2
- - the second 8 byte block of the addresspublic byte[] getBytes()
public int getLength()
public int getUnsignedShortWord(int i)
public int getZeroCompressStart()
public String toString(boolean zeroCompression, boolean leadingZeros)
public int hashCode()
hashCode
in class IPAddress<IPv6Address>
public boolean equals(Object obj)
equals
in class IPAddress<IPv6Address>
public void write16Bytes(org.jboss.netty.buffer.ChannelBuffer c)
public static IPv6Address read16Bytes(org.jboss.netty.buffer.ChannelBuffer c) throws OFParseError
OFParseError
public IPv6Address applyMask(IPv6Address mask)
public int compareTo(IPv6Address o)
public void putTo(com.google.common.hash.PrimitiveSink sink)
Copyright © 2014. All rights reserved.