Search in sources :

Example 1 with CountersBuilder

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

the class StatisticsImpl method buildCounter.

private Counters buildCounter(String counterName, BigInteger value, Counters prevCounter) {
    BigInteger prevValue = BigInteger.ZERO;
    if (prevCounter != null) {
        prevValue = prevCounter.getValue();
    }
    CountersBuilder cb = new CountersBuilder();
    cb.setName(counterName);
    cb.setValue(value.add(prevValue));
    return cb.build();
}
Also used : CountersBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.groups.CountersBuilder) BigInteger(java.math.BigInteger)

Aggregations

BigInteger (java.math.BigInteger)1 CountersBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.result.counterresult.groups.CountersBuilder)1