package org.jivesoftware.smack.filter;

import org.jivesoftware.smack.packet.Stanza;
import org.jxmpp.jid.Jid;

public class ToFilter implements StanzaFilter {
   private final Jid to;

   public ToFilter(Jid to) {
      this.to = to;
   }

   public boolean accept(Stanza packet) {
      Jid packetTo = packet.getTo();
      return packetTo == null ? false : packetTo.equals((CharSequence)this.to);
   }

   public String toString() {
      return this.getClass().getSimpleName() + ": to=" + this.to;
   }
}
