public final class Address
extends java.lang.Object
The implementation of the <address/>
element in the http://jabber.org/protocol/address
namespace.
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.
Addresses
Modifier and Type | Class and Description |
---|---|
static class |
Address.Type
The type of the address.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE
|
Constructor and Description |
---|
Address(Address.Type type,
Jid jid,
java.lang.CharSequence description,
java.lang.CharSequence node,
java.lang.Object... extensions) |
Address(Address.Type type,
Jid jid,
java.lang.CharSequence description,
java.lang.Object... extensions) |
Address(Address.Type type,
Jid jid,
java.lang.Object... extensions) |
Address(Address.Type type,
java.net.URI uri,
java.lang.CharSequence description,
java.lang.Object... extensions) |
Modifier and Type | Method and Description |
---|---|
Address |
delivered()
Creates a copy of this address, which is marked as delivered.
|
java.lang.String |
getDescription()
Gets the description.
|
<T> T |
getExtension(java.lang.Class<T> clazz)
Gets the extension.
|
java.util.List<java.lang.Object> |
getExtensions()
Gets the extensions as unmodifiable list.
|
Jid |
getJid()
Gets the JID.
|
java.lang.String |
getNode()
Gets the node.
|
Address.Type |
getType()
Gets the address type.
|
java.net.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.
|
public static final java.lang.String NAMESPACE
public Address(Address.Type type, Jid jid, java.lang.Object... extensions)
type
- The address type.jid
- Specifies a simple Jabber ID associated with this address.extensions
- The extensions.public Address(Address.Type type, Jid jid, java.lang.CharSequence description, java.lang.Object... extensions)
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.public Address(Address.Type type, Jid jid, java.lang.CharSequence description, java.lang.CharSequence node, java.lang.Object... extensions)
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.public Address(Address.Type type, java.net.URI uri, java.lang.CharSequence description, java.lang.Object... extensions)
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.public final Address.Type getType()
Gets the address type.
public final Jid getJid()
Gets the JID.
public final java.net.URI getUri()
Gets the URI. It specifies an external system address, such as a sip:, sips:, or im: URI.
public final java.lang.String getNode()
Gets the node. It specifies a sub-addressable unit at a particular JID, corresponding to a Service Discovery node.
public final java.lang.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.
public final boolean isDelivered()
Indicates, whether the service has delivered the stanza to this address.
public final Address delivered()
Creates a copy of this address, which is marked as delivered.
public final Address undelivered()
Creates a copy of this address, whose delivered attribute is removed.
public final java.util.List<java.lang.Object> getExtensions()
Gets the extensions as unmodifiable list.
public final <T> T getExtension(java.lang.Class<T> clazz)
Gets the extension.
T
- The extension type.clazz
- The extension class.Copyright © 2014–2019 XMPP.rocks. All rights reserved.