Merge "Added JSON and XML payloads tabs with RFC 8040 URL"
[openflowplugin.git] / openflowplugin-impl / src / main / java / org / opendaylight / openflowplugin / impl / protocol / serialization / messages / PortMessageSerializer.java
index 63058b70d1acc6e6ab4ebfb5afee77531bde3b60..ffcf596f0d4420abac00156167704e6211fd0ab2 100644 (file)
@@ -5,13 +5,11 @@
  * 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.messages;
 
 import com.google.common.base.MoreObjects;
 import com.google.common.collect.ImmutableMap;
 import io.netty.buffer.ByteBuf;
-import java.util.Objects;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
 import org.opendaylight.openflowplugin.api.openflow.md.util.OpenflowVersion;
 import org.opendaylight.openflowplugin.openflow.md.util.OpenflowPortsUtil;
@@ -29,7 +27,7 @@ public class PortMessageSerializer extends AbstractMessageSerializer<PortMessage
     private static final byte PADDING_IN_PORT_MOD_MESSAGE_01 = 4;
     private static final byte PADDING_IN_PORT_MOD_MESSAGE_02 = 2;
     private static final byte PADDING_IN_PORT_MOD_MESSAGE_03 = 4;
-    private static final int DEFAULT_PORT_CONFIG_MASK = createPortConfigBitMask(
+    private static final Integer DEFAULT_PORT_CONFIG_MASK = createPortConfigBitMask(
             new PortConfig(true, true, true, true));
 
     @Override
@@ -39,7 +37,7 @@ public class PortMessageSerializer extends AbstractMessageSerializer<PortMessage
         outBuffer.writeInt(OpenflowPortsUtil
                 .getProtocolPortNumber(OpenflowVersion.OF13, message.getPortNumber()).intValue());
         outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_01);
-        outBuffer.writeBytes(IetfYangUtil.INSTANCE.bytesFor(message.getHardwareAddress()));
+        outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(message.getHardwareAddress()));
         outBuffer.writeZero(PADDING_IN_PORT_MOD_MESSAGE_02);
         outBuffer.writeInt(createPortConfigBitMask(message.getConfiguration()));
         outBuffer.writeInt(MoreObjects
@@ -55,7 +53,7 @@ public class PortMessageSerializer extends AbstractMessageSerializer<PortMessage
     }
 
     private static Integer createPortConfigBitMask(final PortConfig config) {
-        return Objects.isNull(config) ? null : ByteBufUtils.fillBitMaskFromMap(ImmutableMap
+        return config == null ? null : ByteBufUtils.fillBitMaskFromMap(ImmutableMap
                 .<Integer, Boolean>builder()
                 .put(0, config.isPORTDOWN())
                 .put(2, config.isNORECV())