Class FromMatchesFilter

  • All Implemented Interfaces:
    StanzaFilter, Predicate<Stanza>

    public final class FromMatchesFilter
    extends AbstractFromToMatchesFilter
    Filter for packets where the "from" field exactly matches a specified JID. If the specified address is a bare JID then the filter will match any address whose bare JID matches the specified JID. But if the specified address is a full JID then the filter will only match if the sender of the stanza matches the specified resource.
    • Constructor Detail

      • FromMatchesFilter

        public FromMatchesFilter​(Jid address,
                                 boolean ignoreResourcepart)
        Creates a filter matching on the "from" field. The from address must be the same as the filter address. The second parameter specifies whether the full or the bare addresses are compared.
        Parameters:
        address - The address to filter for. If null is given, the stanza must not have a from address.
        ignoreResourcepart - TODO javadoc me please
    • Method Detail

      • create

        public static FromMatchesFilter create​(Jid address)
        Creates a filter matching on the "from" field. If the filter address is bare, compares the filter address with the bare from address. Otherwise, compares the filter address with the full from address.
        Parameters:
        address - The address to filter for. If null is given, the stanza must not have a from address.
        Returns:
        filter for the "from" address.
      • createBare

        public static FromMatchesFilter createBare​(Jid address)
        Creates a filter matching on the "from" field. Compares the bare version of from and filter address.
        Parameters:
        address - The address to filter for. If null is given, the stanza must not have a from address.
        Returns:
        filter matching the "from" address.
      • createFull

        public static FromMatchesFilter createFull​(Jid address)
        Creates a filter matching on the "from" field. Compares the full version, if available, of from and filter address.
        Parameters:
        address - The address to filter for. If null is given, the stanza must not have a from address.
        Returns:
        filter matching the "from" address.