Search in sources :

Example 1 with UiLink

use of org.onosproject.ui.model.topo.UiLink in project onos by opennetworkinglab.

the class Topo2Jsonifier method json.

private ObjectNode json(Set<UiSynthLink> memberSet) {
    ArrayNode rollup = arrayNode();
    ObjectNode node = null;
    boolean first = true;
    for (UiSynthLink member : memberSet) {
        UiLink link = member.link();
        if (first) {
            node = json(link);
            first = false;
        }
        rollup.add(json(member.original()));
    }
    if (node != null) {
        node.set("rollup", rollup);
    }
    return node;
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) UiSynthLink(org.onosproject.ui.model.topo.UiSynthLink) UiLink(org.onosproject.ui.model.topo.UiLink) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode)

Aggregations

ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1 UiLink (org.onosproject.ui.model.topo.UiLink)1 UiSynthLink (org.onosproject.ui.model.topo.UiSynthLink)1