Class Address
- java.lang.Object
-
- rocks.xmpp.extensions.address.model.Address
-
- All Implemented Interfaces:
Addressable
public final class Address extends Object implements Addressable
The implementation of the<address/>
element in thehttp://jabber.org/protocol/address
namespace.Usage
To create a new address, use one of the public constructors, like:
Address address = new Address(Address.Type.TO, Jid.of("hildjj@jabber.org/Work"), "description");
To mark an address as delivered, create a new immutable address object from an undelivered address:
Address delivered = address.delivered();
This class is immutable.
- See Also:
- XEP-0033: Extended Stanza Addressing,
XML Schema,
Addresses
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Address.Type
The type of the address.
-
Constructor Summary
Constructors Constructor Description Address(Address.Type type, URI uri, CharSequence description, Object... extensions)
Address(Address.Type type, Jid jid, CharSequence description, CharSequence node, Object... extensions)
Address(Address.Type type, Jid jid, CharSequence description, Object... extensions)
Address(Address.Type type, Jid jid, Object... extensions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Address
delivered()
Creates a copy of this address, which is marked as delivered.String
getDescription()
Gets the description.<T> T
getExtension(Class<T> clazz)
Gets the extension.List<Object>
getExtensions()
Gets the extensions as unmodifiable list.Jid
getJid()
Gets the JID.String
getNode()
Gets the node.Address.Type
getType()
Gets the address type.URI
getUri()
Gets the URI.boolean
isDelivered()
Indicates, whether the service has delivered the stanza to this address.Address
undelivered()
Creates a copy of this address, whose delivered attribute is removed.
-
-
-
Field Detail
-
NAMESPACE
public static final String NAMESPACE
http://jabber.org/protocol/address- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Address
public Address(Address.Type type, Jid jid, Object... extensions)
- Parameters:
type
- The address type.jid
- Specifies a simple Jabber ID associated with this address.extensions
- The extensions.
-
Address
public Address(Address.Type type, Jid jid, CharSequence description, Object... extensions)
- Parameters:
type
- The address type.jid
- Specifies a simple Jabber ID associated with this address.description
- Specifies human-readable information for this address. This data may be used by clients to provide richer address-book integration.extensions
- The extensions.
-
Address
public Address(Address.Type type, Jid jid, CharSequence description, CharSequence node, Object... extensions)
- Parameters:
type
- The address type.jid
- Specifies a simple Jabber ID associated with this address.description
- Specifies human-readable information for this address. This data may be used by clients to provide richer address-book integration.node
- Specifies a sub-addressable unit at a particular JID, corresponding to a Service Discovery node.extensions
- The extensions.
-
Address
public Address(Address.Type type, URI uri, CharSequence description, Object... extensions)
- Parameters:
type
- The address type.uri
- Specifies an external system address, such as a sip:, sips:, or im: URI.description
- Specifies human-readable information for this address. This data may be used by clients to provide richer address-book integration.extensions
- The extensions.
-
-
Method Detail
-
getType
public final Address.Type getType()
Gets the address type.- Returns:
- The address type.
- See Also:
- 4.6 'type' attribute
-
getJid
public final Jid getJid()
Gets the JID.- Specified by:
getJid
in interfaceAddressable
- Returns:
- The JID.
- See Also:
- 4.1 'jid' attribute
-
getUri
public final URI getUri()
Gets the URI. It specifies an external system address, such as a sip:, sips:, or im: URI.- Returns:
- The URI.
- See Also:
- 4.2 'uri' attribute
-
getNode
public final String getNode()
Gets the node. It specifies a sub-addressable unit at a particular JID, corresponding to a Service Discovery node.- Returns:
- The node.
- See Also:
- 4.3 'node' attribute
-
getDescription
public final String getDescription()
Gets the description. It specifies human-readable information for this address. This data may be used by clients to provide richer address-book integration.- Returns:
- The description.
- See Also:
- 4.4 'desc' attribute
-
isDelivered
public final boolean isDelivered()
Indicates, whether the service has delivered the stanza to this address.- Returns:
- True, if the service has delivered the stanza to this address.
- See Also:
- 4.5 'delivered' attribute
-
delivered
public final Address delivered()
Creates a copy of this address, which is marked as delivered.- Returns:
- A new address object, marked as delivered.
-
undelivered
public final Address undelivered()
Creates a copy of this address, whose delivered attribute is removed.- Returns:
- A new address object without delivered attribute.
-
getExtensions
public final List<Object> getExtensions()
Gets the extensions as unmodifiable list.- Returns:
- The extensions.
- See Also:
- 4.7 Extensibility
-
getExtension
public final <T> T getExtension(Class<T> clazz)
Gets the extension.- Type Parameters:
T
- The extension type.- Parameters:
clazz
- The extension class.- Returns:
- The extension or null.
- See Also:
- 4.7 Extensibility
-
-