code: public static Boolean toBoolean(Object value) {
          if (value == null) {
              return false;
          } else if (value instanceof Boolean) {
              return (Boolean) value;
          } else if (value instanceof BigDecimal) {
              return value.equals(BigDecimal.ONE);
          } else if (value instanceof Number) {
              return ((Number) value).intValue() == 1;
          } else if (value instanceof Character) {
              char c = (Character) value;
              return c == 't' || c == 'T' || c == 'y' || c == 'Y' || c == '1';
          } else {
              String str = value.toString();
              return str.equalsIgnoreCase("true") || str.equalsIgnoreCase("t")
                      || str.equalsIgnoreCase("yes") || str.equalsIgnoreCase("y")
                      || str.equals("1") || Boolean.parseBoolean(str);
          }
      }
docs: Returns true if the value is any numeric type and has a value of 1, or
  if string type has a value of '1', 't', 'y', 'true' or 'yes'. Otherwise, return false.
  
  @param value value to convert
  @return true if the value is any numeric type and has a value of 1, or
  if string type has a value of '1', 't', 'y', 'true' or 'yes'. Otherwise, return false.