Package jnr.netdb
Class Protocol
- java.lang.Object
-
- jnr.netdb.Protocol
-
public final class Protocol extends java.lang.ObjectAn entry in the system protocol database
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<java.lang.String>getAliases()Returns a list of aliases thisProtocolis also known by.java.lang.StringgetName()Returns the official IANA name of thisProtocolintgetProto()Returns the official IANA protocol number for thisProtocolstatic ProtocolgetProtocolByName(java.lang.String name)Locates a protocol by name.static ProtocolgetProtocolByNumber(int proto)Locates a protocol by number.java.lang.StringtoString()
-
-
-
Method Detail
-
getProtocolByName
public static final Protocol getProtocolByName(java.lang.String name)
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
public static final Protocol getProtocolByNumber(int proto)
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
public final java.lang.String 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
public final java.util.Collection<java.lang.String> getAliases()
Returns a list of aliases thisProtocolis also known by.- Returns:
- A
Collectionof Strings for aliases thisProtocol
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-