public class IPv4Address extends IPAddress<IPv4Address>
Modifier and Type | Field and Description |
---|---|
static IPv4Address |
FULL_MASK |
static IPv4Address |
NO_MASK |
static IPv4Address |
NONE |
Modifier and Type | Method and Description |
---|---|
IPv4Address |
and(IPv4Address other)
Perform a low level AND operation on the bits of two IPAddress> objects
|
IPv4Address |
applyMask(IPv4Address 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(IPv4Address o) |
boolean |
equals(Object obj) |
byte[] |
getBytes() |
int |
getInt() |
IPVersion |
getIpVersion() |
int |
getLength() |
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
|
IPv4Address |
not()
Returns a new IPAddress object with the bits inverted
|
static IPv4Address |
of(byte[] address) |
static IPv4Address |
of(int raw)
construct an IPv4Address from a 32-bit integer value.
|
static IPv4Address |
of(String string)
parse an IPv4Address from the canonical dotted-quad representation
(1.2.3.4).
|
IPv4Address |
or(IPv4Address other)
Perform a low level OR operation on the bits of two IPAddress> objects
|
void |
putTo(com.google.common.hash.PrimitiveSink sink) |
static IPv4Address |
read4Bytes(org.jboss.netty.buffer.ChannelBuffer c) |
String |
toString() |
void |
write4Bytes(org.jboss.netty.buffer.ChannelBuffer c) |
public static final IPv4Address NONE
public static final IPv4Address NO_MASK
public static final IPv4Address FULL_MASK
public IPVersion getIpVersion()
getIpVersion
in class IPAddress<IPv4Address>
public boolean isCidrMask()
IPAddress
isCidrMask
in class IPAddress<IPv4Address>
public int asCidrMaskLength()
IPAddress
asCidrMaskLength
in class IPAddress<IPv4Address>
public boolean isBroadcast()
IPAddress
isBroadcast
in class IPAddress<IPv4Address>
public IPv4Address and(IPv4Address other)
IPAddress
and
in class IPAddress<IPv4Address>
public IPv4Address or(IPv4Address other)
IPAddress
or
in class IPAddress<IPv4Address>
public IPv4Address not()
IPAddress
not
in class IPAddress<IPv4Address>
public static IPv4Address of(byte[] address)
public static IPv4Address of(int raw)
raw
- the IPAdress represented as a 32-bit integer@Nonnull public static IPv4Address of(@Nonnull String string) throws IllegalArgumentException
string
- an IPv4 address in dotted-quad representationNullPointerException
- if string is nullIllegalArgumentException
- if string is not a valid IPv4Addresspublic int getInt()
public byte[] getBytes()
public int getLength()
public void write4Bytes(org.jboss.netty.buffer.ChannelBuffer c)
public static IPv4Address read4Bytes(org.jboss.netty.buffer.ChannelBuffer c)
public IPv4Address applyMask(IPv4Address mask)
public int hashCode()
hashCode
in class IPAddress<IPv4Address>
public boolean equals(Object obj)
equals
in class IPAddress<IPv4Address>
public int compareTo(IPv4Address o)
public void putTo(com.google.common.hash.PrimitiveSink sink)
Copyright © 2014. All rights reserved.