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
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic FromMatchesFiltercreate(org.jxmpp.jid.Jid address) Creates a filter matching on the "from" field.static FromMatchesFiltercreateBare(org.jxmpp.jid.Jid address) Creates a filter matching on the "from" field.static FromMatchesFiltercreateFull(org.jxmpp.jid.Jid address) Creates a filter matching on the "from" field.static FromMatchesFiltercreateStrictChildOf(org.jxmpp.jid.BareJid address) protected org.jxmpp.jid.JidgetAddressToCompare(Stanza stanza) Methods inherited from class org.jivesoftware.smack.filter.AbstractFromToMatchesFilter
accept, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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. Ifnullis 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. Ifnullis 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. Ifnullis given, the stanza must not have a from address.- Returns:
- filter matching the "from" address.
-
getAddressToCompare
- Specified by:
getAddressToComparein classAbstractFromToMatchesFilter
-