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

package com.google.crypto.tink.proto;

import com.google.protobuf.RuntimeVersion;
import com.google.protobuf.Descriptors;
import com.google.protobuf.Internal;
import com.google.protobuf.ProtocolMessageEnum;

public enum KeyStatusType implements ProtocolMessageEnum
{
    UNKNOWN_STATUS(0), 
    ENABLED(1), 
    DISABLED(2), 
    DESTROYED(3), 
    UNRECOGNIZED(-1);
    
    public static final int UNKNOWN_STATUS_VALUE = 0;
    public static final int ENABLED_VALUE = 1;
    public static final int DISABLED_VALUE = 2;
    public static final int DESTROYED_VALUE = 3;
    private static final Internal.EnumLiteMap<KeyStatusType> internalValueMap;
    private static final KeyStatusType[] VALUES;
    private final int value;
    
    @Override
    public final int getNumber() {
        if (this == KeyStatusType.UNRECOGNIZED) {
            throw new IllegalArgumentException("Can't get the number of an unknown enum value.");
        }
        return this.value;
    }
    
    @Deprecated
    public static KeyStatusType valueOf(final int value) {
        return forNumber(value);
    }
    
    public static KeyStatusType forNumber(final int value) {
        switch (value) {
            case 0: {
                return KeyStatusType.UNKNOWN_STATUS;
            }
            case 1: {
                return KeyStatusType.ENABLED;
            }
            case 2: {
                return KeyStatusType.DISABLED;
            }
            case 3: {
                return KeyStatusType.DESTROYED;
            }
            default: {
                return null;
            }
        }
    }
    
    public static Internal.EnumLiteMap<KeyStatusType> internalGetValueMap() {
        return KeyStatusType.internalValueMap;
    }
    
    @Override
    public final Descriptors.EnumValueDescriptor getValueDescriptor() {
        if (this == KeyStatusType.UNRECOGNIZED) {
            throw new IllegalStateException("Can't get the descriptor of an unrecognized enum value.");
        }
        return getDescriptor().getValues().get(this.ordinal());
    }
    
    @Override
    public final Descriptors.EnumDescriptor getDescriptorForType() {
        return getDescriptor();
    }
    
    public static Descriptors.EnumDescriptor getDescriptor() {
        return Tink.getDescriptor().getEnumTypes().get(0);
    }
    
    public static KeyStatusType valueOf(final Descriptors.EnumValueDescriptor desc) {
        if (desc.getType() != getDescriptor()) {
            throw new IllegalArgumentException("EnumValueDescriptor is not for this type.");
        }
        if (desc.getIndex() == -1) {
            return KeyStatusType.UNRECOGNIZED;
        }
        return KeyStatusType.VALUES[desc.getIndex()];
    }
    
    private KeyStatusType(final int value) {
        this.value = value;
    }
    
    static {
        RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.RuntimeDomain.PUBLIC, 4, 32, 1, "", KeyStatusType.class.getName());
        internalValueMap = new Internal.EnumLiteMap<KeyStatusType>() {
            @Override
            public KeyStatusType findValueByNumber(final int number) {
                return KeyStatusType.forNumber(number);
            }
        };
        VALUES = values();
    }
}
