Here you can find the source of toBoolean(double value)
public static boolean toBoolean(double value)
//package com.java2s; //License from project: Apache License public class Main { public static boolean toBoolean(double value) { return value != 0.0; }// ww w .j av a 2 s . c o m public static boolean toBoolean(long value) { return value != 0; } public static boolean toBoolean(int value) { return value != 0; } public static boolean toBoolean(short value) { return value != 0; } public static boolean toBoolean(byte value) { return value != 0; } public static boolean toBoolean(char ch) { return ch != 0; } public static boolean toBoolean(String value) { return value != null && !value.equals("0") && !value.isEmpty(); } }