@Data
public class PropertyDataDefinition extends ToscaDataDefinition {
- protected boolean definition = false;
- protected Boolean hidden = Boolean.FALSE;
+ private boolean definition = false;
+ private Boolean hidden = Boolean.FALSE;
private String uniqueId;
// "boolean", "string", "float", "integer", "version" })
private String type;
private String label;
private Boolean immutable = Boolean.FALSE;
private Boolean mappedToComponentProperty = Boolean.TRUE;
+ /**
+ * @deprecated use {@link #toscaGetFunction#functionType} instead
+ */
+ @Deprecated
private ToscaGetFunctionType toscaGetFunctionType;
+ private ToscaGetFunctionDataDefinition toscaGetFunction;
private String inputPath;
private String status;
private String parentPropertyType;
private String subPropertyInputPath;
private List<Annotation> annotations;
- /**
- * The resource id which this property belongs to
- */
- private String parentUniqueId;
private List<GetInputValueDataDefinition> getInputValues;
private Boolean isDeclaredListInput = Boolean.FALSE;
private List<GetPolicyValueDataDefinition> getPolicyValues;
private List<String> propertyConstraints;
private Map<String, String> metadata;
+ private boolean userCreated;
public PropertyDataDefinition() {
super();
this.setModel(propertyDataDefinition.getModel());
this.setPropertyId(propertyDataDefinition.getPropertyId());
this.setToscaGetFunctionType(propertyDataDefinition.getToscaGetFunctionType());
+ this.setToscaGetFunction(propertyDataDefinition.getToscaGetFunction());
this.parentPropertyType = propertyDataDefinition.getParentPropertyType();
this.subPropertyInputPath = propertyDataDefinition.getSubPropertyInputPath();
if (isNotEmpty(propertyDataDefinition.annotations)) {
setPropertyConstraints(new ArrayList<>(propertyDataDefinition.getPropertyConstraints()));
}
this.setIsDeclaredListInput(propertyDataDefinition.getIsDeclaredListInput());
+ this.setUserCreated(propertyDataDefinition.isUserCreated());
}
// @Override
return null;
}
+ public ToscaGetFunctionType getToscaGetFunctionType() {
+ if (toscaGetFunction != null) {
+ return toscaGetFunction.getFunctionType();
+ }
+ return toscaGetFunctionType;
+ }
+
public Boolean isHidden() {
return hidden;
}
return mappedToComponentProperty;
}
+ /**
+ * The resource id which this property belongs to
+ */
public String getParentUniqueId() {
return getOwnerId();
}
public List<Annotation> getAnnotations() {
return (List<Annotation>) getToscaPresentationValue(JsonPresentationFields.ANNOTATIONS);
}
+
+ public boolean isGetFunction() {
+ return this.toscaGetFunctionType != null || this.toscaGetFunction != null;
+ }
+
+ public boolean hasGetFunction() {
+ return this.toscaGetFunction != null;
+ }
+
}