NameClassPair (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")

Direct Known Subclasses:

[Binding](Binding.html "class in javax.naming")


public class NameClassPair extends Object implements Serializable

This class represents the object name and class name pair of a binding found in a context.

A context consists of name-to-object bindings. The NameClassPair class represents the name and the class of the bound object. It consists of a name and a string representing the package-qualified class name.

Use subclassing for naming systems that generate contents of a name/class pair dynamically.

A NameClassPair instance is not synchronized against concurrent access by multiple threads. Threads that need to access a NameClassPair concurrently should synchronize amongst themselves and provide the necessary locking.

Since:

1.3

See Also:

Context.list(javax.naming.Name), Serialized Form

Constructors

Constructor Description
NameClassPair​(String name,String className) Constructs an instance of a NameClassPair given its name and class name.
NameClassPair​(String name,String className, boolean isRelative) Constructs an instance of a NameClassPair given its name, class name, and whether it is relative to the listing context.
Modifier and Type Method Description
String getClassName() Retrieves the class name of the object bound to the name of this binding.
String getName() Retrieves the name of this binding.
String getNameInNamespace() Retrieves the full name of this binding.
boolean isRelative() Determines whether the name of this binding is relative to the target context (which is named by the first parameter of the list() method).
void setClassName​(String name) Sets the class name of this binding.
void setName​(String name) Sets the name of this binding.
void setNameInNamespace​(String fullName) Sets the full name of this binding.
void setRelative​(boolean r) Sets whether the name of this binding is relative to the target context (which is named by the first parameter of the list() method).
String toString() Generates the string representation of this name/class pair.