Top Description Inners Fields Constructors Methods
jnr.netdb

public final Class Protocol

extends Object
Class Inheritance
Imports
java.util.Collection

An entry in the system protocol database

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
Protocol.ProtocolDBSingletonHolder

Holds the global lazily-loaded instance of the ProtocolDB

Field Summary

Modifier and TypeField and Description
private final Collection<String>
aliases

All the aliases for this protocol

private final int
private final String
protocolName

Official protocol name

Constructor Summary

AccessConstructor and Description
pack-priv
Protocol(String name, int proto, Collection<String> aliases)

Method Summary

Modifier and TypeMethod and Description
public final Collection<String>

Returns:

A Collection of Strings for aliases this Protocol
getAliases
()

Returns a list of aliases this Protocol is also known by.

public final String

Returns:

The name of this Protocol as a String
getName
()

Returns the official IANA name of this Protocol

public final int

Returns:

The protocol number for this Protocol as an int
getProto
()

Returns the official IANA protocol number for this Protocol

public static final Protocol

Returns:

a Protocol instance, or null if the protocol could not be found.
getProtocolByName
(String
the official IANA name for the protocol, or an alias.
name
)

Locates a protocol by name.

public static final Protocol

Returns:

a Protocol instance, or null if the protocol could not be found.
getProtocolByNumber
(int
the internet protocol number of the protocol.
proto
)

Locates a protocol by number.

private static final ProtocolsDB

Returns:

an instance of ProtocolDB
getProtocolDB
()

Returns the currently loaded ProtocolDB

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

aliasesback to summary
private final Collection<String> aliases

All the aliases for this protocol

protoback to summary
private final int proto
protocolNameback to summary
private final String protocolName

Official protocol name

Constructor Detail

Protocolback to summary
pack-priv Protocol(String name, int proto, Collection<String> aliases)

Method Detail

getAliasesback to summary
public final Collection<String> getAliases()

Returns a list of aliases this Protocol is also known by.

Returns:Collection<String>

A Collection of Strings for aliases this Protocol

getNameback to summary
public final String getName()

Returns the official IANA name of this Protocol

Returns:String

The name of this Protocol as a String

getProtoback to summary
public final int getProto()

Returns the official IANA protocol number for this Protocol

Returns:int

The protocol number for this Protocol as an int

getProtocolByNameback to summary
public static final Protocol getProtocolByName(String name)

Locates a protocol by name.

Parameters
name:String

the official IANA name for the protocol, or an alias.

Returns:Protocol

a Protocol instance, or null if the protocol could not be found.

getProtocolByNumberback to summary
public static final Protocol getProtocolByNumber(int proto)

Locates a protocol by number.

Parameters
proto:int

the internet protocol number of the protocol.

Returns:Protocol

a Protocol instance, or null if the protocol could not be found.

getProtocolDBback to summary
private static final ProtocolsDB getProtocolDB()

Returns the currently loaded ProtocolDB

Returns:ProtocolsDB

an instance of ProtocolDB

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
jnr.netdb back to summary

private final Class Protocol.ProtocolDBSingletonHolder

extends Object
Class Inheritance

Holds the global lazily-loaded instance of the ProtocolDB

Field Summary

Modifier and TypeField and Description
pack-priv static final ProtocolsDB

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static final ProtocolsDB
load()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
pack-priv static final ProtocolsDB INSTANCE

Constructor Detail

ProtocolDBSingletonHolderback to summary
private ProtocolDBSingletonHolder()

Method Detail

loadback to summary
private static final ProtocolsDB load()