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 thisProtocolis also known by.final StringgetName()Returns the official IANA name of thisProtocolfinal intgetProto()Returns the official IANA protocol number for thisProtocolstatic final ProtocolgetProtocolByName(String name) Locates a protocol by name.static final ProtocolgetProtocolByNumber(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
Protocolinstance, ornullif the protocol could not be found.
-
getProtocolByNumber
Locates a protocol by number.- Parameters:
proto- the internet protocol number of the protocol.- Returns:
- a
Protocolinstance, ornullif the protocol could not be found.
-
getName
Returns the official IANA name of thisProtocol- Returns:
- The name of this
Protocolas aString
-
getProto
public final int getProto()Returns the official IANA protocol number for thisProtocol- Returns:
- The protocol number for this
Protocolas anint
-
getAliases
Returns a list of aliases thisProtocolis also known by.- Returns:
- A
Collectionof Strings for aliases thisProtocol
-
toString
-