16 package org.openkilda.topo;
18 import static java.util.Collections.emptyMap;
19 import static java.util.Collections.unmodifiableMap;
24 import java.util.TreeSet;
35 private Map<String, Switch> switches;
36 private Map<String, Link> links;
39 this(emptyMap(), emptyMap());
42 public Topology(Map<String, Switch> switches, Map<String, Link> links) {
43 this.switches = unmodifiableMap(switches);
44 this.links = unmodifiableMap(links);
47 String printSwitchConnections() {
48 StringBuilder sb =
new StringBuilder(256);
49 sb.append(
"Links (Abbreviated){\n");
50 for (String key :
new TreeSet<>(links.keySet())) {
51 Link link = links.get(key);
53 sb.append(
"\t").append(s).append(
"\n");
63 if (switches.size() != other.
getSwitches().size()) {
66 if (links.size() != other.
getLinks().size()) {
71 if (!switches.entrySet().containsAll(other.
getSwitches().entrySet())) {
74 if (!other.
getSwitches().entrySet().containsAll(switches.entrySet())) {
79 if (!links.entrySet().containsAll(other.
getLinks().entrySet())) {
82 if (!other.
getLinks().entrySet().containsAll(links.entrySet())) {
Map< String, Switch > getSwitches()
Map< String, Link > getLinks()
static final String toString(Switch aSwitch)
Topology(Map< String, Switch > switches, Map< String, Link > links)
boolean equivalent(ITopology other)