Deprecate ByteBufUtils.macAddressToBytes()
[openflowplugin.git] / extension / openflowjava-extension-nicira / src / main / java / org / opendaylight / openflowjava / nx / codec / match / EthDstCodec.java
index 3bcd0a0f298354288b0a5e7732c7a75d17350c89..e7a29edf8fea96f0127b015626d7aa816e5193b7 100644 (file)
@@ -13,6 +13,7 @@ import org.opendaylight.openflowjava.protocol.api.keys.MatchEntrySerializerKey;
 import org.opendaylight.openflowjava.protocol.api.util.EncodeConstants;
 import org.opendaylight.openflowjava.protocol.api.util.OxmMatchConstants;
 import org.opendaylight.openflowjava.util.ByteBufUtils;
+import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.IetfYangUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.MatchField;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.Nxm0Class;
@@ -35,8 +36,8 @@ public class EthDstCodec extends AbstractMatchCodec {
     @Override
     public void serialize(MatchEntry input, ByteBuf outBuffer) {
         serializeHeader(input, outBuffer);
-        EthDstCaseValue ethDstCase = ((EthDstCaseValue) input.getMatchEntryValue());
-        outBuffer.writeBytes(ByteBufUtils.macAddressToBytes(ethDstCase.getEthDstValues().getMacAddress().getValue()));
+        EthDstCaseValue ethDstCase = (EthDstCaseValue) input.getMatchEntryValue();
+        outBuffer.writeBytes(IetfYangUtil.INSTANCE.macAddressBytes(ethDstCase.getEthDstValues().getMacAddress()));
     }
 
     @Override