use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.waveband.switching.label._case.WavebandSwitchingLabel in project bgpcep by opendaylight.
the class WavebandSwitchingLabelParser method serializeLabel.
@Override
public final void serializeLabel(final boolean unidirectional, final boolean global, final LabelType subobject, final ByteBuf buffer) {
Preconditions.checkArgument(subobject instanceof WavebandSwitchingLabelCase, "Unknown Label Subobject instance. Passed {}. Needed WavebandSwitchingLabelCase.", subobject.getClass());
final WavebandSwitchingLabel obj = ((WavebandSwitchingLabelCase) subobject).getWavebandSwitchingLabel();
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
Preconditions.checkArgument(obj.getWavebandId() != null, "WavebandId is mandatory.");
writeUnsignedInt(obj.getWavebandId(), body);
Preconditions.checkArgument(obj.getStartLabel() != null, "StartLabel is mandatory.");
writeUnsignedInt(obj.getStartLabel(), body);
Preconditions.checkArgument(obj.getEndLabel() != null, "EndLabel is mandatory.");
writeUnsignedInt(obj.getEndLabel(), body);
LabelUtil.formatLabel(CTYPE, unidirectional, global, body, buffer);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.waveband.switching.label._case.WavebandSwitchingLabel in project bgpcep by opendaylight.
the class WavebandSwitchingLabelParser method serializeLabel.
@Override
public void serializeLabel(final boolean unidirectional, final boolean global, final LabelType subobject, final ByteBuf buffer) {
Preconditions.checkArgument(subobject instanceof WavebandSwitchingLabelCase, "Unknown Label Subobject instance. Passed {}. Needed WavebandSwitchingLabelCase.", subobject.getClass());
final WavebandSwitchingLabel obj = ((WavebandSwitchingLabelCase) subobject).getWavebandSwitchingLabel();
final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
Preconditions.checkArgument(obj.getWavebandId() != null, "WavebandId is mandatory.");
writeUnsignedInt(obj.getWavebandId(), body);
Preconditions.checkArgument(obj.getStartLabel() != null, "StartLabel is mandatory.");
writeUnsignedInt(obj.getStartLabel(), body);
Preconditions.checkArgument(obj.getEndLabel() != null, "EndLabel is mandatory.");
writeUnsignedInt(obj.getEndLabel(), body);
LabelUtil.formatLabel(CTYPE, unidirectional, global, body, buffer);
}
Aggregations