+ toscaConstraints.add(constraint.toAuthorative());
+ }
+
+ toscaProperty.setConstraints(toscaConstraints);
+ }
+
+ if (entrySchema != null) {
+ toscaProperty.setEntrySchema(entrySchema.toAuthorative());
+ }
+
+ if (metadata != null) {
+ toscaProperty.setMetadata(new LinkedHashMap<>(metadata));
+ }
+
+ return toscaProperty;
+ }
+
+ @Override
+ public void fromAuthorative(ToscaProperty toscaProperty) {
+ this.setKey(new PfReferenceKey());
+ getKey().setLocalName(toscaProperty.getName());
+
+ if (toscaProperty.getTypeVersion() != null) {
+ type = new PfConceptKey(toscaProperty.getType(), toscaProperty.getTypeVersion());
+ } else {
+ type = new PfConceptKey(toscaProperty.getType(), PfKey.NULL_KEY_VERSION);
+ }
+
+ description = toscaProperty.getDescription();
+ required = toscaProperty.isRequired();
+ status = toscaProperty.getStatus();
+
+ if (toscaProperty.getDefaultValue() != null) {
+ defaultValue = new YamlJsonTranslator().toYaml(toscaProperty.getDefaultValue()).trim();
+ } else {
+ defaultValue = null;
+ }
+
+ if (toscaProperty.getConstraints() != null) {
+ constraints = new ArrayList<>();
+
+ for (ToscaConstraint toscaConstraint : toscaProperty.getConstraints()) {
+ constraints.add(JpaToscaConstraint.newInstance(toscaConstraint));