1 20 21 package org.jivesoftware.smack.filter; 22 23 import org.jivesoftware.smack.packet.Message; 24 import org.jivesoftware.smack.packet.Packet; 25 26 32 public class MessageTypeFilter implements PacketFilter { 33 34 private final Message.Type type; 35 36 41 public MessageTypeFilter(Message.Type type) { 42 this.type = type; 43 } 44 45 public boolean accept(Packet packet) { 46 if (!(packet instanceof Message)) { 47 return false; 48 } 49 else { 50 return ((Message) packet).getType().equals(this.type); 51 } 52 } 53 54 } 55 | Popular Tags |