Skip to content

Commit ae29bf7

Browse files
author
Marcus Linke
committed
WIP
1 parent 968ec86 commit ae29bf7

File tree

13 files changed

+39
-78
lines changed

13 files changed

+39
-78
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
5151
/**
5252
* "forcerm" in API
5353
*/
54-
public Boolean isForcerm();
54+
public boolean isForcerm();
5555

5656
@CheckForNull
5757
public Boolean getForcerm();

src/main/java/com/github/dockerjava/api/model/AccessMode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ public enum AccessMode {
1515
*/
1616
public static final AccessMode DEFAULT = rw;
1717

18-
public static final AccessMode fromBoolean(Boolean accessMode) {
18+
public static final AccessMode fromBoolean(boolean accessMode) {
1919
return accessMode ? rw : ro;
2020
}
2121

22-
public final Boolean toBoolean() {
22+
public final boolean toBoolean() {
2323
return this.equals(AccessMode.rw) ? true : false;
2424
}
2525

src/main/java/com/github/dockerjava/api/model/AuthConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void setAuth(String auth) {
7676

7777
@Override
7878
public String toString() {
79-
return ReflectionToStringBuilder.toString(this, ToStringStyle.SIMPLE_STYLE);
79+
return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE);
8080
}
8181

8282
@Override

src/main/java/com/github/dockerjava/api/model/ContainerConfig.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@
2020
public class ContainerConfig {
2121

2222
@JsonProperty("AttachStderr")
23-
private Boolean attachStderr = false;
23+
private Boolean attachStderr;
2424

2525
@JsonProperty("AttachStdin")
26-
private Boolean attachStdin = false;
26+
private Boolean attachStdin;
2727

2828
@JsonProperty("AttachStdout")
29-
private Boolean attachStdout = false;
29+
private Boolean attachStdout;
3030

3131
@JsonProperty("Cmd")
3232
private String[] cmd;
3333

3434
@JsonProperty("Domainname")
35-
private String domainName = "";
35+
private String domainName;
3636

3737
@JsonProperty("Entrypoint")
38-
private String[] entrypoint = new String[] {};
38+
private String[] entrypoint;
3939

4040
@JsonProperty("Env")
4141
private String[] env;
@@ -44,7 +44,7 @@ public class ContainerConfig {
4444
private ExposedPorts exposedPorts;
4545

4646
@JsonProperty("Hostname")
47-
private String hostName = "";
47+
private String hostName;
4848

4949
@JsonProperty("Image")
5050
private String image;
@@ -56,31 +56,31 @@ public class ContainerConfig {
5656
private String macAddress;
5757

5858
@JsonProperty("NetworkDisabled")
59-
private Boolean networkDisabled = false;
59+
private Boolean networkDisabled;
6060

6161
@JsonProperty("OnBuild")
6262
private String[] onBuild;
6363

6464
@JsonProperty("OpenStdin")
65-
private Boolean stdinOpen = false;
65+
private Boolean stdinOpen;
6666

6767
@JsonProperty("PortSpecs")
6868
private String[] portSpecs;
6969

7070
@JsonProperty("StdinOnce")
71-
private Boolean stdInOnce = false;
71+
private Boolean stdInOnce;
7272

7373
@JsonProperty("Tty")
74-
private Boolean tty = false;
74+
private Boolean tty;
7575

7676
@JsonProperty("User")
77-
private String user = "";
77+
private String user;
7878

7979
@JsonProperty("Volumes")
8080
private Map<String, ?> volumes;
8181

8282
@JsonProperty("WorkingDir")
83-
private String workingDir = "";
83+
private String workingDir;
8484

8585
@JsonIgnore
8686
public ExposedPort[] getExposedPorts() {

src/main/java/com/github/dockerjava/api/model/HostConfig.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -93,34 +93,6 @@ public class HostConfig {
9393
@JsonProperty("VolumesFrom")
9494
private VolumesFrom[] volumesFrom;
9595

96-
public HostConfig() {
97-
}
98-
99-
// public HostConfig(Bind[] binds, Link[] links, LxcConf[] lxcConf, LogConfig logConfig, Ports portBindings,
100-
// Boolean publishAllPorts, Boolean privileged, Boolean readonlyRootfs, String[] dns, String[] dnsSearch,
101-
// VolumesFrom[] volumesFrom, String containerIDFile, Capability[] capAdd, Capability[] capDrop,
102-
// RestartPolicy restartPolicy, String networkMode, Device[] devices, String[] extraHosts, Ulimit[] ulimits) {
103-
// this.binds = new Binds(binds);
104-
// this.links = new Links(links);
105-
// this.lxcConf = lxcConf;
106-
// this.logConfig = logConfig;
107-
// this.portBindings = portBindings;
108-
// this.publishAllPorts = publishAllPorts;
109-
// this.privileged = privileged;
110-
// this.readonlyRootfs = readonlyRootfs;
111-
// this.dns = dns;
112-
// this.dnsSearch = dnsSearch;
113-
// this.volumesFrom = volumesFrom;
114-
// this.containerIDFile = containerIDFile;
115-
// this.capAdd = capAdd;
116-
// this.capDrop = capDrop;
117-
// this.restartPolicy = restartPolicy;
118-
// this.networkMode = networkMode;
119-
// this.devices = devices;
120-
// this.extraHosts = extraHosts;
121-
// this.ulimits = ulimits;
122-
// }
123-
12496
@JsonIgnore
12597
public Bind[] getBinds() {
12698
return (binds == null) ? new Bind[0] : binds.getBinds();

src/main/java/com/github/dockerjava/api/model/Volumes.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public void serialize(Volumes volumes, JsonGenerator jsonGen, SerializerProvider
4848
jsonGen.writeFieldName(volume.getPath());
4949
jsonGen.writeStartObject();
5050
jsonGen.writeEndObject();
51-
// jsonGen.writeString(Boolean.toString(volume.getAccessMode().equals(AccessMode.rw) ? true: false));
5251
}
5352
jsonGen.writeEndObject();
5453
}

src/main/java/com/github/dockerjava/core/CertificateUtils.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,11 @@
2727

2828
public class CertificateUtils {
2929

30-
public static Boolean verifyCertificatesExist(String dockerCertPath) {
30+
public static boolean verifyCertificatesExist(String dockerCertPath) {
3131
String[] files = { "ca.pem", "cert.pem", "key.pem" };
3232
for (String file : files) {
3333
File path = new File(dockerCertPath, file);
34-
Boolean exists = path.exists();
35-
if (!exists) {
36-
return false;
37-
}
34+
return path.exists();
3835
}
3936

4037
return true;

src/main/java/com/github/dockerjava/core/GoLangFileMatch.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@
2424
* character class (must be non-empty)
2525
* c matches character c (c != '*', '?', '\\', '[')
2626
* '\\' c matches character c
27-
*
27+
*
2828
* character-range:
2929
* c matches character c (c != '\\', '-', ']')
3030
* '\\' c matches character c
3131
* lo '-' hi matches character c for lo <= c <= hi
32-
*
32+
*
3333
* Match requires pattern to match all of name, not just a substring.
3434
* The only possible returned error is ErrBadPattern, when pattern
3535
* is malformed.
36-
*
36+
*
3737
* On Windows, escaping is disabled. Instead, '\\' is treated as
3838
* path separator.
3939
* </pre>
@@ -43,13 +43,13 @@
4343
*/
4444
public class GoLangFileMatch {
4545

46-
public static final Boolean IS_WINDOWS = File.separatorChar == '\\';
46+
public static final boolean IS_WINDOWS = File.separatorChar == '\\';
4747

48-
public static Boolean match(List<String> patterns, File file) {
48+
public static boolean match(List<String> patterns, File file) {
4949
return !match(patterns, file.getPath()).isEmpty();
5050
}
5151

52-
public static Boolean match(String pattern, File file) {
52+
public static boolean match(String pattern, File file) {
5353
return match(pattern, file.getPath());
5454
}
5555

@@ -66,7 +66,7 @@ public static List<String> match(List<String> patterns, String name) {
6666
return matches;
6767
}
6868

69-
public static Boolean match(String pattern, String name) {
69+
public static boolean match(String pattern, String name) {
7070
Pattern: while (!pattern.isEmpty()) {
7171
ScanResult scanResult = scanChunk(pattern);
7272
pattern = scanResult.pattern;
@@ -103,12 +103,12 @@ public static Boolean match(String pattern, String name) {
103103
}
104104

105105
static ScanResult scanChunk(String pattern) {
106-
Boolean star = false;
106+
boolean star = false;
107107
if (!pattern.isEmpty() && pattern.charAt(0) == '*') {
108108
pattern = pattern.substring(1);
109109
star = true;
110110
}
111-
Boolean inRange = false;
111+
boolean inRange = false;
112112
int i;
113113
Scan: for (i = 0; i < pattern.length(); i++) {
114114
switch (pattern.charAt(i)) {
@@ -157,12 +157,12 @@ static String matchChunk(String chunk, String s) {
157157
throw new GoLangFileMatchException();
158158
}
159159
// possibly negated
160-
Boolean negated = chunk.charAt(chunkOffset) == '^';
160+
boolean negated = chunk.charAt(chunkOffset) == '^';
161161
if (negated) {
162162
chunkOffset++;
163163
}
164164
// parse all ranges
165-
Boolean match = false;
165+
boolean match = false;
166166
int nrange = 0;
167167
while (true) {
168168
if (chunkOffset < chunkLength && chunk.charAt(chunkOffset) == ']' && nrange > 0) {
@@ -238,13 +238,13 @@ static GetEscResult getEsc(String chunk, int chunkOffset, int chunkLength) {
238238
}
239239

240240
private static final class ScanResult {
241-
public Boolean star;
241+
public boolean star;
242242

243243
public String chunk;
244244

245245
public String pattern;
246246

247-
public ScanResult(Boolean star, String chunk, String pattern) {
247+
public ScanResult(boolean star, String chunk, String pattern) {
248248
this.star = star;
249249
this.chunk = chunk;
250250
this.pattern = pattern;

src/main/java/com/github/dockerjava/core/LocalDirectorySSLConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public String getDockerCertPath() {
3333
@Override
3434
public SSLContext getSSLContext() {
3535

36-
Boolean certificatesExist = CertificateUtils.verifyCertificatesExist(dockerCertPath);
36+
boolean certificatesExist = CertificateUtils.verifyCertificatesExist(dockerCertPath);
3737

3838
if (certificatesExist) {
3939

src/main/java/com/github/dockerjava/core/command/BuildImageCmdImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public Boolean hasRemoveEnabled() {
108108
}
109109

110110
@Override
111-
public Boolean isForcerm() {
111+
public boolean isForcerm() {
112112
return forcerm != null && forcerm;
113113
}
114114

0 commit comments

Comments
 (0)