code: private String generateKey(String key,
        HashMap<String, String[]>[] queryVariables) {
      StringBuilder newKey = new StringBuilder(key);
      newKey.append(" -");
      for (int q = 0; q < queryVariables.length; q++) {
        if (queryVariables[q] != null && queryVariables[q].size() > 0) {
          for (String name : queryVariables[q].keySet()) {
            newKey.append(" q" + q + ":$" + name + "=");
            if (queryVariables[q].get(name) != null
                && queryVariables[q].get(name).length == 1) {
              newKey.append("'" + queryVariables[q].get(name)[0]
                  .replace("\\", "\\\\").replace(",", "\\,") + "'");
            } else {
              newKey.append("-");
            }
          }
        }
      }
      return newKey.toString();
    }
docs: Generate key.
  
  @param key the key
  @param queryVariables the query variables
  @return the string