Exemple #1
0
  public static String getString(
      ManageableThread thread, String parameter, boolean mandatory, String defaultValue)
      throws AppException {
    if (mandatory) {
      return thread.loadMandatory(parameter);
    } else {
      Object value = thread.getParameter(parameter);

      return (value == null) ? defaultValue : (String) value;
    }
  }
Exemple #2
0
  public static Boolean getBoolean(ManageableThread thread, String parameter, boolean defaultValue)
      throws AppException {
    Object objValue = thread.getParameter(parameter);

    if (objValue == null) {
      return defaultValue;
    }

    String value = (String) objValue;

    value = value.toUpperCase();

    return (value == null) ? defaultValue : value.equals("YES") || value.equals("Y");
  }