public final class ICMPv6Type extends CacheableDataType implements Comparable<ICMPv6Type>
All constructors for this class are private. Creating instances of
ICMPv6Type
is done via the static methods on the class.
Instances of this class are immutable, making them inherently threadsafe.
This class overrides equals(java.lang.Object)
and hashCode()
so that instances
play nicely with the Collection classes.
This class implements the Comparable
interface to ensure that a
sorted list of types is presented in an intuitive order.
Modifier and Type | Field and Description |
---|---|
static ICMPv6Type |
NBR_ADV
The instance representing Neighbor Advertisement.
|
static ICMPv6Type |
NBR_SOL
The instance representing Neighbor Solicitation.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ICMPv6Type o)
Implements the Comparable interface, to return ICMPv6 message types in
natural order.
|
boolean |
equals(Object o) |
int |
getCode()
Returns the ICMPv6 message type code.
|
String |
getDescription()
Returns the description of the ICMPv6 message type.
|
String |
getName()
Returns the (short) name of the message type.
|
int |
hashCode() |
boolean |
isUnknown()
Returns true if the message type code is not one of the "named"
types.
|
String |
toString()
Returns a string representing the ICMPv6 message type.
|
static ICMPv6Type |
valueOf(int typeCode)
Returns an object that represents the value of the ICMPv6 message type
identified by the specified type code.
|
static ICMPv6Type |
valueOf(String value)
Returns an object that represents the value of the ICMPv6 message type
identified by the specified string.
|
getRefQ, keyFromBytes
public static final ICMPv6Type NBR_SOL
public static final ICMPv6Type NBR_ADV
public String toString()
public String getDescription()
public String getName()
public int getCode()
public boolean isUnknown()
public int compareTo(ICMPv6Type o)
compareTo
in interface Comparable<ICMPv6Type>
o
- the other ICMPv6 message type instanceComparable.compareTo(T)
public static ICMPv6Type valueOf(String value)
ICMPv6Type rs = ICMPv6Type.valueOf("rtr_sol"); String s = rs.getDescription(); // "RTR_SOL : Router Solicitation" ICMPv6Type rsAlso = ICMPv6Type.valueOf(s); assert rsAlso.equals(rs);
value
- the message type identifierpublic static ICMPv6Type valueOf(int typeCode)
typeCode
- the ICMPv6 message type codeIllegalArgumentException
- if the parameter is < 0 or > 255Copyright © 2015. All Rights Reserved.