forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPushImageCmdImpl.java
More file actions
67 lines (54 loc) · 1.65 KB
/
Copy pathPushImageCmdImpl.java
File metadata and controls
67 lines (54 loc) · 1.65 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
64
65
66
67
package com.github.dockerjava.core.command;
import java.util.Objects;
import com.github.dockerjava.api.command.PushImageCmd;
import com.github.dockerjava.api.model.AuthConfig;
import com.github.dockerjava.api.model.PushResponseItem;
/**
* Push the latest image to the repository.
*
* @param name
* The name, e.g. "alexec/busybox" or just "busybox" if you want to default. Not null.
*/
public class PushImageCmdImpl extends AbstrAsyncDockerCmd<PushImageCmd, PushResponseItem> implements PushImageCmd {
private String name;
private String tag;
private AuthConfig authConfig;
public PushImageCmdImpl(PushImageCmd.Exec exec, AuthConfig authConfig, String name) {
super(exec);
withName(name);
withAuthConfig(authConfig);
}
@Override
public String getName() {
return name;
}
@Override
public String getTag() {
return tag;
}
/**
* @param name
* The name, e.g. "alexec/busybox" or just "busybox" if you want to default. Not null.
*/
@Override
public PushImageCmd withName(String name) {
this.name = Objects.requireNonNull(name, "name was not specified");
return this;
}
/**
* @param tag
* The image's tag. Can be null or empty.
*/
@Override
public PushImageCmd withTag(String tag) {
this.tag = Objects.requireNonNull(tag, "tag was not specified");
return this;
}
public AuthConfig getAuthConfig() {
return authConfig;
}
public PushImageCmd withAuthConfig(AuthConfig authConfig) {
this.authConfig = authConfig;
return this;
}
}