public final class EthernetType extends CacheableDataType implements Comparable<EthernetType>
All constructors for this class are private. Creating instances of
EthernetType
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 ethernet types is presented in an intuitive order.
Modifier and Type | Field and Description |
---|---|
static EthernetType |
ARP
The instance representing ARP (0x0806).
|
static EthernetType |
BDDP
The instance representing BDDP (0x8999).
|
static EthernetType |
IPv4
The instance representing IPv4 (0x0800).
|
static EthernetType |
IPv6
The instance representing IPv6 (0x86dd).
|
static int |
LENGTH_IN_BYTES
Length of an Ethernet type when encoded as a byte array.
|
static EthernetType |
LLDP
The instance representing LLDP (0x88cc).
|
static EthernetType |
MPLS_M
The instance representing MPLS (multicast) (0x8848).
|
static EthernetType |
MPLS_U
The instance representing MPLS (unicast) (0x8847).
|
static EthernetType |
PBB
The instance representing PBB (0x88e7).
|
static EthernetType |
PRV_BRDG
The instance representing PRV_BRDG (0x88a8).
|
static EthernetType |
RARP
The instance representing RARP (0x8035).
|
static EthernetType |
SNMP
The instance representing SNMP (0x814c).
|
static EthernetType |
VLAN
The instance representing VLAN (0x8100).
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(EthernetType o)
Implements the Comparable interface, to return Ethernet types in
natural order.
|
boolean |
equals(Object o) |
String |
getName()
Returns the descriptive name of the Ethernet type.
|
int |
getNumber()
Returns the Ethernet type number.
|
String |
getShortName()
Returns the short name of the Ethernet type.
|
int |
hashCode() |
boolean |
isUnknown()
Returns true if the ethernet type number is not one of the "named"
Ethernet types.
|
String |
toString()
Returns a string describing the Ethernet type.
|
static EthernetType |
valueOf(int typeNumber)
Returns an object that represents the value of the Ethernet type
identified by the specified number.
|
static EthernetType |
valueOf(String value)
Returns an object that represents the value of the Ethernet type
identified by the specified string.
|
getRefQ, keyFromBytes
public static final int LENGTH_IN_BYTES
public static final EthernetType IPv4
public static final EthernetType ARP
public static final EthernetType RARP
public static final EthernetType VLAN
public static final EthernetType SNMP
public static final EthernetType IPv6
public static final EthernetType MPLS_U
public static final EthernetType MPLS_M
public static final EthernetType PRV_BRDG
public static final EthernetType LLDP
public static final EthernetType PBB
public static final EthernetType BDDP
public String toString()
public String getName()
public String getShortName()
public int getNumber()
public boolean isUnknown()
public int compareTo(EthernetType o)
compareTo
in interface Comparable<EthernetType>
o
- the other Ethernet type instanceComparable.compareTo(T)
public static EthernetType valueOf(String value)
EthernetType arp = EthernetType.valueOf("arp"); String s = arp.getName(); // "ARP : Address Resolution Protocol" EthernetType arpAlso = EthernetType.valueOf(s); assert arpAlso.equals(arp);
value
- the Ethernet type identifierpublic static EthernetType valueOf(int typeNumber)
typeNumber
- the Ethernet type numberIllegalArgumentException
- if the parameter is < 0 or > 0xffffCopyright © 2015. All Rights Reserved.