Open Kilda Java Documentation
PortsCommandData.java
Go to the documentation of this file.
1 package org.openkilda.messaging.command.discovery;
2 
3 import com.fasterxml.jackson.annotation.JsonCreator;
4 import com.fasterxml.jackson.annotation.JsonInclude;
5 import com.fasterxml.jackson.annotation.JsonProperty;
6 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
7 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
9 
10 import java.util.Objects;
11 
12 @JsonSerialize
13 @JsonInclude(JsonInclude.Include.NON_NULL)
14 @JsonPropertyOrder({
15  "command",
16  "requester"})
17 
18 /*
19  * Command to request a list of all ports including port state
20  */
21 public class PortsCommandData extends CommandData {
22  private static final long serialVersionUID = 1L;
23 
24  @JsonProperty("requester")
25  private String requester;
26 
27  public PortsCommandData() {
28 
29  }
30 
31  @JsonCreator
32  public PortsCommandData(String requester) {
33  this.requester = requester;
34  }
35 
36  public String getRequester() {
37  return requester;
38  }
39 
40  public void setRequester(String requester) {
41  this.requester = requester;
42  }
43 
44  @Override
45  public String toString() {
46  return "PortsCommandData{" +
47  "requester='" + requester + '\'' +
48  ", timestamp=" + timestamp +
49  '}';
50  }
51 
52  @Override
53  public boolean equals(Object o) {
54  if (this == o) return true;
55  if (!(o instanceof PortsCommandData)) return false;
57  return Objects.equals(getRequester(), that.getRequester());
58  }
59 
60  @Override
61  public int hashCode() {
62 
63  return Objects.hash(getRequester());
64  }
65 }