File tree Expand file tree Collapse file tree 4 files changed +34
-0
lines changed
src/main/java/com/github/dockerjava Expand file tree Collapse file tree 4 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import javax .annotation .CheckForNull ;
7
7
8
+ import java .util .Collection ;
8
9
import java .util .List ;
9
10
import java .util .Map ;
10
11
@@ -22,6 +23,13 @@ public interface ListNetworksCmd extends SyncDockerCmd<List<Network>> {
22
23
23
24
ListNetworksCmd withIdFilter (String ... networkId );
24
25
26
+ /**
27
+ * @param filterName
28
+ * @param filterValues
29
+ * - Show only networks where the filter matches the given values
30
+ */
31
+ ListNetworksCmd withFilter (String filterName , Collection <String > filterValues );
32
+
25
33
interface Exec extends DockerCmdSyncExec <ListNetworksCmd , List <Network >> {
26
34
}
27
35
}
Original file line number Diff line number Diff line change 1
1
package com .github .dockerjava .api .command ;
2
2
3
+ import java .util .Collection ;
3
4
import java .util .List ;
4
5
import java .util .Map ;
5
6
@@ -21,6 +22,13 @@ public interface ListVolumesCmd extends SyncDockerCmd<ListVolumesResponse> {
21
22
*/
22
23
ListVolumesCmd withDanglingFilter (Boolean dangling );
23
24
25
+ /**
26
+ * @param filterName
27
+ * @param filterValues
28
+ * - Show only volumes where the filter matches the given values
29
+ */
30
+ ListVolumesCmd withFilter (String filterName , Collection <String > filterValues );
31
+
24
32
interface Exec extends DockerCmdSyncExec <ListVolumesCmd , ListVolumesResponse > {
25
33
}
26
34
}
Original file line number Diff line number Diff line change 4
4
import com .github .dockerjava .api .model .Network ;
5
5
import com .github .dockerjava .core .util .FiltersBuilder ;
6
6
7
+ import java .util .Collection ;
7
8
import java .util .List ;
8
9
import java .util .Map ;
9
10
11
+ import static com .google .common .base .Preconditions .checkNotNull ;
12
+
10
13
public class ListNetworksCmdImpl extends AbstrDockerCmd <ListNetworksCmd , List <Network >> implements ListNetworksCmd {
11
14
12
15
private FiltersBuilder filtersBuilder = new FiltersBuilder ();
@@ -31,4 +34,11 @@ public ListNetworksCmd withNameFilter(String... networkName) {
31
34
this .filtersBuilder .withFilter ("name" , networkName );
32
35
return this ;
33
36
}
37
+
38
+ @ Override
39
+ public ListNetworksCmd withFilter (String filterName , Collection <String > filterValues ) {
40
+ checkNotNull (filterValues , filterName + " was not specified" );
41
+ this .filtersBuilder .withFilter (filterName , filterValues );
42
+ return this ;
43
+ }
34
44
}
Original file line number Diff line number Diff line change 2
2
3
3
import static com .google .common .base .Preconditions .checkNotNull ;
4
4
5
+ import java .util .Collection ;
5
6
import java .util .List ;
6
7
import java .util .Map ;
7
8
@@ -33,4 +34,11 @@ public ListVolumesCmd withDanglingFilter(Boolean dangling) {
33
34
this .filters .withFilter ("dangling" , dangling .toString ());
34
35
return this ;
35
36
}
37
+
38
+ @ Override
39
+ public ListVolumesCmd withFilter (String filterName , Collection <String > filterValues ) {
40
+ checkNotNull (filterValues , filterName + " was not specified" );
41
+ this .filters .withFilter (filterName , filterValues );
42
+ return this ;
43
+ }
36
44
}
You can’t perform that action at this time.
0 commit comments