Java Boolean Value From convertBoolean(String value)

Here you can find the source of convertBoolean(String value)

Description

convert Boolean

License

Apache License

Declaration

private static Boolean convertBoolean(String value) 

Method Source Code

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

public class Main {
    private static Boolean convertBoolean(String value) {
        if (value == null || "".equals(value.trim())) {
            return null;
        } else if ("true".equalsIgnoreCase(value)) {
            return true;
        } else if ("false".equalsIgnoreCase(value)) {
            return false;
        } else if ("yes".equalsIgnoreCase(value)) {
            return true;
        } else if ("no".equalsIgnoreCase(value)) {
            return false;
        } else if ("show".equalsIgnoreCase(value)) {
            return true;
        } else if ("hide".equalsIgnoreCase(value)) {
            return false;
        } else if ("on".equalsIgnoreCase(value)) {
            return true;
        } else if ("off".equalsIgnoreCase(value)) {
            return false;
        } else if ("y".equalsIgnoreCase(value)) {
            return true;
        } else if ("n".equalsIgnoreCase(value)) {
            return false;
        }/*from  www . j  a v  a 2 s  .c o  m*/
        return null;
    }
}

Related

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