Class Protocol
java.lang.Object
jnr.netdb.Protocol
An entry in the system protocol database
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classHolds the global lazily-loaded instance of the ProtocolDB -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection<String> All the aliases for this protocolprivate final intprivate final StringOfficial protocol name -
Constructor Summary
Constructors -
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.private static final ProtocolsDBReturns the currently loaded ProtocolDBtoString()
-
Field Details
-
protocolName
Official protocol name -
proto
private final int proto -
aliases
All the aliases for this protocol
-
-
Constructor Details
-
Protocol
Protocol(String name, int proto, Collection<String> aliases)
-
-
Method Details
-
getProtocolByName
-
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
-
getProtocolDB
Returns the currently loaded ProtocolDB- Returns:
- an instance of
ProtocolDB
-
toString
-