public static <K, V> MultivaluedTreeMap<K, V> clone(MultivaluedMap<K, V> src) { MultivaluedTreeMap<K, V> clone = new MultivaluedTreeMap<K, V>(); copy(src, clone); return clone; }
public MultivaluedTreeMap<K, V> clone() { return clone(this); }
private List<V> getOrCreate(K key) { List<V> list = this.get(key); if (list == null) { list = createValueList(key); this.put(key, list); } return list; }
protected static MultivaluedMap<String, ?> stringifyHeaders(MultivaluedMap<String, ?> headers) MultivaluedMap<String, Object> holders = new MultivaluedTreeMap<String, Object>(); for (Iterator<String> it1 = headers.keySet().iterator(); it1.hasNext(); )
@Override public boolean equalsIgnoreValueOrder(MultivaluedMap<K, V> omap) { if (this == omap) { return true; } if (!keySet().equals(omap.keySet())) { return false; } for (Map.Entry<K, List<V>> e : entrySet()) { List<V> olist = omap.get(e.getKey()); if (e.getValue().size() != olist.size()) { return false; } for (V v : e.getValue()) { if (!olist.contains(v)) { return false; } } } return true; } }
@SuppressWarnings(value = "unchecked") @Override public void addAll(K key, V... newValues) { for (V value : newValues) { add(key, value); } }
public void add(K key, V value) { List<V> list = getOrCreate(key); list.add(value); }
protected ClientInvocation(final ClientInvocation clientInvocation) { this.client = clientInvocation.client; this.configuration = new ClientConfiguration(clientInvocation.configuration); this.headers = new ClientRequestHeaders(this.configuration); MultivaluedTreeMap.copy(clientInvocation.headers.getHeaders(), this.headers.headers); this.method = clientInvocation.method; this.entity = clientInvocation.entity; this.entityGenericType = clientInvocation.entityGenericType; this.entityClass = clientInvocation.entityClass; this.entityAnnotations = clientInvocation.entityAnnotations; this.uri = clientInvocation.uri; this.chunked = clientInvocation.chunked; this.tracingLogger = clientInvocation.tracingLogger; }
public V getFirst(K key) { List<V> list = get(key); if (list == null || list.size() == 0) { return null; } return list.get(0); }
protected static MultivaluedMap<String, Object> unstringifyHeaders(MultivaluedMap<String, Object> headers) MultivaluedMap<String, Object> holders = new MultivaluedTreeMap<String, Object>(); for (Iterator<String> it1 = headers.keySet().iterator(); it1.hasNext(); )
private List<V> getOrCreate(K key) { List<V> list = this.get(key); if (list == null) { list = createValueList(key); this.put(key, list); } return list; }
@Override public boolean equalsIgnoreValueOrder(MultivaluedMap<K, V> omap) { if (this == omap) { return true; } if (!keySet().equals(omap.keySet())) { return false; } for (Map.Entry<K, List<V>> e : entrySet()) { List<V> olist = omap.get(e.getKey()); if (e.getValue().size() != olist.size()) { return false; } for (V v : e.getValue()) { if (!olist.contains(v)) { return false; } } } return true; } }
@Override public void addAll(K key, List<V> valueList) { for (V value : valueList) { add(key, value); } }
public void putSingle(K key, V value) { List<V> list = getOrCreate(key); list.clear(); list.add(value); }
public V getFirst(K key) { List<V> list = get(key); if (list == null || list.size() == 0) { return null; } return list.get(0); }
public static <K, V> MultivaluedTreeMap<K, V> clone(MultivaluedMap<K, V> src) { MultivaluedTreeMap<K, V> clone = new MultivaluedTreeMap<K, V>(); copy(src, clone); return clone; }
MediaType.APPLICATION_JSON_TYPE); msgBodyWriter.writeTo(object, object.getClass(), object.getClass(), methodInvoker.getMethodAnnotations(), MediaType.APPLICATION_JSON_TYPE, new MultivaluedTreeMap<String, Object>(), tmpOutputStream); ObjectMapper mapper = new ObjectMapper(); JsonNode targetJson = mapper.readValue(tmpOutputStream.toByteArray(), JsonNode.class);
private List<V> getOrCreate(K key) { List<V> list = this.get(key); if (list == null) { list = createValueList(key); this.put(key, list); } return list; }