Open Kilda Java Documentation
LinkProps.java
Go to the documentation of this file.
1 package org.openkilda.model;
2 
3 import java.util.HashMap;
4 import java.util.Map;
5 
6 import com.fasterxml.jackson.annotation.JsonInclude;
7 import com.fasterxml.jackson.annotation.JsonProperty;
8 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
9 
10 @JsonSerialize
11 @JsonInclude(JsonInclude.Include.NON_NULL)
12 public class LinkProps {
13 
14  private static final String DEFAULT = "";
15  private String src_switch = DEFAULT;
16  private String src_port = DEFAULT;
17  private String dst_switch = DEFAULT;
18  private String dst_port = DEFAULT;
19  @JsonProperty("props")
20  private Map<String, String> props = new HashMap<>();
21 
25  public LinkProps() {}
26 
30  public LinkProps(Map<String, String> props) {
31  this.props = new HashMap<>(props);
32  }
33 
34  public String getProperty(String key) {
35  return props.getOrDefault(key, DEFAULT);
36  }
37 
38  public LinkProps setProperty(String key, String value) {
39  props.put(key, value);
40  return this;
41  }
42 
43  public String getSrc_switch() {
44  return src_switch;
45  }
46 
47  public void setSrc_switch(String src_switch) {
48  this.src_switch = src_switch;
49  }
50 
51  public String getSrc_port() {
52  return src_port;
53  }
54 
55  public void setSrc_port(String src_port) {
56  this.src_port = src_port;
57  }
58 
59  public String getDst_switch() {
60  return dst_switch;
61  }
62 
63  public void setDst_switch(String dst_switch) {
64  this.dst_switch = dst_switch;
65  }
66 
67  public String getDst_port() {
68  return dst_port;
69  }
70 
71  public void setDst_port(String dst_port) {
72  this.dst_port = dst_port;
73  }
74 }
value
Definition: nodes.py:62