Luca Prete

Adding support to compare mp2p intents in intentUtils.

Change-Id: I7e8404f093e105379de0b55076a03723ba678fe9
......@@ -19,6 +19,7 @@ package org.onosproject.sdnip;
import org.onosproject.net.intent.Intent;
import org.onosproject.net.intent.MultiPointToSinglePointIntent;
import org.onosproject.net.intent.PointToPointIntent;
import org.onosproject.net.intent.SinglePointToMultiPointIntent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -57,7 +58,15 @@ public final class IntentUtils {
return false;
}
if (one instanceof MultiPointToSinglePointIntent) {
if (one instanceof SinglePointToMultiPointIntent) {
SinglePointToMultiPointIntent intent1 = (SinglePointToMultiPointIntent) one;
SinglePointToMultiPointIntent intent2 = (SinglePointToMultiPointIntent) two;
return Objects.equals(intent1.selector(), intent2.selector()) &&
Objects.equals(intent1.treatment(), intent2.treatment()) &&
Objects.equals(intent1.ingressPoint(), intent2.ingressPoint()) &&
Objects.equals(intent1.egressPoints(), intent2.egressPoints());
} else if (one instanceof MultiPointToSinglePointIntent) {
MultiPointToSinglePointIntent intent1 = (MultiPointToSinglePointIntent) one;
MultiPointToSinglePointIntent intent2 = (MultiPointToSinglePointIntent) two;
......