Skip to content

Commit 264f37b

Browse files
author
Marcus Linke
committed
Merge branch '2.x'
Conflicts: CHANGELOG.md Use objects instead of primitives in ResponseItem
2 parents 437414f + b88f8aa commit 264f37b

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ All changes
1616

1717
2.1.3-SNAPSHOT
1818
---
19+
* [#387] (https://github.com/docker-java/docker-java/pull/387) Make ProgressDetails attributes public
1920
* [#362] (https://github.com/docker-java/docker-java/pull/362) Deprecate "network" and enable "networks" stats (remote Docker API 1.21)
2021

2122
v2.1.2

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

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import java.io.Serializable;
44

5+
import javax.annotation.CheckForNull;
6+
57
import com.fasterxml.jackson.annotation.JsonIgnore;
8+
69
import org.apache.commons.lang.builder.ToStringBuilder;
710
import org.apache.commons.lang.builder.ToStringStyle;
811

@@ -37,7 +40,7 @@ public class ResponseItem implements Serializable {
3740
private String from;
3841

3942
@JsonProperty("time")
40-
private long time;
43+
private Long time;
4144

4245
@JsonProperty("errorDetail")
4346
private ErrorDetail errorDetail;
@@ -46,35 +49,43 @@ public class ResponseItem implements Serializable {
4649
@JsonProperty("error")
4750
private String error;
4851

52+
@CheckForNull
4953
public String getStream() {
5054
return stream;
5155
}
5256

57+
@CheckForNull
5358
public String getStatus() {
5459
return status;
5560
}
5661

62+
@CheckForNull
5763
public ProgressDetail getProgressDetail() {
5864
return progressDetail;
5965
}
6066

67+
@CheckForNull
6168
@Deprecated
6269
public String getProgress() {
6370
return progress;
6471
}
6572

73+
@CheckForNull
6674
public String getId() {
6775
return id;
6876
}
6977

78+
@CheckForNull
7079
public String getFrom() {
7180
return from;
7281
}
7382

74-
public long getTime() {
83+
@CheckForNull
84+
public Long getTime() {
7585
return time;
7686
}
7787

88+
@CheckForNull
7889
public ErrorDetail getErrorDetail() {
7990
return errorDetail;
8091
}
@@ -100,13 +111,28 @@ public static class ProgressDetail implements Serializable {
100111
private static final long serialVersionUID = -1954994695645715264L;
101112

102113
@JsonProperty("current")
103-
long current;
114+
Long current;
104115

105116
@JsonProperty("total")
106-
long total;
117+
Long total;
107118

108119
@JsonProperty("start")
109-
long start;
120+
Long start;
121+
122+
@CheckForNull
123+
public Long getCurrent() {
124+
return current;
125+
}
126+
127+
@CheckForNull
128+
public Long getTotal() {
129+
return total;
130+
}
131+
132+
@CheckForNull
133+
public Long getStart() {
134+
return start;
135+
}
110136

111137
@Override
112138
public String toString() {
@@ -119,11 +145,21 @@ public static class ErrorDetail implements Serializable {
119145
private static final long serialVersionUID = -9136704865403084083L;
120146

121147
@JsonProperty("code")
122-
int code;
148+
Integer code;
123149

124150
@JsonProperty("message")
125151
String message;
126152

153+
@CheckForNull
154+
public Integer getCode() {
155+
return code;
156+
}
157+
158+
@CheckForNull
159+
public String getMessage() {
160+
return message;
161+
}
162+
127163
@Override
128164
public String toString() {
129165
return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE).toString();

0 commit comments

Comments
 (0)