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%2FAbstractPccIdReqObjectParser.java;fp=pcep%2Fbase-parser%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fparser%2Fobject%2FAbstractPccIdReqObjectParser.java;h=a1ae5985d8dca4fb05049b6da18073a0206248f8;hb=12b06012259c6609c4b40488c8611a9431a39643;hp=2b3c42129350231e614fd73ace3cb61007a50d66;hpb=57c64bf6cae32b18b36956b33a3c956d9f0328e4;p=bgpcep.git diff --git a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractPccIdReqObjectParser.java b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractPccIdReqObjectParser.java index 2b3c421293..a1ae5985d8 100644 --- a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractPccIdReqObjectParser.java +++ b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/AbstractPccIdReqObjectParser.java @@ -5,16 +5,15 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.pcep.parser.object; -import com.google.common.base.Preconditions; +import static com.google.common.base.Preconditions.checkArgument; + import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import org.opendaylight.protocol.pcep.spi.CommonObjectParser; import org.opendaylight.protocol.pcep.spi.ObjectSerializer; import org.opendaylight.protocol.pcep.spi.ObjectUtil; -import org.opendaylight.protocol.util.ByteBufWriteUtil; import org.opendaylight.protocol.util.Ipv4Util; import org.opendaylight.protocol.util.Ipv6Util; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.Object; @@ -29,17 +28,17 @@ public abstract class AbstractPccIdReqObjectParser extends CommonObjectParser im @Override public void serializeObject(final Object object, final ByteBuf buffer) { - Preconditions.checkArgument(object instanceof PccIdReq, - "Wrong instance of PCEPObject. Passed %s. Needed PccIdReqObject.", object.getClass()); + checkArgument(object instanceof PccIdReq, "Wrong instance of PCEPObject. Passed %s. Needed PccIdReqObject.", + object.getClass()); final PccIdReq pccIdReq = (PccIdReq) object; if (pccIdReq.getIpAddress().getIpv4AddressNoZone() != null) { final ByteBuf body = Unpooled.buffer(Ipv4Util.IP4_LENGTH); - ByteBufWriteUtil.writeIpv4Address(pccIdReq.getIpAddress().getIpv4AddressNoZone(), body); + Ipv4Util.writeIpv4Address(pccIdReq.getIpAddress().getIpv4AddressNoZone(), body); ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.isProcessingRule(), object.isIgnore(), body, buffer); } else if (pccIdReq.getIpAddress().getIpv6AddressNoZone() != null) { final ByteBuf body = Unpooled.buffer(Ipv6Util.IPV6_LENGTH); - ByteBufWriteUtil.writeIpv6Address(pccIdReq.getIpAddress().getIpv6AddressNoZone(), body); + Ipv6Util.writeIpv6Address(pccIdReq.getIpAddress().getIpv6AddressNoZone(), body); ObjectUtil.formatSubobject(getObjectType(), getObjectClass(), object.isProcessingRule(), object.isIgnore(), body, buffer); }