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

import org.jivesoftware.smack.filter.FlexibleStanzaTypeFilter;
import org.jivesoftware.smack.filter.StanzaFilter;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.util.StringUtils;

public class ThreadFilter
extends FlexibleStanzaTypeFilter<Message>
implements StanzaFilter {
    private final String thread;

    public ThreadFilter(String thread) {
        StringUtils.requireNotNullOrEmpty(thread, "Thread must not be null or empty.");
        this.thread = thread;
    }

    @Override
    protected boolean acceptSpecific(Message message) {
        return this.thread.equals(message.getThread());
    }

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