public static Map<String, String> decodeKVHeaderValue(String value) {
      Objects.requireNonNull(value);
      Map<String, String> valueMap = new HashMap<>();
      if (value.isEmpty()) {
        return valueMap;
      }
      for (String kvStr : value.split(DELIM)) {
        if (!kvStr.contains(KV_SEPERATOR)) {
          throw new IllegalArgumentException("Invalid kv header value: " + value);
        }
        String[] kv = kvStr.split(KV_SEPERATOR);
        if (kv.length == 0) {
          throw new IllegalArgumentException("Invalid kv header value: " + value);
        }
        valueMap.put(kv[0], kv[1]);
      }
      if (valueMap.isEmpty()) {
        throw new IllegalArgumentException("Invalid kv header value: " + value);
      }
      return valueMap;
    }
Decode a kv header value.
@param value {@link String} containing the encoded kv values.
@return decoded kv {@link Map}.
ambry-api/src/main/java/com/github/ambry/rest/RestUtils.java