Search in sources :

Example 1 with AsNumberCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase in project bgpcep by opendaylight.

the class XROAsNumberSubobjectParser method serializeSubobject.

@Override
public void serializeSubobject(final Subobject subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof AsNumberCase, "Unknown subobject instance. Passed %s. Needed AsNumberCase.", subobject.getSubobjectType().getClass());
    final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
    XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
}
Also used : AsNumberCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase) ByteBuf(io.netty.buffer.ByteBuf)

Example 2 with AsNumberCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase in project bgpcep by opendaylight.

the class XROAsNumberSubobjectParser method serializeSubobject.

@Override
public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof AsNumberCase, "Unknown subobject instance. Passed %s. Needed AsNumberCase.", subobject.getSubobjectType().getClass());
    final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
    XROSubobjectUtil.formatSubobject(TYPE, subobject.isMandatory(), body, buffer);
}
Also used : AsNumberCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase) ByteBuf(io.netty.buffer.ByteBuf)

Example 3 with AsNumberCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase in project bgpcep by opendaylight.

the class AsNumberCaseParser method serializeSubobject.

public static ByteBuf serializeSubobject(final AsNumberCase asCase) {
    final AsNumberSubobject asNumber = asCase.getAsNumber();
    final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
    Preconditions.checkArgument(asNumber.getAsNumber() != null, "AsNumber is mandatory.");
    writeShort(asNumber.getAsNumber().getValue().shortValue(), body);
    return body;
}
Also used : AsNumberSubobject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AsNumberSubobject) ByteBuf(io.netty.buffer.ByteBuf)

Example 4 with AsNumberCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase in project bgpcep by opendaylight.

the class EROAsNumberSubobjectParser method serializeSubobject.

@Override
public void serializeSubobject(final SubobjectContainer subobject, final ByteBuf buffer) {
    Preconditions.checkArgument(subobject.getSubobjectType() instanceof AsNumberCase, "Unknown subobject instance. Passed %s. Needed AsNumberCase.", subobject.getSubobjectType().getClass());
    final ByteBuf body = AsNumberCaseParser.serializeSubobject((AsNumberCase) subobject.getSubobjectType());
    EROSubobjectUtil.formatSubobject(TYPE, subobject.isLoose(), body, buffer);
}
Also used : AsNumberCase(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase) ByteBuf(io.netty.buffer.ByteBuf)

Example 5 with AsNumberCase

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase in project bgpcep by opendaylight.

the class AsNumberCaseParser method serializeSubobject.

static ByteBuf serializeSubobject(final AsNumberCase asCase) {
    final AsNumberSubobject asNumber = asCase.getAsNumber();
    final ByteBuf body = Unpooled.buffer(CONTENT_LENGTH);
    Preconditions.checkArgument(asNumber.getAsNumber() != null, "AsNumber is mandatory.");
    writeShort(asNumber.getAsNumber().getValue().shortValue(), body);
    return body;
}
Also used : AsNumberSubobject(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AsNumberSubobject) ByteBuf(io.netty.buffer.ByteBuf)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)6 AsNumberCase (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.basic.explicit.route.subobjects.subobject.type.AsNumberCase)4 AsNumberSubobject (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.rsvp.rev150820.AsNumberSubobject)2