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

package org.bouncycastle.oer.its.ieee1609dot2;

import org.bouncycastle.util.BigIntegers;
import java.math.BigInteger;
import org.bouncycastle.asn1.ASN1Enumerated;

public class CertificateType extends ASN1Enumerated
{
    public static final CertificateType explicit;
    public static final CertificateType implicit;
    
    public CertificateType(final BigInteger bigInteger) {
        super(bigInteger);
        this.assertValues();
    }
    
    private CertificateType(final ASN1Enumerated asn1Enumerated) {
        this(asn1Enumerated.getValue());
    }
    
    public static CertificateType getInstance(final Object o) {
        if (o instanceof CertificateType) {
            return (CertificateType)o;
        }
        if (o != null) {
            return new CertificateType(ASN1Enumerated.getInstance(o));
        }
        return null;
    }
    
    protected void assertValues() {
        if (this.getValue().compareTo(BigInteger.ZERO) < 0 || this.getValue().compareTo(BigIntegers.ONE) > 0) {
            throw new IllegalArgumentException("invalid enumeration value " + this.getValue());
        }
    }
    
    static {
        explicit = new CertificateType(BigInteger.ZERO);
        implicit = new CertificateType(BigInteger.ONE);
    }
}
