org.jivesoftware.smack.filter
Class PacketTypeFilter
java.lang.Object
org.jivesoftware.smack.filter.PacketTypeFilter
- All Implemented Interfaces:
- PacketFilter
public class PacketTypeFilter
- extends 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(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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PacketTypeFilter
public PacketTypeFilter(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.
Copyright © 2003 Jive Software.