Class StanzaTypeFilter

  • All Implemented Interfaces:
    StanzaFilter, Predicate<Stanza>

    public final class StanzaTypeFilter
    extends java.lang.Object
    implements StanzaFilter
    Filters for Stanzas of a particular type. The type is given as a Class object, so example types would:
    • Message.class
    • IQ.class
    • Presence.class
    • Constructor Detail

      • StanzaTypeFilter

        public StanzaTypeFilter​(java.lang.Class<? extends Stanza> packetType)
        Creates a new stanza type filter that will filter for packets that are the same type as packetType.
        Parameters:
        packetType - the Class type.
    • Method Detail

      • accept

        public boolean accept​(Stanza packet)
        Description copied from interface: StanzaFilter
        Tests whether or not the specified stanza should pass the filter.
        Specified by:
        accept in interface StanzaFilter
        Parameters:
        packet - the stanza to test.
        Returns:
        true if and only if stanza passes the filter.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object