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

import org.jivesoftware.smack.filter.FlexibleStanzaTypeFilter;
import org.jivesoftware.smack.packet.Presence;
import org.jivesoftware.smack.util.Objects;

public class PresenceTypeFilter
extends FlexibleStanzaTypeFilter<Presence> {
    public static final PresenceTypeFilter AVAILABLE = new PresenceTypeFilter(Presence.Type.available);
    public static final PresenceTypeFilter UNAVAILABLE = new PresenceTypeFilter(Presence.Type.unavailable);
    public static final PresenceTypeFilter SUBSCRIBE = new PresenceTypeFilter(Presence.Type.subscribe);
    public static final PresenceTypeFilter SUBSCRIBED = new PresenceTypeFilter(Presence.Type.subscribed);
    public static final PresenceTypeFilter UNSUBSCRIBE = new PresenceTypeFilter(Presence.Type.unsubscribe);
    public static final PresenceTypeFilter UNSUBSCRIBED = new PresenceTypeFilter(Presence.Type.unsubscribed);
    public static final PresenceTypeFilter ERROR = new PresenceTypeFilter(Presence.Type.error);
    public static final PresenceTypeFilter PROBE = new PresenceTypeFilter(Presence.Type.probe);
    private final Presence.Type type;

    private PresenceTypeFilter(Presence.Type type) {
        super(Presence.class);
        this.type = Objects.requireNonNull(type, "type must not be null");
    }

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

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