code: public static boolean getOptionalBooleanParameter(Map<String, String> parameters,
                                                        String parameterName,
                                                        boolean defaultValue)
              throws JournalException {
          validateParameters(parameters);
          validateParameterName(parameterName);
  
          String string = parameters.get(parameterName);
          if (string == null) {
              return defaultValue;
          } else if (string.equals(VALUE_FALSE)) {
              return false;
          } else if (string.equals(VALUE_TRUE)) {
              return true;
          } else {
              throw new JournalException("'" + parameterName
                      + "' parameter must be '" + VALUE_FALSE + "'(default) or '"
                      + VALUE_TRUE + "'");
          }
  
      }
docs: Get an optional boolean parameter. If not found, use the default value.
  
  @throws JournalException
  if a value is supplied that is neither "true" nor "false".
  @throws NullPointerException
  if either 'parameters' or 'parameterName' is null.