public class PacketTypeFilter extends java.lang.Object implements PacketFilter
Modifier and Type | Field and Description |
---|---|
static PacketTypeFilter |
MESSAGE |
static PacketTypeFilter |
PRESENCE |
Constructor and Description |
---|
PacketTypeFilter(java.lang.Class<? extends Packet> packetType)
Creates a new packet type filter that will filter for packets that are the
same type as packetType.
|
public static final PacketTypeFilter PRESENCE
public static final PacketTypeFilter MESSAGE
public PacketTypeFilter(java.lang.Class<? extends Packet> packetType)
packetType
- the Class type.public boolean accept(Packet packet)
PacketFilter
accept
in interface PacketFilter
packet
- the packet to test.public java.lang.String toString()
toString
in class java.lang.Object