RefAddr (Java SE 11 & JDK 11 ) (original) (raw)
- javax.naming.RefAddr
All Implemented Interfaces:
[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")
Direct Known Subclasses:[BinaryRefAddr](BinaryRefAddr.html "class in javax.naming")
,[StringRefAddr](StringRefAddr.html "class in javax.naming")
public abstract class RefAddr
extends Object
implements Serializable
This class represents the address of a communications end-point. It consists of a type that describes the communication mechanism and an address contents determined by an RefAddr subclass.
For example, an address type could be "BSD Printer Address", which specifies that it is an address to be used with the BSD printing protocol. Its contents could be the machine name identifying the location of the printer server that understands this protocol.
A RefAddr is contained within a Reference.
RefAddr is an abstract class. Concrete implementations of it determine its synchronization properties.
Since:
1.3
See Also:
Reference, LinkRef, StringRefAddr, BinaryRefAddr, Serialized Form
Field Summary
Fields
Modifier and Type Field Description protected String addrType Contains the type of this address. Constructor Summary
Constructors
Modifier Constructor Description protected RefAddr(String addrType) Constructs a new instance of RefAddr using its address type. Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods
Modifier and Type Method Description boolean equals(Object obj) Determines whether obj is equal to this RefAddr. abstract Object getContent() Retrieves the contents of this address. String getType() Retrieves the address type of this address. int hashCode() Computes the hash code of this address using its address type and contents. String toString() Generates the string representation of this address. * ### Methods declared in class java.lang.[Object](../../../java.base/java/lang/Object.html "class in java.lang") `[clone](../../../java.base/java/lang/Object.html#clone%28%29), [finalize](../../../java.base/java/lang/Object.html#finalize%28%29), [getClass](../../../java.base/java/lang/Object.html#getClass%28%29), [notify](../../../java.base/java/lang/Object.html#notify%28%29), [notifyAll](../../../java.base/java/lang/Object.html#notifyAll%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28%29), [wait](../../../java.base/java/lang/Object.html#wait%28long%29), [wait](../../../java.base/java/lang/Object.html#wait%28long,int%29)`
Field Detail
* #### addrType protected [String](../../../java.base/java/lang/String.html "class in java.lang") addrType Contains the type of this address.
Constructor Detail
* #### RefAddr protected RefAddr([String](../../../java.base/java/lang/String.html "class in java.lang") addrType) Constructs a new instance of RefAddr using its address type. Parameters: `addrType` \- A non-null string describing the type of the address.
Method Detail
* #### getType public [String](../../../java.base/java/lang/String.html "class in java.lang") getType() Retrieves the address type of this address. Returns: The non-null address type of this address. * #### getContent public abstract [Object](../../../java.base/java/lang/Object.html "class in java.lang") getContent() Retrieves the contents of this address. Returns: The possibly null address contents. * #### equals public boolean equals([Object](../../../java.base/java/lang/Object.html "class in java.lang") obj) Determines whether obj is equal to this RefAddr. obj is equal to this RefAddr if all of these conditions are true * non-null * instance of RefAddr * obj has the same address type as this RefAddr (using String.compareTo()) * both obj and this RefAddr's contents are null or they are equal (using the equals() test). Overrides: `[equals](../../../java.base/java/lang/Object.html#equals%28java.lang.Object%29)` in class `[Object](../../../java.base/java/lang/Object.html "class in java.lang")` Parameters: `obj` \- possibly null obj to check. Returns: true if obj is equal to this refaddr; false otherwise. See Also: [getContent()](#getContent%28%29), [getType()](#getType%28%29) * #### hashCode public int hashCode() Computes the hash code of this address using its address type and contents. The hash code is the sum of the hash code of the address type and the hash code of the address contents. Overrides: `[hashCode](../../../java.base/java/lang/Object.html#hashCode%28%29)` in class `[Object](../../../java.base/java/lang/Object.html "class in java.lang")` Returns: The hash code of this address as an int. See Also: [Object.hashCode()](../../../java.base/java/lang/Object.html#hashCode%28%29) * #### toString public [String](../../../java.base/java/lang/String.html "class in java.lang") toString() Generates the string representation of this address. The string consists of the address's type and contents with labels. This representation is intended for display only and not to be parsed. Overrides: `[toString](../../../java.base/java/lang/Object.html#toString%28%29)` in class `[Object](../../../java.base/java/lang/Object.html "class in java.lang")` Returns: The non-null string representation of this address.
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2025, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.