Java Null Value Convert null2Boolean(Object s)

Here you can find the source of null2Boolean(Object s)

Description

null Boolean

License

Apache License

Declaration

public static boolean null2Boolean(Object s) 

Method Source Code

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

public class Main {

    public static boolean null2Boolean(Object s) {
        boolean v = false;
        if (s != null)
            try {
                v = Boolean.parseBoolean(s.toString());
            } catch (Exception localException) {
            }//from  ww  w. ja v a2  s  . com
        return v;
    }
}

Related

  1. convertNullToString(final String str)
  2. convertNullValue(final Class convertType)
  3. null2blank(String prnStr)
  4. null2blank(String source)
  5. null2Boolean(Object expression, boolean defValue)
  6. null2default(final String str, final String def)
  7. null2dots(Object s)
  8. null2Double(Object s)
  9. null2Double(Object s, double defValue)