Skip to content

Commit 1446774

Browse files
committed
Merge pull request #313 from docker-java/issue-246
Refactor primitive type fields to be of object type in JSON objects
2 parents 901654b + df8c13f commit 1446774

File tree

135 files changed

+1376
-1219
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+1376
-1219
lines changed

src/main/java/com/github/dockerjava/api/async/ResultCallback.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ public interface ResultCallback<A_RES_T> extends Closeable {
2020

2121
/** Called when processing was finished either by reaching the end or by aborting it */
2222
void onComplete();
23-
2423
}

src/main/java/com/github/dockerjava/api/command/AttachContainerCmd.java

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import java.io.InputStream;
44

5+
import javax.annotation.CheckForNull;
6+
import javax.annotation.Nonnull;
7+
58
import com.github.dockerjava.api.DockerClient;
69
import com.github.dockerjava.api.model.Frame;
710

@@ -22,45 +25,40 @@
2225
*/
2326
public interface AttachContainerCmd extends AsyncDockerCmd<AttachContainerCmd, Frame> {
2427

28+
@CheckForNull
2529
public String getContainerId();
2630

27-
public boolean hasLogsEnabled();
28-
29-
public boolean hasFollowStreamEnabled();
31+
@CheckForNull
32+
public Boolean hasLogsEnabled();
3033

31-
public boolean hasTimestampsEnabled();
34+
@CheckForNull
35+
public Boolean hasFollowStreamEnabled();
3236

33-
public boolean hasStdoutEnabled();
37+
@CheckForNull
38+
public Boolean hasTimestampsEnabled();
3439

35-
public boolean hasStderrEnabled();
40+
@CheckForNull
41+
public Boolean hasStdoutEnabled();
3642

37-
public AttachContainerCmd withContainerId(String containerId);
43+
@CheckForNull
44+
public Boolean hasStderrEnabled();
3845

39-
/**
40-
* See {@link #withFollowStream(boolean)}
41-
*/
42-
public AttachContainerCmd withFollowStream();
46+
public AttachContainerCmd withContainerId(@Nonnull String containerId);
4347

4448
/**
4549
* Following the stream means the resulting {@link InputStream} returned by {@link #exec()} reads infinitely. So a
4650
* {@link InputStream#read()} MAY BLOCK FOREVER as long as no data is streamed from the docker host to
4751
* {@link DockerClient}!
4852
*/
49-
public AttachContainerCmd withFollowStream(boolean followStream);
50-
51-
public AttachContainerCmd withTimestamps(boolean timestamps);
52-
53-
public AttachContainerCmd withStdOut();
54-
55-
public AttachContainerCmd withStdOut(boolean stdout);
53+
public AttachContainerCmd withFollowStream(Boolean followStream);
5654

57-
public AttachContainerCmd withStdErr();
55+
public AttachContainerCmd withTimestamps(Boolean timestamps);
5856

59-
public AttachContainerCmd withStdErr(boolean stderr);
57+
public AttachContainerCmd withStdOut(Boolean stdout);
6058

61-
public AttachContainerCmd withLogs(boolean logs);
59+
public AttachContainerCmd withStdErr(Boolean stderr);
6260

63-
public AttachContainerCmd withLogs();
61+
public AttachContainerCmd withLogs(Boolean logs);
6462

6563
public static interface Exec extends DockerCmdAsyncExec<AttachContainerCmd, Frame> {
6664
}

src/main/java/com/github/dockerjava/api/command/AuthCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.github.dockerjava.api.command;
22

3+
import javax.annotation.CheckForNull;
4+
import javax.annotation.Nonnull;
5+
36
import com.github.dockerjava.api.UnauthorizedException;
47
import com.github.dockerjava.api.model.AuthConfig;
58
import com.github.dockerjava.api.model.AuthResponse;
@@ -11,9 +14,10 @@
1114
*/
1215
public interface AuthCmd extends SyncDockerCmd<AuthResponse> {
1316

17+
@CheckForNull
1418
public AuthConfig getAuthConfig();
1519

16-
public AuthCmd withAuthConfig(AuthConfig authConfig);
20+
public AuthCmd withAuthConfig(@Nonnull AuthConfig authConfig);
1721

1822
/**
1923
* @return The status. Based on it's value you may mean you need to authorise your account, e.g.:

src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import com.github.dockerjava.api.model.BuildResponseItem;
55

66
import javax.annotation.CheckForNull;
7+
import javax.annotation.Nonnull;
8+
79
import java.io.File;
810
import java.io.InputStream;
911
import java.net.URI;
@@ -20,8 +22,10 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
2022

2123
// lib specific
2224

25+
@CheckForNull
2326
public InputStream getTarInputStream();
2427

28+
@CheckForNull
2529
public AuthConfigurations getBuildAuthConfigs();
2630

2731
// getters
@@ -41,30 +45,32 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
4145
/**
4246
* "nocache" in API
4347
*/
44-
public boolean hasNoCacheEnabled();
48+
@CheckForNull
49+
public Boolean hasNoCacheEnabled();
4550

4651
/**
4752
* "rm" in API
4853
*/
49-
public boolean hasRemoveEnabled();
54+
@CheckForNull
55+
public Boolean hasRemoveEnabled();
5056

5157
/**
5258
* "forcerm" in API
5359
*/
54-
public boolean isForcerm();
55-
5660
@CheckForNull
57-
public Boolean getForcerm();
61+
public Boolean isForcerm();
5862

5963
/**
6064
* "q" in API
6165
*/
62-
public boolean isQuiet();
66+
@CheckForNull
67+
public Boolean isQuiet();
6368

6469
/**
6570
* "pull" in API
6671
*/
67-
public boolean hasPullEnabled();
72+
@CheckForNull
73+
public Boolean hasPullEnabled();
6874

6975
@CheckForNull
7076
public String getPathToDockerfile();
@@ -91,29 +97,19 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
9197

9298
public BuildImageCmd withDockerfile(File dockerfile);
9399

94-
public BuildImageCmd withNoCache();
95-
96-
public BuildImageCmd withNoCache(boolean noCache);
97-
98-
public BuildImageCmd withRemove();
100+
public BuildImageCmd withNoCache(Boolean noCache);
99101

100-
public BuildImageCmd withRemove(boolean rm);
101-
102-
public BuildImageCmd withForcerm();
102+
public BuildImageCmd withRemove(Boolean rm);
103103

104104
public BuildImageCmd withForcerm(Boolean forcerm);
105105

106-
public BuildImageCmd withQuiet();
107-
108-
public BuildImageCmd withQuiet(boolean quiet);
109-
110-
public BuildImageCmd withPull();
106+
public BuildImageCmd withQuiet(Boolean quiet);
111107

112-
public BuildImageCmd withPull(boolean pull);
108+
public BuildImageCmd withPull(Boolean pull);
113109

114-
public BuildImageCmd withMemory(long memory);
110+
public BuildImageCmd withMemory(Long memory);
115111

116-
public BuildImageCmd withMemswap(long memswap);
112+
public BuildImageCmd withMemswap(Long memswap);
117113

118114
public BuildImageCmd withCpushares(String cpushares);
119115

@@ -123,7 +119,7 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
123119

124120
public BuildImageCmd withBuildAuthConfigs(AuthConfigurations authConfig);
125121

126-
public BuildImageCmd withTarInputStream(InputStream tarInputStream);
122+
public BuildImageCmd withTarInputStream(@Nonnull InputStream tarInputStream);
127123

128124
public static interface Exec extends DockerCmdAsyncExec<BuildImageCmd, BuildResponseItem> {
129125
}
Lines changed: 55 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.github.dockerjava.api.command;
22

3+
import javax.annotation.CheckForNull;
4+
import javax.annotation.Nonnull;
5+
36
import com.github.dockerjava.api.NotFoundException;
47
import com.github.dockerjava.api.model.ExposedPorts;
58
import com.github.dockerjava.api.model.Volumes;
@@ -11,96 +14,104 @@
1114
*/
1215
public interface CommitCmd extends SyncDockerCmd<String> {
1316

17+
@CheckForNull
18+
public String getAuthor();
19+
20+
@CheckForNull
1421
public String getContainerId();
1522

16-
public CommitCmd withContainerId(String containerId);
23+
@CheckForNull
24+
public String[] getEnv();
1725

18-
public String getRepository();
26+
@CheckForNull
27+
public ExposedPorts getExposedPorts();
1928

20-
public String getTag();
29+
@CheckForNull
30+
public String getHostname();
31+
32+
@CheckForNull
33+
public Integer getMemory();
2134

35+
@CheckForNull
36+
public Integer getMemorySwap();
37+
38+
@CheckForNull
2239
public String getMessage();
2340

24-
public String getAuthor();
41+
@CheckForNull
42+
public String[] getPortSpecs();
2543

26-
public boolean hasPauseEnabled();
44+
@CheckForNull
45+
public String getRepository();
2746

28-
public CommitCmd withAttachStderr(boolean attachStderr);
47+
@CheckForNull
48+
public String getTag();
2949

30-
public CommitCmd withAttachStderr();
50+
@CheckForNull
51+
public String getUser();
3152

32-
public CommitCmd withAttachStdin(boolean attachStdin);
53+
@CheckForNull
54+
public Volumes getVolumes();
3355

34-
public CommitCmd withAttachStdin();
56+
@CheckForNull
57+
public String getWorkingDir();
3558

36-
public CommitCmd withAttachStdout(boolean attachStdout);
59+
@CheckForNull
60+
public Boolean hasPauseEnabled();
3761

38-
public CommitCmd withAttachStdout();
62+
@CheckForNull
63+
public Boolean isOpenStdin();
3964

40-
public CommitCmd withCmd(String... cmd);
65+
@CheckForNull
66+
public Boolean isStdinOnce();
4167

42-
public CommitCmd withDisableNetwork(boolean disableNetwork);
68+
@CheckForNull
69+
public Boolean isTty();
4370

44-
public CommitCmd withAuthor(String author);
71+
public CommitCmd withAttachStderr(Boolean attachStderr);
4572

46-
public CommitCmd withMessage(String message);
73+
public CommitCmd withAttachStdin(Boolean attachStdin);
4774

48-
public CommitCmd withTag(String tag);
75+
public CommitCmd withAttachStdout(Boolean attachStdout);
4976

50-
public CommitCmd withRepository(String repository);
77+
public CommitCmd withAuthor(String author);
5178

52-
public CommitCmd withPause(boolean pause);
79+
public CommitCmd withCmd(String... cmd);
5380

54-
public String[] getEnv();
81+
public CommitCmd withContainerId(@Nonnull String containerId);
5582

56-
public CommitCmd withEnv(String... env);
83+
public CommitCmd withDisableNetwork(Boolean disableNetwork);
5784

58-
public ExposedPorts getExposedPorts();
85+
public CommitCmd withEnv(String... env);
5986

6087
public CommitCmd withExposedPorts(ExposedPorts exposedPorts);
6188

62-
public String getHostname();
63-
6489
public CommitCmd withHostname(String hostname);
6590

66-
public Integer getMemory();
67-
6891
public CommitCmd withMemory(Integer memory);
6992

70-
public Integer getMemorySwap();
71-
7293
public CommitCmd withMemorySwap(Integer memorySwap);
7394

74-
public boolean isOpenStdin();
95+
public CommitCmd withMessage(String message);
7596

76-
public CommitCmd withOpenStdin(boolean openStdin);
97+
public CommitCmd withOpenStdin(Boolean openStdin);
7798

78-
public String[] getPortSpecs();
99+
public CommitCmd withPause(Boolean pause);
79100

80101
public CommitCmd withPortSpecs(String... portSpecs);
81102

82-
public boolean isStdinOnce();
83-
84-
public CommitCmd withStdinOnce(boolean stdinOnce);
85-
86-
public CommitCmd withStdinOnce();
87-
88-
public boolean isTty();
103+
public CommitCmd withRepository(String repository);
89104

90-
public CommitCmd withTty(boolean tty);
105+
public CommitCmd withStdinOnce(Boolean stdinOnce);
91106

92-
public CommitCmd withTty();
107+
public CommitCmd withTag(String tag);
93108

94-
public String getUser();
109+
public CommitCmd withTty(Boolean tty);
95110

96111
public CommitCmd withUser(String user);
97112

98-
public Volumes getVolumes();
99-
100113
public CommitCmd withVolumes(Volumes volumes);
101114

102-
public String getWorkingDir();
103-
104115
public CommitCmd withWorkingDir(String workingDir);
105116

106117
/**
@@ -112,5 +123,4 @@ public interface CommitCmd extends SyncDockerCmd<String> {
112123

113124
public static interface Exec extends DockerCmdSyncExec<CommitCmd, String> {
114125
}
115-
116126
}

src/main/java/com/github/dockerjava/api/command/ContainerDiffCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,20 @@
22

33
import java.util.List;
44

5+
import javax.annotation.CheckForNull;
6+
import javax.annotation.Nonnull;
7+
58
import com.github.dockerjava.api.DockerException;
69
import com.github.dockerjava.api.InternalServerErrorException;
710
import com.github.dockerjava.api.NotFoundException;
811
import com.github.dockerjava.api.model.ChangeLog;
912

1013
public interface ContainerDiffCmd extends SyncDockerCmd<List<ChangeLog>> {
1114

15+
@CheckForNull
1216
public String getContainerId();
1317

14-
public ContainerDiffCmd withContainerId(String containerId);
18+
public ContainerDiffCmd withContainerId(@Nonnull String containerId);
1519

1620
@Override
1721
public String toString();

0 commit comments

Comments
 (0)