X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=pcep%2Fbase-parser%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fparser%2Fobject%2FPCEPClassTypeObjectParser.java;fp=pcep%2Fbase-parser%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fparser%2Fobject%2FPCEPClassTypeObjectParser.java;h=d880153ae8347bdc237e64cf54c096a570c12032;hb=59bd8a58570b93fef65340808e37cab3c6fced8c;hp=ad075640f7101d80651009d847316ec6297b5b5c;hpb=3b658310b793d4882ce59198a6d2563ce6ba114d;p=bgpcep.git diff --git a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPClassTypeObjectParser.java b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPClassTypeObjectParser.java index ad075640f7..d880153ae8 100644 --- a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPClassTypeObjectParser.java +++ b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/PCEPClassTypeObjectParser.java @@ -8,7 +8,6 @@ package org.opendaylight.protocol.pcep.parser.object; import static com.google.common.base.Preconditions.checkArgument; -import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedByte; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; @@ -23,6 +22,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.typ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.classtype.object.ClassType; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.classtype.object.ClassTypeBuilder; import org.opendaylight.yangtools.yang.common.Uint8; +import org.opendaylight.yangtools.yang.common.netty.ByteBufUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -30,7 +30,6 @@ import org.slf4j.LoggerFactory; * Parser for {@link ClassType}. */ public final class PCEPClassTypeObjectParser extends CommonObjectParser implements ObjectSerializer { - private static final Logger LOG = LoggerFactory.getLogger(PCEPClassTypeObjectParser.class); private static final int CLASS = 22; private static final int TYPE = 1; @@ -39,12 +38,10 @@ public final class PCEPClassTypeObjectParser extends CommonObjectParser implemen * Length of Class Type field in bits. */ private static final int CT_F_LENGTH = 3; - /** * Reserved field bit length. */ private static final int RESERVED = 29; - /** * Size of the object in bytes. */ @@ -88,7 +85,7 @@ public final class PCEPClassTypeObjectParser extends CommonObjectParser implemen final org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109 .ClassType classType = ((ClassType) object).getClassType(); checkArgument(classType != null, "ClassType is mandatory."); - writeUnsignedByte(classType.getValue(), body); + ByteBufUtils.write(body, classType.getValue()); ObjectUtil.formatSubobject(TYPE, CLASS, object.isProcessingRule(), object.isIgnore(), body, buffer); } }