Java Object to Boolean castBoolean(Object inObject)

Here you can find the source of castBoolean(Object inObject)

Description

cast Boolean

License

Open Source License

Declaration

public static Boolean castBoolean(Object inObject) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static Boolean castBoolean(Object inObject) {

        return castBoolean(inObject, null);
    }//from   w ww.ja  v a2s. c om

    public static Boolean castBoolean(Object inObject, Boolean inDefault) {

        try {

            return (Boolean) inObject;

        } catch (final Exception e) {
            return inDefault;
        }
    }
}

Related

  1. asBoolean(Object obj)
  2. asBoolean(Object object)
  3. asBoolean(Object value)
  4. asBoolean(Object value)
  5. asBoolean(Object value)
  6. castBoolean(Object o)
  7. castBoolean(Object o)
  8. castBoolean(Object o, boolean defaultValue)
  9. castBoolean(Object obj)