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

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

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

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