Search in sources :

Example 1 with Type1Label

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.type1.label._case.Type1Label in project bgpcep by opendaylight.

the class Type1LabelParser method serializeLabel.

@Override
public void serializeLabel(final boolean unidirectional, final boolean global, final LabelType subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject instanceof Type1LabelCase, "Unknown Label Subobject instance. Passed {}. Needed Type1LabelCase.", subobject.getClass());
    final ByteBuf body = Unpooled.buffer(LABEL_LENGTH);
    final Type1Label type1Label = ((Type1LabelCase) subobject).getType1Label();
    Preconditions.checkArgument(type1Label != null, "Type1Label is mandatory.");
    writeUnsignedInt(type1Label.getType1Label(), body);
    LabelUtil.formatLabel(CTYPE, unidirectional, global, body, buffer);
}
Also used : Type1Label(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.type1.label._case.Type1Label) Type1LabelCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.Type1LabelCase) ByteBuf(io.netty.buffer.ByteBuf)

Example 2 with Type1Label

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.type1.label._case.Type1Label in project bgpcep by opendaylight.

the class Type1LabelParser method serializeLabel.

@Override
public void serializeLabel(final boolean unidirectional, final boolean global, final LabelType subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject instanceof Type1LabelCase, "Unknown Label Subobject instance. Passed {}. Needed Type1LabelCase.", subobject.getClass());
    final ByteBuf body = Unpooled.buffer(LABEL_LENGTH);
    final Type1Label type1Label = ((Type1LabelCase) subobject).getType1Label();
    Preconditions.checkArgument(type1Label != null, "Type1Label is mandatory.");
    writeUnsignedInt(type1Label.getType1Label(), body);
    LabelUtil.formatLabel(CTYPE, unidirectional, global, body, buffer);
}
Also used : Type1Label(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.type1.label._case.Type1Label) Type1LabelCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.Type1LabelCase) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)2 Type1LabelCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.Type1LabelCase)2 Type1Label (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.label.subobject.label.type.type1.label._case.Type1Label)2