// 
// Decompiled by Procyon v0.6.0
// 

package com.nimbusds.jose;

import com.nimbusds.jose.util.JSONStringUtils;
import java.util.Objects;
import com.nimbusds.jose.shaded.jcip.Immutable;
import java.io.Serializable;

@Immutable
public final class JOSEObjectType implements Serializable
{
    private static final long serialVersionUID = 1L;
    public static final JOSEObjectType JOSE;
    public static final JOSEObjectType JOSE_JSON;
    public static final JOSEObjectType JWT;
    private final String type;
    
    public JOSEObjectType(final String type) {
        this.type = Objects.requireNonNull(type);
    }
    
    public String getType() {
        return this.type;
    }
    
    @Override
    public int hashCode() {
        return this.type.toLowerCase().hashCode();
    }
    
    @Override
    public boolean equals(final Object object) {
        return object instanceof JOSEObjectType && this.type.equalsIgnoreCase(((JOSEObjectType)object).type);
    }
    
    @Override
    public String toString() {
        return this.type;
    }
    
    public String toJSONString() {
        return JSONStringUtils.toJSONString(this.type);
    }
    
    static {
        JOSE = new JOSEObjectType("JOSE");
        JOSE_JSON = new JOSEObjectType("JOSE+JSON");
        JWT = new JOSEObjectType("JWT");
    }
}
