Class Forwarded<S extends Stanza>

    • Constructor Detail

      • Forwarded

        public Forwarded​(S fwdPacket)
        Creates a new Forwarded stanza extension.
        Parameters:
        fwdPacket - the stanza that is forwarded (required).
      • Forwarded

        public Forwarded​(S forwardedStanza,
                         DelayInformation delay)
        Creates a new Forwarded stanza extension.
        Parameters:
        forwardedStanza - the stanza that is forwarded (required).
        delay - an optional DelayInformation timestamp of the packet.
    • Method Detail

      • getForwardedStanza

        public S getForwardedStanza()
        Get the forwarded Stanza found in this extension.
        Returns:
        the Stanza (typically a message) that was forwarded.
      • isForwarded

        public boolean isForwarded​(java.lang.Class<? extends Stanza> stanzaClass)
        Check if this is forwarding a stanza of the provided class.
        Parameters:
        stanzaClass - the class to check for.
        Returns:
        true if this is forwarding a stanza of the provided class.
        Since:
        4.4
      • from

        public static Forwarded<?> from​(Stanza packet)
        Get the forwarded extension.
        Parameters:
        packet - TODO javadoc me please
        Returns:
        the Forwarded extension or null
      • extractMessagesFrom

        public static java.util.List<MessageextractMessagesFrom​(java.util.Collection<Forwarded<Message>> forwardedCollection)
        Extract messages in a collection of forwarded elements. Note that it is required that the Forwarded in the given collection only contain Message stanzas.
        Parameters:
        forwardedCollection - the collection to extract from.
        Returns:
        a list a the extracted messages.
        Since:
        4.3.0