public final class Ip4AddressToken extends Object implements ScalarToken, Comparable<Ip4AddressToken>
Ip4AddressValued object.| Modifier and Type | Field and Description |
|---|---|
static Ip4AddressToken |
NULL
A null valued
Ip4AddressToken |
static Ip4AddressToken |
ZERO
A zero valued
Ip4AddressToken |
static byte[] |
ZERO_VALUE
The byte array representing the 0.0.0.0 ip address, the empty
byte[4]. |
| Constructor and Description |
|---|
Ip4AddressToken(byte[] value)
Constructs a new token with the given
non-null ip4 value.
|
Ip4AddressToken(Ip4AddressValued value)
Constructs a new token with the ip4 address
value in the given container.
|
Ip4AddressToken(String value)
Constructs a
Ip4AddressToken with the non-null
ip4 address value encoded by the given string. |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
asAddress()
Gets the contained raw IPv4 address value.
|
Inet4Address |
asInet4Address()
Gets the contained IP address as an Inet4Address.
|
int |
compareTo(Ip4AddressToken that) |
boolean |
equals(Object obj)
Indicates whether another object is equal to this token.
|
ScalarTokenType |
getType()
Gets the data type of the token.
|
int |
hashCode()
Returns a hash code for the token.
|
boolean |
isNull()
Indicates whether the token is null valued.
|
boolean |
isZero()
Indicates whether the value is the zero value
for the type.
|
static Ip4AddressToken |
parse(String value)
Converts a string representation of a ip4 address value into
a token.
|
boolean |
represents(byte[] otherData)
A 'deep equals' comparison of this token's contents to the provided raw ip4 bytes.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetType, isZeroisNullpublic static final Ip4AddressToken NULL
Ip4AddressTokenpublic static final byte[] ZERO_VALUE
byte[4].public static final Ip4AddressToken ZERO
Ip4AddressTokenpublic Ip4AddressToken(Ip4AddressValued value)
value - a Ip4AddressValued containing the
desired valuepublic Ip4AddressToken(byte[] value)
NULL.value - the ip4 address value of the token.
A copy of the array will be made.NullPointerException - if the supplied array
is nullpublic Ip4AddressToken(String value)
Ip4AddressToken with the non-null
ip4 address value encoded by the given string.
Should be in form #.#.#.#
If a null valued token is desired, use NULL.value - a string representing the ip4 valueNullPointerException - if the supplied hexadecimal
string is nullpublic int compareTo(Ip4AddressToken that)
compareTo in interface Comparable<Ip4AddressToken>public boolean equals(Object obj)
DataTokenTokenComparator.equal(TokenValued,TokenValued)
but makes it possible to store DataTokens in Maps.public boolean represents(byte[] otherData)
otherData - the object that we're comparing topublic int hashCode()
DataTokenTokenConverter.asHashCode(TokenValued).public static Ip4AddressToken parse(String value)
value - a string representing an ip4 addresspublic final ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final byte[] asAddress()
Ip4AddressValuedasAddress in interface Ip4AddressValuedbyte[4]. If null valued,
as indicated by TokenValued.isNull(), null
is returned.public final Inet4Address asInet4Address()
Ip4AddressValuedasInet4Address in interface Ip4AddressValuedInet4Address. If null valued,
as indicated by TokenValued.isNull(), null
is returned.public final boolean isZero()
ScalarValuedisZero in interface ScalarValuedtrue if the value is the zero value,
false otherwise.public final boolean isNull()
TokenValuedisNull in interface TokenValuedtrue if the token is null valued,
false otherwiseCopyright © 2019 Actian Corporation. All rights reserved.