Java BigInteger Create toBigInteger(Object value)

Here you can find the source of toBigInteger(Object value)

Description

Convert an Object to a BigInteger.

License

Apache License

Declaration

public static BigInteger toBigInteger(Object value) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.math.BigInteger;

public class Main {
    /**//from  www. j  a  v a 2s. co  m
     * Convert an Object to a BigInteger.
     */
    public static BigInteger toBigInteger(Object value) {
        if (value == null)
            return null;
        if (value instanceof BigInteger)
            return (BigInteger) value;
        if (value instanceof String) {
            if ("".equals((String) value))
                return null;
            return new BigInteger((String) value);
        }

        return new BigInteger(value.toString());
    }
}

Related

  1. toBigInteger(int arg)
  2. toBigInteger(int[] x, int bitsPerDigit)
  3. toBigInteger(List integerVector)
  4. toBigInteger(long value)
  5. toBigInteger(Object o)
  6. toBigInteger(UUID uuid)