Remove Objects.{is,non}Null abuse
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / protocol / serialization / match / Ipv4DestinationEntrySerializer.java
index 9ce2860fb15d301579cf13b36433515eee29f84f..37d4cf88aa2ecc7ae45aea5b845a603795bca764 100644 (file)
@@ -5,12 +5,10 @@
  * 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.serialization.match;
 
 import io.netty.buffer.ByteBuf;
 import java.util.Iterator;
-import java.util.Objects;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.common.IpConversionUtil;
@@ -41,12 +39,11 @@ public class Ipv4DestinationEntrySerializer extends AbstractMatchEntrySerializer
     @Override
     public boolean matchTypeCheck(Match match) {
         if (isPrefix(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv4Match) match.getLayer3Match()).getIpv4Destination());
+            return match.getLayer3Match() != null
+                    && ((Ipv4Match) match.getLayer3Match()).getIpv4Destination() != null;
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(match.getLayer3Match())
-                    && Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv4DestinationAddressNoMask());
+            return match.getLayer3Match() != null
+                    && ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4DestinationAddressNoMask() != null;
         }
 
         return false;
@@ -63,8 +60,7 @@ public class Ipv4DestinationEntrySerializer extends AbstractMatchEntrySerializer
             // Check if we have mask
             return addressParts.hasNext() && Integer.parseInt(addressParts.next()) < 32;
         } else if (isArbitrary(match)) {
-            return Objects.nonNull(((Ipv4MatchArbitraryBitMask) match.getLayer3Match())
-                    .getIpv4DestinationArbitraryBitmask());
+            return ((Ipv4MatchArbitraryBitMask) match.getLayer3Match()).getIpv4DestinationArbitraryBitmask() != null;
         }
 
         return false;
@@ -92,5 +88,4 @@ public class Ipv4DestinationEntrySerializer extends AbstractMatchEntrySerializer
     protected int getValueLength() {
         return EncodeConstants.SIZE_OF_INT_IN_BYTES;
     }
-
 }