Exemple #1
0
 public Object getAttachment(String key) {
   if (StringUtil.isEmpty(key)) {
     return null;
   }
   if (attachments == null) {
     return null;
   } else {
     return attachments.get(key);
   }
 }
Exemple #2
0
  /**
   * Grain the request string array parameter by key
   *
   * @param key request parameter
   * @param split split string
   * @return string array by split the value that get by key
   */
  public String[] getParameterStringArray(String key, String split) {
    String value = getParameter(key);
    if (StringUtil.isEmpty(value)) {
      throw new IllegalArgumentException(
          "The parameter ["
              + key
              + "] 's value should not be null, interface should be contain the value.");
    }

    String[] values = value.split(split);
    return values;
  }
Exemple #3
0
  /**
   * Get the request parameter value by key
   *
   * @param key the request parameter key
   * @return the request parameter value
   */
  @Override
  public String getParameter(String key) {
    if (StringUtil.isEmpty(key)) {
      throw new IllegalArgumentException("Argument should not be null or empty.");
    }

    List<String> value = getParameters().get(key);
    if (value == null) {
      return null;
    }

    return value.get(0);
  }