org.jivesoftware.smack.filter
Class PacketTypeFilter
java.lang.Object
org.jivesoftware.smack.filter.PacketTypeFilter
- All Implemented Interfaces:
- PacketFilter
public class PacketTypeFilter
- extends java.lang.Object
- implements PacketFilter
Filters for packets of a particular type. The type is given as a Class object, so
example types would:
- Message.class
- IQ.class
- Presence.class
- Author:
- Matt Tucker
|
Constructor Summary |
PacketTypeFilter(java.lang.Class packetType)
Creates a new packet type filter that will filter for packets that are the
same type as packetType. |
|
Method Summary |
boolean |
accept(Packet packet)
Tests whether or not the specified packet should pass the filter. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PacketTypeFilter
public PacketTypeFilter(java.lang.Class packetType)
- Creates a new packet type filter that will filter for packets that are the
same type as packetType.
- Parameters:
packetType - the Class type.
accept
public boolean accept(Packet packet)
- Description copied from interface:
PacketFilter
- Tests whether or not the specified packet should pass the filter.
- Specified by:
accept in interface PacketFilter
- Parameters:
packet - the packet to test.
- Returns:
- true if and only if packet passes the filter.
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object