Implant vid-app-common org.onap.vid.job (main and test)
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / aaiTree / CollectionResource.kt
1 package org.onap.vid.model.aaiTree
2
3 import org.apache.commons.lang.StringUtils
4
5 fun isNfc(node: AAITreeNode): Boolean {
6     return node.type == NodeType.INSTANCE_GROUP &&
7             node.additionalProperties["instance-group-type"] != null &&
8             StringUtils.equalsIgnoreCase(node.additionalProperties["instance-group-type"].toString(), "L3-NETWORK")
9 }
10
11 class CollectionResource(node: AAITreeNode) : Node(node) {
12
13     val ncfs: Map<String, NCF> = node.children.filter { isNfc(it) }.map { it.uniqueNodeKey to NCF(it) }.toMap()
14
15 }