public class Forwarded<S extends org.jivesoftware.smack.packet.Stanza>
extends java.lang.Object
implements org.jivesoftware.smack.packet.ExtensionElement
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ELEMENT |
static java.lang.String |
NAMESPACE |
static javax.xml.namespace.QName |
QNAME |
| Constructor and Description |
|---|
Forwarded(DelayInformation delay,
S forwardedStanza)
Deprecated.
use
Forwarded(Stanza, DelayInformation) instead. |
Forwarded(S fwdPacket)
Creates a new Forwarded stanza extension.
|
Forwarded(S forwardedStanza,
DelayInformation delay)
Creates a new Forwarded stanza extension.
|
| Modifier and Type | Method and Description |
|---|---|
static java.util.List<org.jivesoftware.smack.packet.Message> |
extractMessagesFrom(java.util.Collection<Forwarded<org.jivesoftware.smack.packet.Message>> forwardedCollection)
Extract messages in a collection of forwarded elements.
|
static Forwarded<?> |
from(org.jivesoftware.smack.packet.Stanza packet)
Get the forwarded extension.
|
DelayInformation |
getDelayInformation()
get the timestamp of the forwarded packet.
|
java.lang.String |
getElementName() |
S |
getForwardedStanza()
Get the forwarded Stanza found in this extension.
|
java.lang.String |
getNamespace() |
boolean |
isForwarded(java.lang.Class<? extends org.jivesoftware.smack.packet.Stanza> stanzaClass)
Check if this is forwarding a stanza of the provided class.
|
org.jivesoftware.smack.util.XmlStringBuilder |
toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic static final java.lang.String NAMESPACE
public static final java.lang.String ELEMENT
public static final javax.xml.namespace.QName QNAME
@Deprecated public Forwarded(DelayInformation delay, S forwardedStanza)
Forwarded(Stanza, DelayInformation) instead.delay - an optional DelayInformation timestamp of the packet.forwardedStanza - the stanza that is forwarded (required).public Forwarded(S fwdPacket)
fwdPacket - the stanza that is forwarded (required).public Forwarded(S forwardedStanza, DelayInformation delay)
forwardedStanza - the stanza that is forwarded (required).delay - an optional DelayInformation timestamp of the packet.public java.lang.String getElementName()
getElementName in interface org.jivesoftware.smack.packet.NamedElementpublic java.lang.String getNamespace()
getNamespace in interface org.jivesoftware.smack.packet.FullyQualifiedElementpublic org.jivesoftware.smack.util.XmlStringBuilder toXML(org.jivesoftware.smack.packet.XmlEnvironment enclosingNamespace)
toXML in interface org.jivesoftware.smack.packet.Elementpublic S getForwardedStanza()
Stanza (typically a message) that was forwarded.public DelayInformation getDelayInformation()
DelayInformation representing the time when the original stanza was sent. May be null.public boolean isForwarded(java.lang.Class<? extends org.jivesoftware.smack.packet.Stanza> stanzaClass)
stanzaClass - the class to check for.true if this is forwarding a stanza of the provided class.public static Forwarded<?> from(org.jivesoftware.smack.packet.Stanza packet)
packet - TODO javadoc me pleasepublic static java.util.List<org.jivesoftware.smack.packet.Message> extractMessagesFrom(java.util.Collection<Forwarded<org.jivesoftware.smack.packet.Message>> forwardedCollection)
Forwarded in
the given collection only contain Message stanzas.forwardedCollection - the collection to extract from.