Java Boolean From toBoolean(Object value)

Here you can find the source of toBoolean(Object value)

Description

to Boolean

License

Open Source License

Declaration

public static final boolean toBoolean(Object value) 

Method Source Code

//package com.java2s;

public class Main {
    public static final boolean toBoolean(Object value) {
        if (value instanceof Boolean)
            return ((Boolean) value).booleanValue();
        else if (value == null)
            return false;
        else//from  w  ww . ja  va2  s . c  om
            return Boolean.parseBoolean(value.toString());
    }

    public static final String toString(Object value) {
        if (value == null)
            return null;

        return value.toString();
    }
}

Related

  1. toBoolean(Object s)
  2. toBoolean(Object v)
  3. toBoolean(Object val)
  4. toBoolean(Object val, boolean defValue)
  5. toBoolean(Object value)
  6. toBoolean(Object value)
  7. toBoolean(Object value)
  8. toBoolean(Object value)
  9. toBoolean(Object value)