Add "rule of thumb" to StanzaFilter javadoc

This commit is contained in:
Florian Schmaus 2018-08-25 12:55:51 +02:00
parent 24267c532d
commit c0b1fee700
1 changed files with 5 additions and 0 deletions

View File

@ -41,6 +41,11 @@ import org.jivesoftware.smack.packet.Stanza;
* // Create a new stanza collector using the filter we created.
* StanzaCollector myCollector = connection.createStanzaCollector(myFilter);
* </pre>
* <p>
* As a rule of thumb: If you have a predicate method, that is, a method which takes a single Stanza as argument, is pure
* (side effect free) and returns only a boolean, then it is a good indicator that the logic should be put into a
* {@link StanzaFilter} (and be referenced in {@link org.jivesoftware.smack.StanzaListener}).
* </p>
*
* @see org.jivesoftware.smack.StanzaCollector
* @see org.jivesoftware.smack.StanzaListener