Package org.jivesoftware.smack.filter
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic FromMatchesFilter
Creates a filter matching on the "from" field.static FromMatchesFilter
createBare
(Jid address) Creates a filter matching on the "from" field.static FromMatchesFilter
createFull
(Jid address) Creates a filter matching on the "from" field.static FromMatchesFilter
createStrictChildOf
(BareJid address) protected Jid
getAddressToCompare
(Stanza stanza) Methods inherited from class org.jivesoftware.smack.filter.AbstractFromToMatchesFilter
accept, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.jivesoftware.smack.filter.StanzaFilter
asPredicate, test
-
Field Details
-
MATCH_NO_FROM_SET
-
-
Method Details
-
create
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. Ifnull
is given, the stanza must not have a from address.- Returns:
- filter for the "from" address.
-
createBare
Creates a filter matching on the "from" field. Compares the bare version of from and filter address.- Parameters:
address
- The address to filter for. Ifnull
is given, the stanza must not have a from address.- Returns:
- filter matching the "from" address.
-
createStrictChildOf
-
createFull
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. Ifnull
is given, the stanza must not have a from address.- Returns:
- filter matching the "from" address.
-
getAddressToCompare
- Specified by:
getAddressToCompare
in classAbstractFromToMatchesFilter
-