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

import org.jivesoftware.smack.filter.FlexibleStanzaTypeFilter;
import org.jivesoftware.smack.filter.OrFilter;
import org.jivesoftware.smack.filter.StanzaFilter;
import org.jivesoftware.smack.packet.Message;

public class MessageTypeFilter
extends FlexibleStanzaTypeFilter<Message> {
    public static final StanzaFilter NORMAL = new MessageTypeFilter(Message.Type.normal);
    public static final StanzaFilter CHAT = new MessageTypeFilter(Message.Type.chat);
    public static final StanzaFilter GROUPCHAT = new MessageTypeFilter(Message.Type.groupchat);
    public static final StanzaFilter HEADLINE = new MessageTypeFilter(Message.Type.headline);
    public static final StanzaFilter ERROR = new MessageTypeFilter(Message.Type.error);
    public static final StanzaFilter NORMAL_OR_CHAT = new OrFilter(NORMAL, CHAT);
    public static final StanzaFilter NORMAL_OR_CHAT_OR_HEADLINE = new OrFilter(NORMAL_OR_CHAT, HEADLINE);
    private final Message.Type type;

    private MessageTypeFilter(Message.Type type) {
        super(Message.class);
        this.type = type;
    }

    @Override
    protected boolean acceptSpecific(Message message) {
        return message.getType() == this.type;
    }

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