/*
 * Decompiled with CFR 0.152.
 */
package org.jivesoftware.smack.filter;

import org.jivesoftware.smack.filter.StanzaFilter;
import org.jivesoftware.smack.packet.Stanza;
import org.jivesoftware.smack.util.StringUtils;

@Deprecated
public class PacketIDFilter
implements StanzaFilter {
    private final String packetID;

    @Deprecated
    public PacketIDFilter(Stanza packet) {
        this(packet.getStanzaId());
    }

    @Deprecated
    public PacketIDFilter(String packetID) {
        StringUtils.requireNotNullOrEmpty(packetID, "Packet ID must not be null or empty.");
        this.packetID = packetID;
    }

    @Override
    public boolean accept(Stanza packet) {
        return this.packetID.equals(packet.getStanzaId());
    }

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