Here you can find the source of toBigInteger(final Integer i)
Parameter | Description |
---|---|
i | the Integer to convert. |
public static BigInteger toBigInteger(final Integer i)
//package com.java2s; /******************************************************************************* * Copyright (c) 2013, 2014, 2015 QPark Consulting S.a r.l. * //from www. ja va 2s .co m * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0. * The Eclipse Public License is available at * http://www.eclipse.org/legal/epl-v10.html. ******************************************************************************/ import java.math.BigInteger; public class Main { /** * Null save convert of a {@link Integer} to a {@link BigInteger}. * * @param i * the {@link Integer} to convert. * @return the {@link BigInteger}. */ public static BigInteger toBigInteger(final Integer i) { if (i != null) { return BigInteger.valueOf(i); } else { return null; } } /** * Null save convert of a {@link Short} to a {@link BigInteger}. * * @param s * the {@link Short} to convert. * @return the {@link BigInteger}. */ public static BigInteger toBigInteger(final Short s) { if (s != null) { return BigInteger.valueOf(s); } else { return null; } } }