Allow LinkCollectionIntent to accept other types of resources.
Change-Id: I54331506a8e58efa7235da86e604d174fd5a72ec
diff --git a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
index 6febfab..113845d 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
@@ -29,7 +29,7 @@
import java.util.Collection;
import java.util.Collections;
import java.util.List;
-
+import static com.google.common.base.MoreObjects.firstNonNull;
import static com.google.common.base.Preconditions.checkNotNull;
/**
@@ -195,6 +195,21 @@
/**
* Produces a collection of network resources from the given links.
*
+ * @param resources base resources
+ * @param links collection of links
+ * @return collection of resources
+ */
+ protected static Collection<NetworkResource> resources(Collection<NetworkResource> resources,
+ Collection<Link> links) {
+ return ImmutableSet.<NetworkResource>builder()
+ .addAll(firstNonNull(resources, ImmutableList.of()))
+ .addAll(links)
+ .build();
+ }
+
+ /**
+ * Produces a collection of network resources from the given links.
+ *
* @param links collection of links
* @return collection of link resources
*/