use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.Bandwidth1Builder in project bgpcep by opendaylight.
the class PcRptMessageCodecTest method testserializeObject.
@Test
public void testserializeObject() {
final PcRptMessageCodec codec = new PcRptMessageCodec(this.ctx.getObjectHandlerRegistry());
final ByteBuf buffer = Unpooled.buffer();
codec.serializeObject(new BandwidthBuilder().addAugmentation(new Bandwidth1Builder().setBwSample(BW).build()).build(), buffer);
assertTrue(buffer.readableBytes() > 0);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.pcep.auto.bandwidth.rev181109.Bandwidth1Builder in project bgpcep by opendaylight.
the class PcRptMessageCodec method setBandwidthUsage.
private static Bandwidth setBandwidthUsage(final Bandwidth bandwidth, final BandwidthUsage bwUsage) {
final BandwidthBuilder bandwidthBuilder;
if (bandwidth != null) {
bandwidthBuilder = new BandwidthBuilder(bandwidth);
} else {
bandwidthBuilder = new BandwidthBuilder();
}
bandwidthBuilder.addAugmentation(Bandwidth1.class, new Bandwidth1Builder().setBwSample(bwUsage.getBwSample()).build()).build();
return bandwidthBuilder.build();
}
Aggregations