@Test public void serializeSimple() { RestParameterBindings map = new RestParameterBindings(); map.put(HttpMethod.GET, new QueryParameter("a", 1, null, URL_UTILS)); String serialized = serializer.serialize(map); assertEquals("{\"GET\":[{\"type\": \"QUERY\", \"key\": \"a\", \"value\": \"1\"}]}", serialized); }
public String serialize(RestParameterBindings parameterBindings) { StringBuilder result = new StringBuilder("{"); for (Entry<HttpMethod, Set<HttpParameter>> entry : parameterBindings.entrySet()) { serializeValues(result, entry.getKey(), entry.getValue()); } if (!parameterBindings.isEmpty()) { result.deleteCharAt(result.length() - 1); } result.append("}"); return result.toString(); }
RestParameterBindingsSerializer { public String serialize(RestParameterBindings parameterBindings) { StringBuilder result = new StringBuilder("{"); for (Entry<HttpMethod, Set<HttpParameter>> entry : parameterBindings.entrySet()) { serializeValues(result, entry.getKey(), entry.getValue()); } if (!parameterBindings.isEmpty()) { result.deleteCharAt(result.length() - 1); } result.append("}"); return result.toString(); } }
RestParameterBindingsSerializer { public String serialize(RestParameterBindings parameterBindings) { StringBuilder result = new StringBuilder("{"); for (Entry<HttpMethod, Set<HttpParameter>> entry : parameterBindings.entrySet()) { serializeValues(result, entry.getKey(), entry.getValue()); } if (!parameterBindings.isEmpty()) { result.deleteCharAt(result.length() - 1); } result.append("}"); return result.toString(); } RestParameterBindingsSerializer(); }
RestParameterBindingsSerializer { public String serialize(RestParameterBindings parameterBindings) { StringBuilder result = new StringBuilder("{"); for (Entry<HttpMethod, Set<HttpParameter>> entry : parameterBindings.entrySet()) { serializeValues(result, entry.getKey(), entry.getValue()); } if (!parameterBindings.isEmpty()) { result.deleteCharAt(result.length() - 1); } result.append("}"); return result.toString(); } RestParameterBindingsSerializer(); String serialize(RestParameterBindings parameterBindings); RestParameterBindings deserialize(String encodedParameters); }
RestParameterBindingsSerializer { public String serialize(RestParameterBindings parameterBindings) { StringBuilder result = new StringBuilder("{"); for (Entry<HttpMethod, Set<HttpParameter>> entry : parameterBindings.entrySet()) { serializeValues(result, entry.getKey(), entry.getValue()); } if (!parameterBindings.isEmpty()) { result.deleteCharAt(result.length() - 1); } result.append("}"); return result.toString(); } RestParameterBindingsSerializer(); String serialize(RestParameterBindings parameterBindings); RestParameterBindings deserialize(String encodedParameters);  }