forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFiltersEncoder.java
More file actions
30 lines (23 loc) · 801 Bytes
/
Copy pathFiltersEncoder.java
File metadata and controls
30 lines (23 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.github.dockerjava.core.util;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
/**
* JSON Encoder for docker filters.
*
* @author Carlos Sanchez <carlos@apache.org>
*/
public class FiltersEncoder {
private FiltersEncoder() {
}
// This instance MUST NOT be used for domain-specific serialization of the docker-java types
private static final ObjectMapper MAPPER = new ObjectMapper();
public static String jsonEncode(Map<String, List<String>> mapStringListString) {
try {
return MAPPER.writeValueAsString(mapStringListString);
} catch (JsonProcessingException e) {
throw new RuntimeException(e);
}
}
}