forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInspectContainerCmdImpl.java
More file actions
63 lines (52 loc) · 1.75 KB
/
Copy pathInspectContainerCmdImpl.java
File metadata and controls
63 lines (52 loc) · 1.75 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.github.dockerjava.core.command;
import static com.google.common.base.Preconditions.checkNotNull;
import com.github.dockerjava.api.command.InspectContainerCmd;
import com.github.dockerjava.api.command.InspectContainerResponse;
import com.github.dockerjava.api.command.InspectContainerSpec;
import com.github.dockerjava.api.exception.NotFoundException;
/**
* Inspect the details of a container.
*/
public class InspectContainerCmdImpl extends AbstrDockerCmd<InspectContainerCmd, InspectContainerResponse> implements
InspectContainerCmd {
private InspectContainerSpec spec;
public InspectContainerCmdImpl(InspectContainerCmd.Exec exec, String containerId) {
this(
exec,
InspectContainerSpec.builder()
.containerId(containerId)
.build()
);
}
InspectContainerCmdImpl(InspectContainerCmd.Exec inspectContainerCmdExec, InspectContainerSpec spec) {
super(inspectContainerCmdExec);
this.spec = spec;
}
@Override
public String getContainerId() {
return spec.getContainerId();
}
@Override
public InspectContainerCmd withContainerId(String containerId) {
checkNotNull(containerId, "containerId was not specified");
this.spec = spec.withContainerId(containerId);
return this;
}
@Override
public InspectContainerCmd withSize(Boolean showSize) {
this.spec = spec.withSize(showSize);
return this;
}
@Override
public Boolean getSize() {
return spec.getSize();
}
/**
* @throws NotFoundException
* No such container
*/
@Override
public InspectContainerResponse exec() throws NotFoundException {
return super.exec();
}
}