use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.metric.object.MetricObjectBuilder in project bgpcep by opendaylight.
the class MetricObjectParser method localParseObject.
@Override
protected RsvpTeObject localParseObject(final ByteBuf byteBuf) throws RSVPParsingException {
final MetricObjectBuilder builder = new MetricObjectBuilder();
byteBuf.skipBytes(ByteBufWriteUtil.SHORT_BYTES_LENGTH);
final BitArray flags = BitArray.valueOf(byteBuf.readByte());
builder.setBound(flags.get(BOUND));
builder.setComputed(flags.get(COMPUTED));
builder.setMetricType(byteBuf.readUnsignedByte());
builder.setValue(new Float32(ByteArray.readBytes(byteBuf, METRIC_VALUE_F_LENGTH)));
return builder.build();
}
Aggregations