+ return true;
+ }
+
+ /**
+ * Explicit equals method to compare the 'match' for flows stored in the data-stores and flow fetched from the switch.
+ * Usecase: e.g If user don't set any ethernet source and destination address for match,data store will store null for
+ * these address.
+ * e.g [_ethernetMatch=EthernetMatch [_ethernetDestination=null, _ethernetSource=null, _ethernetType=
+ * EthernetType [_type=EtherType [_value=2048], _mask=null, augmentation=[]]
+ *
+ * But when you fetch the flows from switch, openflow driver library converts all zero bytes of mac address in the
+ * message stream to 00:00:00:00:00:00. Following string shows how library interpret the zero mac address bytes and
+ * eventually when translator convert it to MD-SAL match, this is how it looks
+ * [_ethernetDestination=EthernetDestination [_address=MacAddress [_value=00:00:00:00:00:00], _mask=null, augmentation=[]],
+ * _ethernetSource=EthernetSource [_address=MacAddress [_value=00:00:00:00:00:00], _mask=null, augmentation=[]],
+ * _ethernetType=EthernetType [_type=EtherType [_value=2048], _mask=null, augmentation=[]]
+ *
+ * Similarly for inPort, if user/application don't set any value for it, FRM will store null value for it in data store.
+ * When we fetch the same flow (with its statistics) from switch, plugin converts its value to openflow:X:0.
+ * e.g _inPort=Uri [_value=openflow:1:0]
+ *
+ * So this custom equals method add additional check to take care of these scenario, in case any match element is null in data-store-flow, but not
+ * in the flow fetched from switch.
+ *
+ * @param statsFlow
+ * @param storedFlow
+ * @return
+ */
+
+ public boolean matchEquals(Match statsFlow, Match storedFlow) {
+ if (statsFlow == storedFlow) {
+ return true;
+ }
+ if (storedFlow.getClass() != statsFlow.getClass()) {
+ return false;
+ }
+ if (storedFlow.getEthernetMatch() == null) {
+ if (statsFlow.getEthernetMatch() != null) {