X Tutup
Skip to content

Commit 8036950

Browse files
committed
InfoTest, ContainerTest, fix getter.
1 parent 1b749bc commit 8036950

File tree

6 files changed

+356
-28
lines changed

6 files changed

+356
-28
lines changed

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

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,30 @@ public class Container {
5555
private String status;
5656

5757
/**
58-
* @since > ~{@link RemoteApiVersion#VERSION_1_19}
58+
* @since ~{@link RemoteApiVersion#VERSION_1_19}
5959
*/
6060
@JsonProperty("SizeRw")
6161
private Long sizeRw;
6262

6363
/**
6464
* Returns only when {@link ListContainersCmd#withShowSize(java.lang.Boolean)} set
6565
*
66-
* @since > ~{@link RemoteApiVersion#VERSION_1_19}
66+
* @since ~{@link RemoteApiVersion#VERSION_1_19}
6767
*/
6868
@JsonProperty("SizeRootFs")
6969
private Long sizeRootFs;
7070

71+
/**
72+
* @since ~{@link RemoteApiVersion#VERSION_1_20}
73+
*/
7174
@JsonProperty("HostConfig")
7275
private HostConfig hostConfig;
7376

7477
/**
7578
* Docker API docs says "list of networks", but json names `networkSettings`.
7679
* So, reusing existed NetworkSettings model object.
7780
*
78-
* @since > ~{@link RemoteApiVersion#VERSION_1_22}
81+
* @since ~{@link RemoteApiVersion#VERSION_1_22}
7982
*/
8083
@JsonProperty("NetworkSettings")
8184
private NetworkSettings networkSettings;
@@ -141,6 +144,14 @@ public NetworkSettings getNetworkSettings() {
141144
return networkSettings;
142145
}
143146

147+
/**
148+
* @see #hostConfig
149+
*/
150+
@CheckForNull
151+
public HostConfig getHostConfig() {
152+
return hostConfig;
153+
}
154+
144155
@Override
145156
public String toString() {
146157
return ToStringBuilder.reflectionToString(this);
@@ -229,6 +240,7 @@ public static final class Network {
229240
/**
230241
* FIXME no docs, unknown field.
231242
* Type picked from `docker/vendor/src/github.com/docker/engine-api/types/network/network.go`
243+
* @since {@link RemoteApiVersion#VERSION_1_22}
232244
*/
233245
@JsonProperty("Aliases")
234246
private List<String> aliases;
@@ -260,51 +272,98 @@ public static final class Network {
260272
@JsonProperty("MacAddress")
261273
private String macAddress;
262274

275+
/**
276+
* @see #aliases
277+
*/
263278
@CheckForNull
264279
public List<String> getAliases() {
265280
return aliases;
266281
}
267282

283+
/**
284+
* @see #endpointId
285+
*/
286+
@CheckForNull
268287
public String getEndpointId() {
269288
return endpointId;
270289
}
271290

291+
/**
292+
* @see #gateway
293+
*/
294+
@CheckForNull
272295
public String getGateway() {
273296
return gateway;
274297
}
275298

299+
/**
300+
* @see #globalIPv6Address
301+
*/
302+
@CheckForNull
276303
public String getGlobalIPv6Address() {
277304
return globalIPv6Address;
278305
}
279306

307+
/**
308+
* @see #globalIPv6PrefixLen
309+
*/
310+
@CheckForNull
280311
public Integer getGlobalIPv6PrefixLen() {
281312
return globalIPv6PrefixLen;
282313
}
283314

315+
/**
316+
* @see #ipAddress
317+
*/
318+
@CheckForNull
284319
public String getIpAddress() {
285320
return ipAddress;
286321
}
287322

323+
/**
324+
* @see #ipamConfig
325+
*/
326+
@CheckForNull
288327
public Ipam.Config getIpamConfig() {
289328
return ipamConfig;
290329
}
291330

331+
/**
332+
* @see #ipPrefixLen
333+
*/
334+
@CheckForNull
292335
public Integer getIpPrefixLen() {
293336
return ipPrefixLen;
294337
}
295338

339+
/**
340+
* @see #ipV6Gateway
341+
*/
342+
@CheckForNull
296343
public String getIpV6Gateway() {
297344
return ipV6Gateway;
298345
}
299346

347+
/**
348+
* @see #links
349+
*/
350+
@CheckForNull
300351
public List<String> getLinks() {
301352
return links;
302353
}
303354

355+
/**
356+
* @see #macAddress
357+
*/
358+
@CheckForNull
304359
public String getMacAddress() {
305360
return macAddress;
306361
}
307362

363+
/**
364+
* @see #networkID
365+
*/
366+
@CheckForNull
308367
public String getNetworkID() {
309368
return networkID;
310369
}

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

Lines changed: 95 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,6 @@ public Integer getImages() {
265265
return images;
266266
}
267267

268-
public String getID() {
269-
return id;
270-
}
271-
272-
public Boolean getIPv4Forwarding() {
273-
return ipv4Forwarding;
274-
}
275-
276268
public String getIndexServerAddress() {
277269
return indexServerAddress;
278270
}
@@ -313,14 +305,6 @@ public String getName() {
313305
return name;
314306
}
315307

316-
public Integer getNCPU() {
317-
return ncpu;
318-
}
319-
320-
public Integer getNFd() {
321-
return nfd;
322-
}
323-
324308
public Integer getNGoroutines() {
325309
return nGoroutines;
326310
}
@@ -420,20 +404,15 @@ public Boolean getMemoryLimit() {
420404
}
421405

422406
@CheckForNull
423-
public Integer getNcpu() {
407+
public Integer getNCPU() {
424408
return ncpu;
425409
}
426410

427411
@CheckForNull
428-
public Integer getNfd() {
412+
public Integer getNFd() {
429413
return nfd;
430414
}
431415

432-
@CheckForNull
433-
public Integer getnGoroutines() {
434-
return nGoroutines;
435-
}
436-
437416
@CheckForNull
438417
public String getNoProxy() {
439418
return noProxy;
@@ -586,19 +565,66 @@ public static final class RegistryConfig {
586565
@JsonProperty("InsecureRegistryCIDRs")
587566
private List<String> insecureRegistryCIDRs;
588567

568+
/**
569+
* //FIXME unknown field
570+
*/
571+
@JsonProperty("Mirrors")
572+
private Object mirrors;
573+
574+
/**
575+
* @see #indexConfigs
576+
*/
577+
@CheckForNull
589578
public Map<String, IndexConfig> getIndexConfigs() {
590579
return indexConfigs;
591580
}
592581

582+
/**
583+
* @see #indexConfigs
584+
*/
585+
public RegistryConfig withIndexConfigs(Map<String, IndexConfig> indexConfigs) {
586+
this.indexConfigs = indexConfigs;
587+
return this;
588+
}
589+
590+
/**
591+
* @see #insecureRegistryCIDRs
592+
*/
593+
@CheckForNull
593594
public List<String> getInsecureRegistryCIDRs() {
594595
return insecureRegistryCIDRs;
595596
}
596597

598+
/**
599+
* @see #insecureRegistryCIDRs
600+
*/
601+
public RegistryConfig withInsecureRegistryCIDRs(List<String> insecureRegistryCIDRs) {
602+
this.insecureRegistryCIDRs = insecureRegistryCIDRs;
603+
return this;
604+
}
605+
606+
/**
607+
* @see #mirrors
608+
*/
609+
@CheckForNull
610+
public Object getMirrors() {
611+
return mirrors;
612+
}
613+
614+
/**
615+
* @see #mirrors
616+
*/
617+
public RegistryConfig withMirrors(Object mirrors) {
618+
this.mirrors = mirrors;
619+
return this;
620+
}
621+
597622
@Override
598623
public String toString() {
599624
return new ToStringBuilder(this)
600625
.append("indexConfigs", indexConfigs)
601626
.append("insecureRegistryCIDRs", insecureRegistryCIDRs)
627+
.append("mirrors", mirrors)
602628
.toString();
603629
}
604630

@@ -613,6 +639,7 @@ public boolean equals(Object o) {
613639
return new EqualsBuilder()
614640
.append(indexConfigs, that.indexConfigs)
615641
.append(insecureRegistryCIDRs, that.insecureRegistryCIDRs)
642+
.append(mirrors, that.mirrors)
616643
.isEquals();
617644
}
618645

@@ -621,6 +648,7 @@ public int hashCode() {
621648
return new HashCodeBuilder(17, 37)
622649
.append(indexConfigs)
623650
.append(insecureRegistryCIDRs)
651+
.append(mirrors)
624652
.toHashCode();
625653
}
626654

@@ -641,26 +669,70 @@ public static final class IndexConfig {
641669
@JsonProperty("Secure")
642670
private Boolean secure;
643671

672+
/**
673+
* @see #mirrors
674+
*/
644675
@CheckForNull
645676
public String getMirrors() {
646677
return mirrors;
647678
}
648679

680+
/**
681+
* @see #mirrors
682+
*/
683+
public IndexConfig withMirrors(String mirrors) {
684+
this.mirrors = mirrors;
685+
return this;
686+
}
687+
688+
/**
689+
* @see #name
690+
*/
649691
@CheckForNull
650692
public String getName() {
651693
return name;
652694
}
653695

696+
/**
697+
* @see #name
698+
*/
699+
public IndexConfig withName(String name) {
700+
this.name = name;
701+
return this;
702+
}
703+
704+
/**
705+
* @see #official
706+
*/
654707
@CheckForNull
655708
public Boolean getOfficial() {
656709
return official;
657710
}
658711

712+
/**
713+
* @see #official
714+
*/
715+
public IndexConfig withOfficial(Boolean official) {
716+
this.official = official;
717+
return this;
718+
}
719+
720+
/**
721+
* @see #secure
722+
*/
659723
@CheckForNull
660724
public Boolean getSecure() {
661725
return secure;
662726
}
663727

728+
/**
729+
* @see #secure
730+
*/
731+
public IndexConfig withSecure(Boolean secure) {
732+
this.secure = secure;
733+
return this;
734+
}
735+
664736
@Override
665737
public String toString() {
666738
return new ToStringBuilder(this)

0 commit comments

Comments
 (0)
X Tutup