public final class Ip6AddressToken extends Object implements ScalarToken, Comparable<Ip6AddressToken>
Ip6AddressValued
object.Modifier and Type | Field and Description |
---|---|
static Ip6AddressToken |
NULL
A null valued
Ip6AddressToken |
static Ip6AddressToken |
ZERO
A zero valued
Ip6AddressToken |
static byte[] |
ZERO_VALUE
The byte array representing the 0:0:0:0:0:0:0:0 ip address, the empty
byte[16] . |
Constructor and Description |
---|
Ip6AddressToken(byte[] value)
Constructs a new token with the given
non-null ip6 value.
|
Ip6AddressToken(Ip6AddressValued value)
Constructs a new token with the ip6 address
value in the given container.
|
Ip6AddressToken(String value)
Constructs a
Ip6AddressToken with the non-null
ip6 address value encoded by the given string. |
Modifier and Type | Method and Description |
---|---|
byte[] |
asAddress()
Gets the contained raw IP6 address value.
|
Inet6Address |
asInet6Address()
Gets the contained IP address as an Inet6Address.
|
int |
compareTo(Ip6AddressToken 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 Ip6AddressToken |
parse(String value)
Converts a string representation of a ip6 address value into
a token.
|
boolean |
represents(byte[] otherData)
A 'deep equals' comparison of this token's contents to the provided raw ip6 bytes.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getType, isZero
isNull
public static final Ip6AddressToken NULL
Ip6AddressToken
public static final byte[] ZERO_VALUE
byte[16]
.public static final Ip6AddressToken ZERO
Ip6AddressToken
public Ip6AddressToken(Ip6AddressValued value)
value
- a Ip6AddressValued
containing the
desired valuepublic Ip6AddressToken(byte[] value)
NULL
.value
- the ip6 address value of the token.
A copy of the array will be made.NullPointerException
- if the supplied array
is null
public Ip6AddressToken(String value)
Ip6AddressToken
with the non-null
ip6 address value encoded by the given string.
Should be in form 0:0:0:0:0:0:0:0
If a null valued token is desired, use NULL
.value
- a string representing the ip6 valueNullPointerException
- if the supplied hexadecimal
string is null
public int compareTo(Ip6AddressToken that)
compareTo
in interface Comparable<Ip6AddressToken>
public boolean equals(Object obj)
DataToken
TokenComparator.equal(TokenValued,TokenValued)
but makes it possible to store DataToken
s in Map
s.public boolean represents(byte[] otherData)
otherData
- the object that we're comparing topublic int hashCode()
DataToken
TokenConverter.asHashCode(TokenValued)
.public static Ip6AddressToken parse(String value)
value
- a string representing an ip6 addresspublic final ScalarTokenType getType()
TokenValued
getType
in interface ScalarValued
getType
in interface TokenValued
getType
in interface ScalarTyped
getType
in interface TokenTyped
public final byte[] asAddress()
Ip6AddressValued
asAddress
in interface Ip6AddressValued
byte[16]
. If null valued,
as indicated by TokenValued.isNull()
, null
is returned.public final Inet6Address asInet6Address()
Ip6AddressValued
asInet6Address
in interface Ip6AddressValued
Inet6Address
. If null valued,
as indicated by TokenValued.isNull()
, null
is returned.public final boolean isZero()
ScalarValued
isZero
in interface ScalarValued
true
if the value is the zero value,
false
otherwise.public final boolean isNull()
TokenValued
isNull
in interface TokenValued
true
if the token is null valued,
false
otherwiseCopyright © 2024 Actian Corporation. All rights reserved.