Package jnr.netdb
Class Protocol
java.lang.Object
jnr.netdb.Protocol
An entry in the system protocol database
-
Method Summary
Modifier and TypeMethodDescriptionfinal Collection
<String> Returns a list of aliases thisProtocol
is also known by.final String
getName()
Returns the official IANA name of thisProtocol
final int
getProto()
Returns the official IANA protocol number for thisProtocol
static final Protocol
getProtocolByName
(String name) Locates a protocol by name.static final Protocol
getProtocolByNumber
(int proto) Locates a protocol by number.toString()
-
Method Details
-
getProtocolByName
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
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
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
Returns a list of aliases thisProtocol
is also known by.- Returns:
- A
Collection
of Strings for aliases thisProtocol
-
toString
-