Class FromMatchesFilter

java.lang.Object
org.jivesoftware.smack.filter.AbstractFromToMatchesFilter
org.jivesoftware.smack.filter.FromMatchesFilter
All Implemented Interfaces:
Predicate<Stanza>, StanzaFilter

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.
  • Field Details

  • Method Details

    • 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.
    • createStrictChildOf

    • 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.
    • getAddressToCompare

      protected Jid getAddressToCompare(Stanza stanza)
      Specified by:
      getAddressToCompare in class AbstractFromToMatchesFilter