Open Kilda Java Documentation
LinkMessage.java
Go to the documentation of this file.
1 package org.openkilda.simulator.messages;
2 
3 import com.fasterxml.jackson.annotation.JsonInclude;
4 import com.fasterxml.jackson.annotation.JsonProperty;
5 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
6 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
7 
8 import java.io.Serializable;
9 
10 import static com.google.common.base.MoreObjects.toStringHelper;
11 
12 @JsonSerialize
13 @JsonInclude(JsonInclude.Include.NON_NULL)
14 @JsonPropertyOrder(value = {
15  "latency",
16  "local_port",
17  "peer_switch",
18  "peer_port"})
19 
20 public class LinkMessage implements Serializable {
21  @JsonProperty("latency")
22  private int latency;
23 
24  @JsonProperty("local_port")
25  private int localPort;
26 
27  @JsonProperty("peer_switch")
28  private String peerSwitch;
29 
30  @JsonProperty("peer_port")
31  private int peerPort;
32 
33  public LinkMessage(@JsonProperty("latency") int latency,
34  @JsonProperty("local-port") int localPort,
35  @JsonProperty("peer_switch") String peerSwitch,
36  @JsonProperty("peer_port") int peerPort) {
37  this.latency = latency;
38  this.localPort = localPort;
39  this.peerSwitch = peerSwitch;
40  this.peerPort = peerPort;
41  }
42 
43  @Override
44  public String toString() {
45  return toStringHelper(this)
46  .add("latency", latency)
47  .toString();
48  }
49 
50  public int getLatency() {
51  return latency;
52  }
53 
54  public int getLocalPort() {
55  return localPort;
56  }
57 
58  public String getPeerSwitch() {
59  return peerSwitch;
60  }
61 
62  public int getPeerPort() {
63  return peerPort;
64  }
65 }
value
Definition: nodes.py:62