Update Events to 1.24 model (#669) · kylechase/docker-java@e95f786 · GitHub
Skip to content

Commit e95f786

Browse files
authored
Update Events to 1.24 model (docker-java#669)
* added event type in Event class docker-java#650 * added missing import for JsonProperty * added CheckForNull * Sync event model to 1.24 Signed-off-by: Kanstantsin Shautsou <kanstantsin.sha@gmail.com>
1 parent 36d17ca commit e95f786

5 files changed

Lines changed: 384 additions & 13 deletions

File tree

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

Lines changed: 171 additions & 13 deletions
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
package com.github.dockerjava.api.model;
2+
3+
import com.fasterxml.jackson.annotation.JsonProperty;
4+
import org.apache.commons.lang.builder.EqualsBuilder;
5+
import org.apache.commons.lang.builder.HashCodeBuilder;
6+
import org.apache.commons.lang.builder.ToStringBuilder;
7+
8+
import javax.annotation.CheckForNull;
9+
import java.io.Serializable;
10+
import java.util.Map;
11+
12+
/**
13+
* @author Kanstantsin Shautsou
14+
* @since 1.22
15+
*/
16+
public class EventActor implements Serializable {
17+
private static final long serialVersionUID = 1L;
18+
19+
/**
20+
* @since 1.22
21+
*/
22+
@JsonProperty("ID")
23+
private String id;
24+
25+
/**
26+
* @since 1.22
27+
*/
28+
@JsonProperty("Attributes")
29+
private Map<String, String> attributes;
30+
31+
/**
32+
* @see #id
33+
*/
34+
@CheckForNull
35+
public String getId() {
36+
return id;
37+
}
38+
39+
/**
40+
* @see #id
41+
*/
42+
public EventActor withId(String id) {
43+
this.id = id;
44+
return this;
45+
}
46+
47+
/**
48+
* @see #attributes
49+
*/
50+
@CheckForNull
51+
public Map<String, String> getAttributes() {
52+
return attributes;
53+
}
54+
55+
/**
56+
* @see #attributes
57+
*/
58+
public EventActor withAttributes(Map<String, String> attributes) {
59+
this.attributes = attributes;
60+
return this;
61+
}
62+
63+
@Override
64+
public String toString() {
65+
return ToStringBuilder.reflectionToString(this);
66+
}
67+
68+
@Override
69+
public boolean equals(Object o) {
70+
return EqualsBuilder.reflectionEquals(this, o);
71+
}
72+
73+
@Override
74+
public int hashCode() {
75+
return HashCodeBuilder.reflectionHashCode(this);
76+
}
77+
}
Lines changed: 55 additions & 0 deletions

0 commit comments

Comments
 (0)