aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorandre.schmid <andre.schmid@est.tech>2021-05-14 20:38:45 +0100
committerChristophe Closset <christophe.closset@intl.att.com>2021-06-14 08:16:08 +0000
commitc82aebcde26e34c4151531b4d7a8f6e7689734ba (patch)
treefe14e6fadded7f43f9e1634b89d1fb9358b44253 /common
parentab6a90df6444ef7282fe9de8fe8107641bf7082f (diff)
Add models imports endpoint and persistence structure
Create the structure to persist the model imports. Changed create model API, allowing to create a model along its TOSCA descriptor import structure. Introduced an endpoint to update the imports of a model. Change-Id: Ic775ef544051c29c721cacc20b37c2fb20338be9 Issue-ID: SDC-3614 Signed-off-by: André Schmid <andre.schmid@est.tech>
Diffstat (limited to 'common')
-rw-r--r--common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinition.java57
-rw-r--r--common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/EntrySchema.java28
2 files changed, 13 insertions, 72 deletions
diff --git a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinition.java b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinition.java
index 144822d07d..ad38d6f1a1 100644
--- a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinition.java
+++ b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/CapabilityDefinition.java
@@ -21,8 +21,12 @@ package org.onap.sdc.tosca.datatypes.model;
import java.util.List;
import java.util.Map;
+import lombok.Getter;
+import lombok.Setter;
import org.onap.sdc.tosca.services.DataModelCloneUtil;
+@Getter
+@Setter
public class CapabilityDefinition implements Cloneable {
private String type;
@@ -32,63 +36,14 @@ public class CapabilityDefinition implements Cloneable {
private List<String> valid_source_types;
private Object[] occurrences;
- /**
- * Constructor.
- */
public CapabilityDefinition() {
- occurrences = new Object[2];
- occurrences[0] = 1;
- occurrences[1] = "UNBOUNDED";
+ occurrences = new Object[] {1, "UNBOUNDED"};
}
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
+ public CapabilityDefinition(final String type) {
this.type = type;
}
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public Map<String, PropertyDefinition> getProperties() {
- return properties;
- }
-
- public void setProperties(Map<String, PropertyDefinition> properties) {
- this.properties = properties;
- }
-
- public Map<String, AttributeDefinition> getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Map<String, AttributeDefinition> attributes) {
- this.attributes = attributes;
- }
-
- public List<String> getValid_source_types() {
- return valid_source_types;
- }
-
- public void setValid_source_types(List<String> valid_source_types) {
- this.valid_source_types = valid_source_types;
- }
-
- public Object[] getOccurrences() {
- return occurrences;
- }
-
- public void setOccurrences(Object[] occurrences) {
- this.occurrences = occurrences;
- }
-
@Override
public CapabilityDefinition clone() {
CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
diff --git a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/EntrySchema.java b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/EntrySchema.java
index 932e3c7836..7e08dd85bc 100644
--- a/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/EntrySchema.java
+++ b/common/onap-tosca-datatype/src/main/java/org/onap/sdc/tosca/datatypes/model/EntrySchema.java
@@ -20,38 +20,24 @@
package org.onap.sdc.tosca.datatypes.model;
import java.util.List;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
import org.onap.sdc.tosca.services.DataModelCloneUtil;
+@NoArgsConstructor
+@Getter
+@Setter
public class EntrySchema implements Cloneable {
private String description;
private String type;
private List<Constraint> constraints;
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
+ public EntrySchema(final String type) {
this.type = type;
}
- public List<Constraint> getConstraints() {
- return constraints;
- }
-
- public void setConstraints(List<Constraint> constraints) {
- this.constraints = constraints;
- }
-
@Override
public EntrySchema clone() {
EntrySchema entrySchema = new EntrySchema();