Move ipv4/ipv6 ByteBuf utilities to Ipv{4,6}Util
[bgpcep.git] / bgp / extensions / flowspec / src / main / java / org / opendaylight / protocol / bgp / flowspec / handlers / FSIpv4SourcePrefixHandler.java
index c222eebabd18776edf758e985d3a4d60276cdc01..3205567967dc6a5e5ac43cf1d39cb261253fbb70 100644 (file)
@@ -7,11 +7,10 @@
  */
 package org.opendaylight.protocol.bgp.flowspec.handlers;
 
+import static com.google.common.base.Preconditions.checkArgument;
 import static java.util.Objects.requireNonNull;
 
-import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
-import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.protocol.util.Ipv4Util;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.flowspec.FlowspecType;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.flowspec.rev180329.flowspec.destination.group.ipv4.flowspec.flowspec.type.SourcePrefixCase;
@@ -22,9 +21,9 @@ public final class FSIpv4SourcePrefixHandler implements FlowspecTypeParser, Flow
 
     @Override
     public void serializeType(final FlowspecType value, final ByteBuf output) {
-        Preconditions.checkArgument(value instanceof SourcePrefixCase, "SourcePrefixCase class is mandatory!");
+        checkArgument(value instanceof SourcePrefixCase, "SourcePrefixCase class is mandatory!");
         output.writeByte(SOURCE_PREFIX_VALUE);
-        ByteBufWriteUtil.writeMinimalPrefix(((SourcePrefixCase) value).getSourcePrefix(), output);
+        Ipv4Util.writeMinimalPrefix(((SourcePrefixCase) value).getSourcePrefix(), output);
     }
 
     @Override