Here you can find the source of toInteger(boolean bool)
public static int toInteger(boolean bool)
//package com.java2s; //License from project: Mozilla Public License public class Main { public static int toInteger(boolean bool) { return bool ? 1 : 0; }/* w ww . j ava2s .c om*/ public static int toInteger(boolean bool, int trueValue, int falseValue) { return bool ? trueValue : falseValue; } public static int toInteger(Boolean bool, int trueValue, int falseValue, int nullValue) { if (bool == null) { return nullValue; } return bool ? trueValue : falseValue; } }