import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
private Boolean immutable = Boolean.FALSE;
private Boolean mappedToComponentProperty = Boolean.TRUE;
/**
- * @deprecated use {@link #toscaGetFunction#functionType} instead
+ * @deprecated use {@link #toscaFunction} instead
*/
@Deprecated
private ToscaGetFunctionType toscaGetFunctionType;
+ /**
+ * @deprecated use {@link #toscaFunction} instead
+ */
+ @Deprecated
private ToscaGetFunctionDataDefinition toscaGetFunction;
+ private ToscaFunction toscaFunction;
+ private Collection<SubPropertyToscaFunction> subPropertyToscaFunctions;
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;
this.setType(propertyDataDefinition.getType());
this.setName(propertyDataDefinition.getName());
this.setValue(propertyDataDefinition.getValue());
- this.setRequired(propertyDataDefinition.isRequired());
this.setHidden(propertyDataDefinition.isHidden());
this.setLabel(propertyDataDefinition.getLabel());
this.setImmutable(propertyDataDefinition.isImmutable());
this.setInstanceUniqueId(propertyDataDefinition.getInstanceUniqueId());
this.setModel(propertyDataDefinition.getModel());
this.setPropertyId(propertyDataDefinition.getPropertyId());
- this.setToscaGetFunctionType(propertyDataDefinition.getToscaGetFunctionType());
this.setToscaGetFunction(propertyDataDefinition.getToscaGetFunction());
+ this.setToscaGetFunctionType(propertyDataDefinition.getToscaGetFunctionType());
+ this.setToscaFunction(propertyDataDefinition.getToscaFunction());
this.parentPropertyType = propertyDataDefinition.getParentPropertyType();
this.subPropertyInputPath = propertyDataDefinition.getSubPropertyInputPath();
+ this.subPropertyToscaFunctions = propertyDataDefinition.getSubPropertyToscaFunctions();
if (isNotEmpty(propertyDataDefinition.annotations)) {
this.setAnnotations(propertyDataDefinition.annotations);
}
this.setUserCreated(propertyDataDefinition.isUserCreated());
}
- // @Override
public boolean isDefinition() {
return true;
}
}
public ToscaGetFunctionType getToscaGetFunctionType() {
- if (toscaGetFunction != null) {
- return toscaGetFunction.getFunctionType();
+ if (isToscaGetFunction() && toscaFunction != null) {
+ return ((ToscaGetFunctionDataDefinition) toscaFunction).getFunctionType();
}
- return toscaGetFunctionType;
+
+ return null;
}
public Boolean isHidden() {
return mappedToComponentProperty;
}
+ /**
+ * The resource id which this property belongs to
+ */
public String getParentUniqueId() {
return getOwnerId();
}
return (List<Annotation>) getToscaPresentationValue(JsonPresentationFields.ANNOTATIONS);
}
- public boolean isGetFunction() {
- return this.toscaGetFunctionType != null || this.toscaGetFunction != null;
+ @JsonIgnoreProperties
+ public boolean isToscaFunction() {
+ return this.toscaGetFunctionType != null || this.toscaFunction != null;
+ }
+
+ @JsonIgnoreProperties
+ public boolean isToscaGetFunction() {
+ return this.toscaFunction != null
+ && (this.toscaFunction.getType() == ToscaFunctionType.GET_ATTRIBUTE
+ || this.toscaFunction.getType() == ToscaFunctionType.GET_INPUT
+ || this.toscaFunction.getType() == ToscaFunctionType.GET_PROPERTY);
}
- public boolean hasGetFunction() {
- return this.toscaGetFunction != null;
+ @JsonIgnoreProperties
+ public boolean hasToscaFunction() {
+ return this.toscaFunction != null;
}
}