forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathListServicesCmdImpl.java
More file actions
48 lines (39 loc) · 1.29 KB
/
Copy pathListServicesCmdImpl.java
File metadata and controls
48 lines (39 loc) · 1.29 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.github.dockerjava.core.command;
import com.github.dockerjava.api.command.ListServicesCmd;
import com.github.dockerjava.api.model.Service;
import com.github.dockerjava.core.util.FiltersBuilder;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* List services.
*/
public class ListServicesCmdImpl extends AbstrDockerCmd<ListServicesCmd, List<Service>> implements
ListServicesCmd {
private FiltersBuilder filters = new FiltersBuilder();
public ListServicesCmdImpl(Exec exec) {
super(exec);
}
@Override
public Map<String, List<String>> getFilters() {
return filters.build();
}
@Override
public ListServicesCmd withIdFilter(List<String> ids) {
Objects.requireNonNull(ids, "ids was not specified");
this.filters.withFilter("id", ids);
return this;
}
@Override
public ListServicesCmd withNameFilter(List<String> names) {
Objects.requireNonNull(names, "names was not specified");
this.filters.withFilter("name", names);
return this;
}
@Override
public ListServicesCmd withLabelFilter(Map<String, String> labels) {
Objects.requireNonNull(labels, "labels was not specified");
this.filters.withLabels(labels);
return this;
}
}