Search in sources :

Example 1 with GroupsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.GroupsBuilder in project netvirt by opendaylight.

the class StatisticsImpl method createGroupsResult.

private Groups createGroupsResult(String groupName, Map<String, BigInteger> countersMap) {
    GroupsBuilder gb = new GroupsBuilder();
    gb.setName(groupName);
    Map<String, Counters> counters = new HashMap<>();
    List<Counters> countersList = new ArrayList<>();
    for (String counterName : countersMap.keySet()) {
        addCountersToMap(countersMap, counters, counterName);
    }
    for (Counters counter : counters.values()) {
        countersList.add(counter);
    }
    gb.setCounters(countersList);
    return gb.build();
}
Also used : HashMap(java.util.HashMap) GroupsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.GroupsBuilder) ArrayList(java.util.ArrayList) Counters(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.groups.Counters)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 GroupsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.GroupsBuilder)1 Counters (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.groups.Counters)1