Package jnr.netdb
Class Protocol
- java.lang.Object
-
- jnr.netdb.Protocol
-
public final class Protocol extends Object
An entry in the system protocol database
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<String>
getAliases()
Returns a list of aliases thisProtocol
is also known by.String
getName()
Returns the official IANA name of thisProtocol
int
getProto()
Returns the official IANA protocol number for thisProtocol
static Protocol
getProtocolByName(String name)
Locates a protocol by name.static Protocol
getProtocolByNumber(int proto)
Locates a protocol by number.String
toString()
-
-
-
Method Detail
-
getProtocolByName
public static final Protocol getProtocolByName(String name)
Locates a protocol by name.- Parameters:
name
- the official IANA name for the protocol, or an alias.- Returns:
- a
Protocol
instance, ornull
if the protocol could not be found.
-
getProtocolByNumber
public static final Protocol getProtocolByNumber(int proto)
Locates a protocol by number.- Parameters:
proto
- the internet protocol number of the protocol.- Returns:
- a
Protocol
instance, ornull
if the protocol could not be found.
-
getName
public final String getName()
Returns the official IANA name of thisProtocol
- Returns:
- The name of this
Protocol
as aString
-
getProto
public final int getProto()
Returns the official IANA protocol number for thisProtocol
- Returns:
- The protocol number for this
Protocol
as anint
-
getAliases
public final Collection<String> getAliases()
Returns a list of aliases thisProtocol
is also known by.- Returns:
- A
Collection
of Strings for aliases thisProtocol
-
-