aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorshiria <shiri.amichai@amdocs.com>2018-06-04 11:07:29 +0300
committerAvi Gaffa <avi.gaffa@amdocs.com>2018-06-05 14:31:34 +0000
commit09c6320df7f768e42edeaedd7ba69e6fb13d433d (patch)
tree92883e0297c3d47ab039685ca91f2f47a1dbcd46 /common
parentd9cae980e80021dfad0bc9366d32d2cf996cfa90 (diff)
fix get flat node type
update node type interface update return value to object which include the type hierarchy Change-Id: I97623c7bbad0223a174370d13aabf4c3efe9c21e Issue-ID: SDC-1394 Signed-off-by: shiria <shiri.amichai@amdocs.com>
Diffstat (limited to 'common')
-rw-r--r--common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinition.java7
-rw-r--r--common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinitionType.java121
-rw-r--r--common/onap-tosca-datatype/src/main/resources/globalTypes/tosca/groups.yml2
3 files changed, 62 insertions, 68 deletions
diff --git a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinition.java b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinition.java
index 28e871a454..053f0b33ec 100644
--- a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinition.java
+++ b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinition.java
@@ -13,13 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onap.sdc.tosca.datatypes.model;
-import java.util.Map;
+package org.onap.sdc.tosca.datatypes.model;
public abstract class InterfaceDefinition {
- protected Map<String, OperationDefinition> operations;
-
- public abstract void addOperation(String operationName, OperationDefinition operationDefinition);
+ public abstract void addOperation(String operationName, OperationDefinition operationDefinition);
}
diff --git a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinitionType.java b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinitionType.java
index 800786c1af..a8207ba828 100644
--- a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinitionType.java
+++ b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/InterfaceDefinitionType.java
@@ -24,75 +24,72 @@ import java.util.Map;
public class InterfaceDefinitionType extends InterfaceDefinition {
- private String type;
- private Map<String, PropertyDefinition> inputs;
- protected Map<String, OperationDefinitionType> operations;
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public Map<String, PropertyDefinition> getInputs() {
- return inputs;
- }
-
- public void setInputs(
- Map<String, PropertyDefinition> inputs) {
- this.inputs = inputs;
- }
-
- public Map<String, OperationDefinitionType> getOperations() {
- return operations;
- }
-
- public void setOperations(
- Map<String, OperationDefinitionType> operations) {
- this.operations = operations;
- }
-
- public void addOperation(String operationName, OperationDefinitionType operation) {
- if(MapUtils.isEmpty(this.operations)) {
- this.operations = new HashMap<>();
+ private String type;
+ private Map<String, PropertyDefinition> inputs;
+ private Map<String, OperationDefinitionType> operations;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Map<String, PropertyDefinition> getInputs() {
+ return inputs;
+ }
+
+ public void setInputs(Map<String, PropertyDefinition> inputs) {
+ this.inputs = inputs;
}
- this.operations.put(operationName, operation);
- }
+ public Map<String, OperationDefinitionType> getOperations() {
+ return operations;
+ }
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
+ public void setOperations(Map<String, OperationDefinitionType> operations) {
+ this.operations = operations;
}
- if (!(o instanceof InterfaceDefinitionType)) {
- return false;
+
+ public void addOperation(String operationName, OperationDefinitionType operation) {
+ if (MapUtils.isEmpty(this.operations)) {
+ this.operations = new HashMap<>();
+ }
+
+ this.operations.put(operationName, operation);
}
- InterfaceDefinitionType that = (InterfaceDefinitionType) o;
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof InterfaceDefinitionType)) {
+ return false;
+ }
+
+ InterfaceDefinitionType that = (InterfaceDefinitionType) o;
+
+ if (getType() != null ? !getType().equals(that.getType()) : that.getType() != null) {
+ return false;
+ }
+ if (getInputs() != null ? !getInputs().equals(that.getInputs()) : that.getInputs() != null) {
+ return false;
+ }
+ return getOperations() != null ? getOperations().equals(that.getOperations()) : that.getOperations() == null;
+ }
- if (getType() != null ? !getType().equals(that.getType()) : that.getType() != null) {
- return false;
+ @Override
+ public int hashCode() {
+ int result = getType() != null ? getType().hashCode() : 0;
+ result = 31 * result + (getInputs() != null ? getInputs().hashCode() : 0);
+ result = 31 * result + (getOperations() != null ? getOperations().hashCode() : 0);
+ return result;
}
- if (getInputs() != null ? !getInputs().equals(that.getInputs()) : that.getInputs() != null) {
- return false;
+
+ @Override
+ public void addOperation(String operationName, OperationDefinition operationDefinition) {
+ addOperation(operationName, (OperationDefinitionType) operationDefinition);
}
- return getOperations() != null ? getOperations().equals(that.getOperations())
- : that.getOperations() == null;
- }
-
- @Override
- public int hashCode() {
- int result = getType() != null ? getType().hashCode() : 0;
- result = 31 * result + (getInputs() != null ? getInputs().hashCode() : 0);
- result = 31 * result + (getOperations() != null ? getOperations().hashCode() : 0);
- return result;
- }
-
- @Override
- public void addOperation(String operationName, OperationDefinition operationDefinition) {
- addOperation(operationName, (OperationDefinitionType)operationDefinition);
- }
}
diff --git a/common/onap-tosca-datatype/src/main/resources/globalTypes/tosca/groups.yml b/common/onap-tosca-datatype/src/main/resources/globalTypes/tosca/groups.yml
index 0ddc15175c..907a9b8c22 100644
--- a/common/onap-tosca-datatype/src/main/resources/globalTypes/tosca/groups.yml
+++ b/common/onap-tosca-datatype/src/main/resources/globalTypes/tosca/groups.yml
@@ -26,5 +26,5 @@ group_types:
tosca.groups.Root:
description: This is the default (root) TOSCA Group Type definition that all other TOSCA base Group Types derive from.
interfaces:
- standard:
+ Standard:
type: tosca.interfaces.node.lifecycle.Standard