Search in sources :

Example 1 with MetricObjectBuilder

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();
}
Also used : Float32(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ieee754.rev130819.Float32) ByteBufWriteUtil.writeFloat32(org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32) MetricObjectBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.metric.object.MetricObjectBuilder) BitArray(org.opendaylight.protocol.util.BitArray)

Aggregations

BitArray (org.opendaylight.protocol.util.BitArray)1 ByteBufWriteUtil.writeFloat32 (org.opendaylight.protocol.util.ByteBufWriteUtil.writeFloat32)1 Float32 (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ieee754.rev130819.Float32)1 MetricObjectBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.metric.object.MetricObjectBuilder)1