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%2Fend%2Fpoints%2FPCEPEndPointsIpv6ObjectParser.java;fp=pcep%2Fbase-parser%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fprotocol%2Fpcep%2Fparser%2Fobject%2Fend%2Fpoints%2FPCEPEndPointsIpv6ObjectParser.java;h=775961fa219e27c05d8e50a474e148abe0071844;hb=12b06012259c6609c4b40488c8611a9431a39643;hp=5399cde7ec51f7ef496c0a9a8d9051a1026ea76b;hpb=57c64bf6cae32b18b36956b33a3c956d9f0328e4;p=bgpcep.git diff --git a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPEndPointsIpv6ObjectParser.java b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPEndPointsIpv6ObjectParser.java index 5399cde7ec..775961fa21 100644 --- a/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPEndPointsIpv6ObjectParser.java +++ b/pcep/base-parser/src/main/java/org/opendaylight/protocol/pcep/parser/object/end/points/PCEPEndPointsIpv6ObjectParser.java @@ -7,9 +7,8 @@ */ package org.opendaylight.protocol.pcep.parser.object.end.points; -import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeIpv6Address; +import static com.google.common.base.Preconditions.checkArgument; -import com.google.common.base.Preconditions; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import org.opendaylight.protocol.pcep.spi.CommonObjectParser; @@ -47,19 +46,16 @@ public final class PCEPEndPointsIpv6ObjectParser extends CommonObjectParser { final Ipv6 ipv6, final ByteBuf buffer) { final ByteBuf body = Unpooled.buffer(Ipv6Util.IPV6_LENGTH + Ipv6Util.IPV6_LENGTH); - Preconditions.checkArgument(ipv6.getSourceIpv6Address() != null, - "SourceIpv6Address is mandatory."); - writeIpv6Address(ipv6.getSourceIpv6Address(), body); - Preconditions.checkArgument(ipv6.getDestinationIpv6Address() != null, - "DestinationIpv6Address is mandatory."); - writeIpv6Address(ipv6.getDestinationIpv6Address(), body); + checkArgument(ipv6.getSourceIpv6Address() != null, "SourceIpv6Address is mandatory."); + Ipv6Util.writeIpv6Address(ipv6.getSourceIpv6Address(), body); + checkArgument(ipv6.getDestinationIpv6Address() != null, "DestinationIpv6Address is mandatory."); + Ipv6Util.writeIpv6Address(ipv6.getDestinationIpv6Address(), body); ObjectUtil.formatSubobject(TYPE, CLASS, processing, ignore, body, buffer); } @Override public Object parseObject(final ObjectHeader header, final ByteBuf bytes) throws PCEPDeserializerException { - Preconditions.checkArgument(bytes != null && bytes.isReadable(), - "Array of bytes is mandatory. Can't be null or empty."); + checkArgument(bytes != null && bytes.isReadable(), "Array of bytes is mandatory. Can't be null or empty."); final EndpointsObjBuilder builder = new EndpointsObjBuilder(); if (!header.isProcessingRule()) { LOG.debug("Processed bit not set on Endpoints OBJECT, ignoring it.");