aboutsummaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-12-12 10:03:26 -0500
committerMuthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>2018-12-12 10:03:26 -0500
commit50e751e5374e1240080411400f4ae71d27115fa2 (patch)
tree8018fb524f6bc0e0b6df3f112e5cec3592c49976 /components
parenta567903b114503a13c225ed720a96391e75f0126 (diff)
Decompose enhancer to multiple types.
Change-Id: I508ce5919680f6e7f994776e58404729b55eace8 Issue-ID: CCSDK-803 Signed-off-by: Muthuramalingam, Brinda Santh(bs2796) <bs2796@att.com>
Diffstat (limited to 'components')
-rw-r--r--components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintEnhancer.kt13
1 files changed, 13 insertions, 0 deletions
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintEnhancer.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintEnhancer.kt
index 989617bd..cb835d73 100644
--- a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintEnhancer.kt
+++ b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/interfaces/BluePrintEnhancer.kt
@@ -102,16 +102,29 @@ interface BluePrintTypeEnhancerService {
doEnhancement(bluePrintContext, error, name, policyType, enhancers)
}
+ fun enhancePropertyDefinitions(bluePrintContext: BluePrintContext, error: BluePrintError, properties: MutableMap<String, PropertyDefinition>) {
+ properties.forEach { propertyName, propertyDefinition ->
+ enhancePropertyDefinition(bluePrintContext, error, propertyName, propertyDefinition)
+ }
+ }
+
fun enhancePropertyDefinition(bluePrintContext: BluePrintContext, error: BluePrintError, name: String, propertyDefinition: PropertyDefinition) {
val enhancers = getPropertyDefinitionEnhancers()
doEnhancement(bluePrintContext, error, name, propertyDefinition, enhancers)
}
+ fun enhanceAttributeDefinitions(bluePrintContext: BluePrintContext, error: BluePrintError, attributes: MutableMap<String, AttributeDefinition>) {
+ attributes.forEach { attributeName, attributeDefinition ->
+ enhanceAttributeDefinition(bluePrintContext, error, attributeName, attributeDefinition)
+ }
+ }
+
fun enhanceAttributeDefinition(bluePrintContext: BluePrintContext, error: BluePrintError, name: String, attributeDefinition: AttributeDefinition) {
val enhancers = getAttributeDefinitionEnhancers()
doEnhancement(bluePrintContext, error, name, attributeDefinition, enhancers)
}
+ @Suppress("UNCHECKED_CAST")
private fun <T> doEnhancement(bluePrintContext: BluePrintContext, error: BluePrintError, name: String, definition: Any, enhancers: List<BluePrintEnhancer<T>>) {
if (enhancers.isNotEmpty()) {
enhancers.forEach {