Java Integer Create toInt(Integer i)

Here you can find the source of toInt(Integer i)

Description

Transform an Integer to an int (null will be transformed to 0).

License

Open Source License

Parameter

Parameter Description
i the Integer.

Return

the int.

Declaration

private static int toInt(Integer i) 

Method Source Code

//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;
    }
}

Related

  1. toInt(final String text, final int defaultValue)
  2. toInt(final String value)
  3. toInt(float value)
  4. toInt(int byteSignificance, byte b)
  5. toInt(int[] rgb)
  6. toInt(Integer n)
  7. toInt(long l)
  8. toInt(long l)
  9. toInt(long unsignedInt)