summaryrefslogtreecommitdiffstats
path: root/catalog-model
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-model')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java13
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java2
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/ToscaPropertyData.java31
3 files changed, 44 insertions, 2 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java
index d1bcedc8ea..be9bee0d53 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/AttributeDefinition.java
@@ -21,9 +21,10 @@ package org.openecomp.sdc.be.model;
import lombok.NoArgsConstructor;
import org.openecomp.sdc.be.datatypes.elements.AttributeDataDefinition;
+import org.openecomp.sdc.be.datatypes.elements.SchemaDefinition;
@NoArgsConstructor
-public class AttributeDefinition extends AttributeDataDefinition implements IOperationParameter, IComplexDefaultValue {
+public class AttributeDefinition extends AttributeDataDefinition implements IOperationParameter, IComplexDefaultValue, ToscaPropertyData {
public AttributeDefinition(final AttributeDataDefinition attributeDataDefinition) {
super(attributeDataDefinition);
@@ -49,4 +50,14 @@ public class AttributeDefinition extends AttributeDataDefinition implements IOpe
return "AttributeDefinition{" + "name=" + getName() + "uniqueId=" + getUniqueId() + "ownerId=" + getOwnerId() + "type=" + getType()
+ "description=" + getDescription() + "default=" + getDefaultValue() + '}';
}
+
+ @Override
+ public String getSchemaType() {
+ final SchemaDefinition schema = getSchema();
+ if (schema == null || schema.getProperty() == null) {
+ return null;
+ }
+ return schema.getProperty().getType();
+ }
+
}
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java
index 6e313eda6c..d9add3f425 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/PropertyDefinition.java
@@ -31,7 +31,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
import org.openecomp.sdc.be.model.operations.impl.PropertyOperation;
-public class PropertyDefinition extends PropertyDataDefinition implements IOperationParameter, IComplexDefaultValue {
+public class PropertyDefinition extends PropertyDataDefinition implements IOperationParameter, IComplexDefaultValue, ToscaPropertyData {
private List<PropertyConstraint> constraints;
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/ToscaPropertyData.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ToscaPropertyData.java
new file mode 100644
index 0000000000..14c95757c7
--- /dev/null
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/ToscaPropertyData.java
@@ -0,0 +1,31 @@
+/*
+ * -
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 2022 Nordix Foundation.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.be.model;
+
+/**
+ * Represents basic/common TOSCA Property, Attribute or Input methods
+ */
+public interface ToscaPropertyData {
+ String getUniqueId();
+ String getType();
+ String getSchemaType();
+}