Here you can find the source of toInt(Integer i)
null
will be transformed to 0
).
Parameter | Description |
---|---|
i | the Integer. |
private static int toInt(Integer i)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w . java2 s. co m * Transform an Integer to an int (<code>null</code> will be transformed to <code>0</code>). * * @param i the Integer. * @return the int. */ private static int toInt(Integer i) { int returnValue = 0; if (i != null) { returnValue = i; } return returnValue; } }