Remove Objects.{is,non}Null abuse
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / protocol / deserialization / match / Ipv6DestinationEntryDeserializer.java
index 06c13072c4b4257daff9cafb204de3b0aa883487..e902d9f94a1cff0aff358f67c588ed96d75a1995 100644 (file)
@@ -5,11 +5,9 @@
  * 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.openflowplugin.impl.protocol.deserialization.match;
 
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.impl.deserialization.match.OxmDeserializerHelper;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
@@ -43,12 +41,12 @@ public class Ipv6DestinationEntryDeserializer extends AbstractMatchEntryDeserial
     }
 
     private static void setPrefixMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder()
                     .setIpv6Destination(IpConversionUtil.createPrefix(address, mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6Match
-                && Objects.isNull(((Ipv6Match) builder.getLayer3Match()).getIpv6Destination())) {
+                && ((Ipv6Match) builder.getLayer3Match()).getIpv6Destination() == null) {
             builder.setLayer3Match(new Ipv6MatchBuilder((Ipv6Match) builder.getLayer3Match())
                     .setIpv6Destination(IpConversionUtil.createPrefix(address, mask))
                     .build());
@@ -57,16 +55,14 @@ public class Ipv6DestinationEntryDeserializer extends AbstractMatchEntryDeserial
         }
     }
 
-    private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address,
-                                          final byte[] mask) {
-        if (Objects.isNull(builder.getLayer3Match())) {
+    private static void setArbitraryMatch(final MatchBuilder builder, final Ipv6Address address, final byte[] mask) {
+        if (builder.getLayer3Match() == null) {
             builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder()
                     .setIpv6DestinationAddressNoMask(address)
                     .setIpv6DestinationArbitraryBitmask(IpConversionUtil.createIpv6ArbitraryBitMask(mask))
                     .build());
         } else if (builder.getLayer3Match() instanceof Ipv6MatchArbitraryBitMask
-                && Objects.isNull(((Ipv6MatchArbitraryBitMask) builder.getLayer3Match())
-                .getIpv6DestinationAddressNoMask())) {
+                && ((Ipv6MatchArbitraryBitMask) builder.getLayer3Match()).getIpv6DestinationAddressNoMask() == null) {
             final Ipv6MatchArbitraryBitMask match = (Ipv6MatchArbitraryBitMask) builder.getLayer3Match();
             builder.setLayer3Match(new Ipv6MatchArbitraryBitMaskBuilder(match)
                     .setIpv6DestinationAddressNoMask(address)
@@ -76,5 +72,4 @@ public class Ipv6DestinationEntryDeserializer extends AbstractMatchEntryDeserial
             throwErrorOnMalformed(builder, "layer3Match", "ipv6DestinationAddressNoMask");
         }
     }
-
 }