Luca Prete

Adding support to compare mp2p intents in intentUtils.

Change-Id: I7e8404f093e105379de0b55076a03723ba678fe9
...@@ -19,6 +19,7 @@ package org.onosproject.sdnip; ...@@ -19,6 +19,7 @@ package org.onosproject.sdnip;
19 import org.onosproject.net.intent.Intent; 19 import org.onosproject.net.intent.Intent;
20 import org.onosproject.net.intent.MultiPointToSinglePointIntent; 20 import org.onosproject.net.intent.MultiPointToSinglePointIntent;
21 import org.onosproject.net.intent.PointToPointIntent; 21 import org.onosproject.net.intent.PointToPointIntent;
22 +import org.onosproject.net.intent.SinglePointToMultiPointIntent;
22 import org.slf4j.Logger; 23 import org.slf4j.Logger;
23 import org.slf4j.LoggerFactory; 24 import org.slf4j.LoggerFactory;
24 25
...@@ -57,7 +58,15 @@ public final class IntentUtils { ...@@ -57,7 +58,15 @@ public final class IntentUtils {
57 return false; 58 return false;
58 } 59 }
59 60
60 - if (one instanceof MultiPointToSinglePointIntent) { 61 + if (one instanceof SinglePointToMultiPointIntent) {
62 + SinglePointToMultiPointIntent intent1 = (SinglePointToMultiPointIntent) one;
63 + SinglePointToMultiPointIntent intent2 = (SinglePointToMultiPointIntent) two;
64 +
65 + return Objects.equals(intent1.selector(), intent2.selector()) &&
66 + Objects.equals(intent1.treatment(), intent2.treatment()) &&
67 + Objects.equals(intent1.ingressPoint(), intent2.ingressPoint()) &&
68 + Objects.equals(intent1.egressPoints(), intent2.egressPoints());
69 + } else if (one instanceof MultiPointToSinglePointIntent) {
61 MultiPointToSinglePointIntent intent1 = (MultiPointToSinglePointIntent) one; 70 MultiPointToSinglePointIntent intent1 = (MultiPointToSinglePointIntent) one;
62 MultiPointToSinglePointIntent intent2 = (MultiPointToSinglePointIntent) two; 71 MultiPointToSinglePointIntent intent2 = (MultiPointToSinglePointIntent) two;
63 72
......