Here you can find the source of toBoolean(final Boolean bool)
Parameter | Description |
---|---|
bool | a parameter |
public static boolean toBoolean(final Boolean bool)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j a va 2 s . c om * Method to convert Boolean object to boolean primitive * * @param bool * @return {@link boolean} */ public static boolean toBoolean(final Boolean bool) { return bool != null && bool.booleanValue(); } /** * Method to convert int to boolean * * @param val * @return {@link boolean} */ public static boolean toBoolean(final int val) { return val != 0; } }