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

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

import org.bouncycastle.asn1.ASN1Integer;
import java.math.BigInteger;

public class UINT8 extends UintBase
{
    private static final BigInteger MAX;
    
    public UINT8(final BigInteger bigInteger) {
        super(bigInteger);
    }
    
    public UINT8(final int n) {
        super(n);
    }
    
    public UINT8(final long n) {
        super(n);
    }
    
    protected UINT8(final ASN1Integer asn1Integer) {
        super(asn1Integer);
    }
    
    public static UINT8 getInstance(final Object o) {
        if (o instanceof UINT8) {
            return (UINT8)o;
        }
        if (o != null) {
            return new UINT8(ASN1Integer.getInstance(o));
        }
        return null;
    }
    
    @Override
    protected void assertLimit() {
        if (this.value.signum() < 0) {
            throw new IllegalArgumentException("value must not be negative");
        }
        if (this.value.compareTo(UINT8.MAX) > 0) {
            throw new IllegalArgumentException("value 0x" + this.value.toString(16) + "  must not exceed 0x" + UINT8.MAX.toString(16));
        }
    }
    
    static {
        MAX = BigInteger.valueOf(255L);
    }
}
