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<? extends Packet> packetType)
Creates a new packet type filter that will filter for packets that are the
same type as packetType. |
PacketTypeFilter
public PacketTypeFilter(Class<? extends Packet> 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 String toString()
- Overrides:
toString
in class Object
Copyright © 2003-2007 Jive Software.