Java Boolean Value From convertBoolean(String str, boolean defaults)

Here you can find the source of convertBoolean(String str, boolean defaults)

Description

convert Boolean

License

Apache License

Declaration

public static boolean convertBoolean(String str, boolean defaults) 

Method Source Code

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

public class Main {

    public static boolean convertBoolean(String str, boolean defaults) {
        if (str == null) {
            return defaults;
        }/* w  w w  .j ava 2s.com*/
        try {
            return Boolean.parseBoolean(str);
        } catch (Exception e) {
            return defaults;
        }
    }
}

Related

  1. booleanValueWithYN(String string)
  2. convertBoolean(Boolean convertedValue, boolean defaultValue)
  3. convertBoolean(final String value)
  4. convertBoolean(Object o)
  5. convertBoolean(String str)
  6. convertBoolean(String value)
  7. convertBoolean(String value)
  8. convertBoolean2boolean(final Boolean[] pArray)
  9. convertBooleanFromBytes(byte[] byteArray)