@Test public void testAdjacencySids() throws Exception { assertThat(config.adjacencySids(), is(adjacencySids1)); }
public Map<Integer, Set<Integer>> adjacencySids() { if (!object.has(ADJSIDS)) { return null; } Map<Integer, Set<Integer>> adjacencySids = new HashMap<>(); ArrayNode adjacencySidsNode = (ArrayNode) object.path(ADJSIDS); for (JsonNode adjacencySidNode : adjacencySidsNode) { int asid = adjacencySidNode.path(ADJSID).asInt(-1); if (asid == -1) { return null; } HashSet<Integer> ports = new HashSet<>(); ArrayNode portsNode = (ArrayNode) adjacencySidNode.path(PORTS); for (JsonNode portNode : portsNode) { int port = portNode.asInt(-1); if (port == -1) { return null; } ports.add(port); } adjacencySids.put(asid, ports); } return ImmutableMap.copyOf(adjacencySids); }
SegmentRoutingDeviceConfig extends Config<DeviceId> { public Map<Integer, Set<Integer>> adjacencySids() { if (!object.has(ADJSIDS)) { return null; } Map<Integer, Set<Integer>> adjacencySids = new HashMap<>(); ArrayNode adjacencySidsNode = (ArrayNode) object.path(ADJSIDS); for (JsonNode adjacencySidNode : adjacencySidsNode) { int asid = adjacencySidNode.path(ADJSID).asInt(-1); if (asid == -1) { return null; } HashSet<Integer> ports = new HashSet<>(); ArrayNode portsNode = (ArrayNode) adjacencySidNode.path(PORTS); for (JsonNode portNode : portsNode) { int port = portNode.asInt(-1); if (port == -1) { return null; } ports.add(port); } adjacencySids.put(asid, ports); } return ImmutableMap.copyOf(adjacencySids); } }
SegmentRoutingDeviceConfig extends Config<DeviceId> { public Map<Integer, Set<Integer>> adjacencySids() { if (!object.has(ADJSIDS)) { return null; } Map<Integer, Set<Integer>> adjacencySids = new HashMap<>(); ArrayNode adjacencySidsNode = (ArrayNode) object.path(ADJSIDS); for (JsonNode adjacencySidNode : adjacencySidsNode) { int asid = adjacencySidNode.path(ADJSID).asInt(-1); if (asid == -1) { return null; } HashSet<Integer> ports = new HashSet<>(); ArrayNode portsNode = (ArrayNode) adjacencySidNode.path(PORTS); for (JsonNode portNode : portsNode) { int port = portNode.asInt(-1); if (port == -1) { return null; } ports.add(port); } adjacencySids.put(asid, ports); } return ImmutableMap.copyOf(adjacencySids); }  }
SegmentRoutingDeviceConfig extends Config<DeviceId> { public Map<Integer, Set<Integer>> adjacencySids() { if (!object.has(ADJSIDS)) { return null; } Map<Integer, Set<Integer>> adjacencySids = new HashMap<>(); ArrayNode adjacencySidsNode = (ArrayNode) object.path(ADJSIDS); for (JsonNode adjacencySidNode : adjacencySidsNode) { int asid = adjacencySidNode.path(ADJSID).asInt(-1); if (asid == -1) { return null; } HashSet<Integer> ports = new HashSet<>(); ArrayNode portsNode = (ArrayNode) adjacencySidNode.path(PORTS); for (JsonNode portNode : portsNode) { int port = portNode.asInt(-1); if (port == -1) { return null; } ports.add(port); } adjacencySids.put(asid, ports); } return ImmutableMap.copyOf(adjacencySids); }  @Override boolean isValid(); Optional<String> name(); SegmentRoutingDeviceConfig setName(String name); Ip4Address routerIp(); SegmentRoutingDeviceConfig setRouterIp(String ip); MacAddress routerMac(); SegmentRoutingDeviceConfig setRouterMac(String mac); int nodeSid(); SegmentRoutingDeviceConfig setNodeSid(int sid); Boolean isEdgeRouter(); SegmentRoutingDeviceConfig setIsEdgeRouter(boolean isEdgeRouter); Map<Integer, Set<Integer>> adjacencySids(); SegmentRoutingDeviceConfig setAdjacencySids(Map<Integer, Set<Integer>> adjacencySids); }
SegmentRoutingDeviceConfig extends Config<DeviceId> { public Map<Integer, Set<Integer>> adjacencySids() { if (!object.has(ADJSIDS)) { return null; } Map<Integer, Set<Integer>> adjacencySids = new HashMap<>(); ArrayNode adjacencySidsNode = (ArrayNode) object.path(ADJSIDS); for (JsonNode adjacencySidNode : adjacencySidsNode) { int asid = adjacencySidNode.path(ADJSID).asInt(-1); if (asid == -1) { return null; } HashSet<Integer> ports = new HashSet<>(); ArrayNode portsNode = (ArrayNode) adjacencySidNode.path(PORTS); for (JsonNode portNode : portsNode) { int port = portNode.asInt(-1); if (port == -1) { return null; } ports.add(port); } adjacencySids.put(asid, ports); } return ImmutableMap.copyOf(adjacencySids); }  @Override boolean isValid(); Optional<String> name(); SegmentRoutingDeviceConfig setName(String name); Ip4Address routerIp(); SegmentRoutingDeviceConfig setRouterIp(String ip); MacAddress routerMac(); SegmentRoutingDeviceConfig setRouterMac(String mac); int nodeSid(); SegmentRoutingDeviceConfig setNodeSid(int sid); Boolean isEdgeRouter(); SegmentRoutingDeviceConfig setIsEdgeRouter(boolean isEdgeRouter); Map<Integer, Set<Integer>> adjacencySids(); SegmentRoutingDeviceConfig setAdjacencySids(Map<Integer, Set<Integer>> adjacencySids);  }