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

package org.bouncycastle.oer.its.etsi102941.basetypes;

import org.bouncycastle.asn1.ASN1Primitive;
import org.bouncycastle.oer.its.ieee1609dot2.basetypes.UINT8;
import org.bouncycastle.asn1.ASN1Integer;
import java.math.BigInteger;
import org.bouncycastle.asn1.ASN1Object;

public class Version extends ASN1Object
{
    private final BigInteger version;
    
    public Version(final BigInteger version) {
        this.version = version;
    }
    
    public Version(final int n) {
        this(BigInteger.valueOf(n));
    }
    
    public Version(final long val) {
        this(BigInteger.valueOf(val));
    }
    
    protected Version(final ASN1Integer asn1Integer) {
        this.version = asn1Integer.getValue();
    }
    
    public BigInteger getVersion() {
        return this.version;
    }
    
    public static Version getInstance(final Object o) {
        if (o instanceof UINT8) {
            return (Version)o;
        }
        if (o != null) {
            return new Version(ASN1Integer.getInstance(o));
        }
        return null;
    }
    
    @Override
    public ASN1Primitive toASN1Primitive() {
        return new ASN1Integer(this.version);
    }
}
