1 package dst.ass3.elastic;
3 import dst.ass3.messaging.RequestType;
5 import java.util.Objects;
8 * Value type that represents a container.
10 public class ContainerInfo {
13 * The name of the container image.
20 private String containerId;
23 * True if the container is running.
25 private boolean running;
28 * If the container is a worker (indicated by the image dst/ass3-worker), then this field should contain the worker
29 * type. Otherwise it can be null.
31 private RequestType workerType;
33 public String getImage() {
37 public void setImage(String image) {
41 public String getContainerId() {
45 public void setContainerId(String containerId) {
46 this.containerId = containerId;
49 public boolean isRunning() {
53 public void setRunning(boolean running) {
54 this.running = running;
58 public RequestType getWorkerType() {
62 public void setWorkerType(RequestType workerType) {
63 this.workerType = workerType;
67 public boolean equals(Object o) {
71 if (o == null || getClass() != o.getClass()) {
74 ContainerInfo that = (ContainerInfo) o;
75 return running == that.running &&
76 Objects.equals(image, that.image) &&
77 Objects.equals(containerId, that.containerId) &&
78 Objects.equals(workerType, that.workerType);
82 public int hashCode() {
84 return Objects.hash(image, containerId, running, workerType);
88 public String toString() {
89 return "ContainerInfo{" +
90 "image='" + image + '\'' +
91 ", containerId='" + containerId + '\'' +
92 ", running=" + running +
93 ", workerType='" + workerType + '\'' +