Java Boolean From toBool(Boolean obj)

Here you can find the source of toBool(Boolean obj)

Description

to Bool

License

Apache License

Declaration

public static boolean toBool(Boolean obj) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {

    public static boolean toBool(Long num) {
        if (num == null || num <= 0) {
            return false;
        } else {// ww  w.j a v a2 s.com
            return true;
        }
    }

    public static boolean toBool(Boolean obj) {
        if (obj == null) {
            return false;
        } else {
            return obj;
        }
    }
}

Related

  1. toBool(int[] data, int index)
  2. toBool(long l)
  3. toBool(String bStr)
  4. toBool(String bv)