Enum Constant and Description |
---|
EGP |
GGP |
ICMP |
IGMP |
IP |
TCP |
UDP |
UNKNOWN |
Modifier and Type | Method and Description |
---|---|
int |
code()
Returns the protocol code.
|
static Protocol |
get(int code)
Gets a protocol by its code.
|
static String |
toString(int code)
Returns a string for the protocol code.
|
static Protocol |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Protocol[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Protocol IP
public static final Protocol ICMP
public static final Protocol IGMP
public static final Protocol GGP
public static final Protocol TCP
public static final Protocol EGP
public static final Protocol UDP
public static final Protocol UNKNOWN
public static Protocol[] values()
for (Protocol c : Protocol.values()) System.out.println(c);
public static Protocol valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null@Nonnull @CheckReturnValue public static Protocol get(int code)
code
- The protocol code.@Nonnull @CheckReturnValue public static String toString(int code)
code
- The protocol code.@CheckReturnValue public int code()
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.