package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.List;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@Getter
+@Setter
+@NoArgsConstructor
+@ToString
public class AdditionalInfoParameterDataDefinition extends ToscaDataDefinition {
private String uniqueId;
-
private Long creationTime;
-
private Long modificationTime;
-
private Integer lastCreatedCounter = 0;
+ @ToString.Exclude
private List<AdditionalInfoParameterInfo> parameters;
- public AdditionalInfoParameterDataDefinition() {
-
- }
-
public AdditionalInfoParameterDataDefinition(AdditionalInfoParameterDataDefinition p) {
this.uniqueId = p.uniqueId;
this.creationTime = p.creationTime;
this.parameters = p.parameters;
}
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public Long getCreationTime() {
- return creationTime;
- }
-
- public void setCreationTime(Long creationTime) {
- this.creationTime = creationTime;
- }
-
- public Long getModificationTime() {
- return modificationTime;
- }
-
- public void setModificationTime(Long modificationTime) {
- this.modificationTime = modificationTime;
- }
-
- public Integer getLastCreatedCounter() {
- return lastCreatedCounter;
- }
-
- public void setLastCreatedCounter(Integer lastCreatedCounter) {
- this.lastCreatedCounter = lastCreatedCounter;
- }
-
- public List<AdditionalInfoParameterInfo> getParameters() {
- return parameters;
- }
-
- public void setParameters(List<AdditionalInfoParameterInfo> parameters) {
- this.parameters = parameters;
- }
-
- @Override
- public String toString() {
- return "AdditionalInfoParameterDataDefinition [uniqueId=" + uniqueId + ", creationTime=" + creationTime
- + ", modificationTime=" + modificationTime + ", lastCreatedCounter=" + lastCreatedCounter + "]";
- }
-
}
package org.openecomp.sdc.be.datatypes.elements;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@Getter
+@Setter
+@NoArgsConstructor
+@ToString
+@AllArgsConstructor
public class AdditionalInfoParameterInfo extends ToscaDataDefinition {
private String uniqueId;
private String key;
private String value;
- public AdditionalInfoParameterInfo() {
- super();
- }
-
public AdditionalInfoParameterInfo(String key, String value) {
this.key = key;
this.value = value;
}
- public AdditionalInfoParameterInfo(String uniqueId, String key, String value) {
- this.uniqueId = uniqueId;
- this.key = key;
- this.value = value;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public String getKey() {
- return key;
- }
-
- public void setKey(String key) {
- this.key = key;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- @Override
- public String toString() {
- return "AdditionalInfoParameterInfo [uniqueId=" + uniqueId + ", key=" + key + ", value=" + value + "]";
- }
-
}
import java.util.List;
import java.util.Map;
-import java.util.Objects;
-
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class Annotation {
+
+ @EqualsAndHashCode.Include
private String name;
+
private String type;
private String description;
private List<PropertyDataDefinition> properties;
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public List<PropertyDataDefinition> getProperties() {
- return properties;
- }
-
- public void setProperties(List<PropertyDataDefinition> properties) {
- this.properties = properties;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
public static void setAnnotationsName(Map<String, Annotation> annotations) {
annotations.forEach((name, annotation) -> annotation.setName(name));
}
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Annotation that = (Annotation) o;
- return Objects.equals(name, that.name);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(name);
- }
}
public class AnnotationTypeDataDefinition extends ToscaDataDefinition {
protected String uniqueId;
+
+ @ToString.Exclude
protected String type;
- protected String version;
- protected boolean highestVersion;
+
protected String description;
protected Long creationTime;
protected Long modificationTime;
+ protected String version;
+ protected boolean highestVersion;
+
public AnnotationTypeDataDefinition(AnnotationTypeDataDefinition other) {
uniqueId = other.uniqueId;
type = other.type;
modificationTime = other.modificationTime;
highestVersion = other.highestVersion;
}
+
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import org.openecomp.sdc.common.api.ArtifactGroupTypeEnum;
import org.openecomp.sdc.common.api.ArtifactTypeEnum;
public class ArtifactDataDefinition extends ToscaDataDefinition {
setArtifactVersion("0");
}
-
public ArtifactDataDefinition(ArtifactDataDefinition a) {
this.setUniqueId(a.getUniqueId());
this.setArtifactType(a.getArtifactType());
}
- public String getArtifactType() {
- return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_TYPE);
+ public void setArtifactName(String artifactName) {
+ setToscaPresentationValue(JsonPresentationFields.NAME, artifactName);
+
}
- public boolean isHeatEnvType() {
- return ArtifactTypeEnum.HEAT_ENV.getType().equals(getArtifactType());
+ public String getArtifactType() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_TYPE);
}
public void setArtifactType(String artifactType) {
}
+ public boolean isHeatEnvType() {
+ return ArtifactTypeEnum.HEAT_ENV.getType().equals(getArtifactType());
+ }
+
public String getArtifactRef() {
return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_REF);
setToscaPresentationValue(JsonPresentationFields.ARTIFACT_REPOSITORY, artifactRepository);
}
- public void setArtifactName(String artifactName) {
- setToscaPresentationValue(JsonPresentationFields.NAME, artifactName);
-
- }
-
public String getArtifactChecksum() {
return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_CHECKSUM);
}
return (String) getToscaPresentationValue(JsonPresentationFields.ES_ID);
}
- public boolean hasNoMandatoryEsId() {
- return getEsId() == null && getMandatory();
- }
-
public void setEsId(String esId) {
setToscaPresentationValue(JsonPresentationFields.ES_ID, esId);
}
+ public boolean hasNoMandatoryEsId() {
+ return getEsId() == null && getMandatory();
+ }
+
public String getArtifactCreator() {
return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_CREATOR);
}
return (String) getToscaPresentationValue(JsonPresentationFields.GENERATED_FROM_ID);
}
+ public void setGeneratedFromId(String generatedFromId) {
+ setToscaPresentationValue(JsonPresentationFields.GENERATED_FROM_ID, generatedFromId);
+ }
+
public boolean getIsFromCsar() {
Boolean isFromCsar = (Boolean) getToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR);
return isFromCsar == null ? Boolean.FALSE : isFromCsar;
setToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR, isFromCsar);
}
- public void setGeneratedFromId(String generatedFromId) {
- setToscaPresentationValue(JsonPresentationFields.GENERATED_FROM_ID, generatedFromId);
- }
-
-
@Override
public String toString() {
- return "ArtifactDataDefinition [uniqueId=" + getUniqueId() + ", artifactType=" + getArtifactType() + ", artifactRef=" + getArtifactRef() + ", artifactName=" + getArtifactName() + ", artifactRepository=" + getArtifactRepository() + ", artifactChecksum="
- + getArtifactChecksum() + ", userIdCreator=" + getUserIdCreator() + ", userIdLastUpdater=" + getUserIdLastUpdater() + ", creatorFullName=" + getCreatorFullName() + ", updaterFullName=" + getUpdaterFullName() + ", creationDate=" + getCreationDate()
- + ", lastUpdateDate=" + getLastUpdateDate() + ", esId=" + getEsId() + ", artifactLabel=" + getArtifactLabel() + ", artifactCreator=" + getArtifactCreator() + ", description=" + getDescription() + ", mandatory=" + getMandatory() + ", artifactDisplayName="
- + getArtifactDisplayName() + ", apiUrl=" + getApiUrl() + ", serviceApi=" + getServiceApi() + ", artifactGroupType=" + getArtifactGroupType() + ", timeout=" + getTimeout() + ", artifactVersion=" + getArtifactVersion() + ", artifactUUID=" + getArtifactUUID()
- + ", payloadUpdateDate=" + getPayloadUpdateDate() + ", heatParamsUpdateDate=" + getHeatParamsUpdateDate() + ", requiredArtifacts=" + getRequiredArtifacts() + "]";
+ return "ArtifactDataDefinition [uniqueId=" + getUniqueId() + ", artifactType=" + getArtifactType() + ", artifactRef=" + getArtifactRef()
+ + ", artifactName=" + getArtifactName() + ", artifactRepository=" + getArtifactRepository() + ", artifactChecksum="
+ + getArtifactChecksum() + ", userIdCreator=" + getUserIdCreator() + ", userIdLastUpdater=" + getUserIdLastUpdater() + ", creatorFullName="
+ + getCreatorFullName() + ", updaterFullName=" + getUpdaterFullName() + ", creationDate=" + getCreationDate()
+ + ", lastUpdateDate=" + getLastUpdateDate() + ", esId=" + getEsId() + ", artifactLabel=" + getArtifactLabel() + ", artifactCreator="
+ + getArtifactCreator() + ", description=" + getDescription() + ", mandatory=" + getMandatory() + ", artifactDisplayName="
+ + getArtifactDisplayName() + ", apiUrl=" + getApiUrl() + ", serviceApi=" + getServiceApi() + ", artifactGroupType="
+ + getArtifactGroupType() + ", timeout=" + getTimeout() + ", artifactVersion=" + getArtifactVersion() + ", artifactUUID="
+ + getArtifactUUID()
+ + ", payloadUpdateDate=" + getPayloadUpdateDate() + ", heatParamsUpdateDate=" + getHeatParamsUpdateDate() + ", requiredArtifacts="
+ + getRequiredArtifacts() + "]";
}
@Override
@NoArgsConstructor
public class AttributeDataDefinition extends ToscaDataDefinition {
- private transient List<GetOutputValueDataDefinition> getOutputValues;
+ private List<GetOutputValueDataDefinition> getOutputValues;
private String outputId;
private String value;
private String outputPath;
setToscaPresentationValue(JsonPresentationFields.OWNER_ID, ownerId);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(final String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
@Override
public String getType() {
return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
package org.openecomp.sdc.be.datatypes.elements;
import com.fasterxml.jackson.annotation.JsonCreator;
+import java.io.Serializable;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
-
public class CINodeFilterDataDefinition extends ToscaDataDefinition implements Serializable {
@JsonCreator
this.setCapabilities(inData.getCapabilities());
}
- public void setTosca_id(Object tosca_id) {
- setToscaPresentationValue(JsonPresentationFields.TOSCA_ID, tosca_id);
- }
-
public Object getTosca_id() {
return getToscaPresentationValue(JsonPresentationFields.TOSCA_ID);
}
+ public void setTosca_id(Object tosca_id) {
+ setToscaPresentationValue(JsonPresentationFields.TOSCA_ID, tosca_id);
+ }
+
public ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> getProperties() {
return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue(
- JsonPresentationFields.PROPERTIES);
+ JsonPresentationFields.PROPERTIES);
}
public void setProperties(ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> properties) {
public ListDataDefinition<RequirementNodeFilterCapabilityDataDefinition> getCapabilities() {
return (ListDataDefinition<RequirementNodeFilterCapabilityDataDefinition>) getToscaPresentationValue(
- JsonPresentationFields.NODE_FILTER_CAPABILITIES);
+ JsonPresentationFields.NODE_FILTER_CAPABILITIES);
}
public void setCapabilities(ListDataDefinition<RequirementNodeFilterCapabilityDataDefinition> capabilities) {
setToscaPresentationValue(JsonPresentationFields.NODE_FILTER_CAPABILITIES, capabilities);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public String getID() {
return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
}
setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, name);
}
-
}
package org.openecomp.sdc.be.datatypes.elements;
import com.google.common.collect.Lists;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.ArrayList;
import java.util.List;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
/**
* Represents the capability of the component or component instance
setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public String getParentName() {
return (String) getToscaPresentationValue(JsonPresentationFields.PARENT_NAME);
}
setToscaPresentationValue(JsonPresentationFields.PREVIOUS_NAME, previousName);
}
+ @Override
public String getType() {
return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
}
+ @Override
public void setType(String type) {
setToscaPresentationValue(JsonPresentationFields.TYPE, type);
}
setToscaPresentationValue(JsonPresentationFields.CAPABILITY_SOURCES, capabilitySources);
}
- public void setPath(List<String> path) {
- setToscaPresentationValue(JsonPresentationFields.PATH, path);
- }
-
@SuppressWarnings("unchecked")
public List<String> getPath() {
return (List<String>) getToscaPresentationValue(JsonPresentationFields.PATH);
}
- public void setSource(String source) {
- setToscaPresentationValue(JsonPresentationFields.SOURCE, source);
+ public void setPath(List<String> path) {
+ setToscaPresentationValue(JsonPresentationFields.PATH, path);
}
public String getSource() {
return (String) getToscaPresentationValue(JsonPresentationFields.SOURCE);
}
+ public void setSource(String source) {
+ setToscaPresentationValue(JsonPresentationFields.SOURCE, source);
+ }
+
/**
* Adds the element to the path avoiding duplication
*
String maxOccurrences = this.getMaxOccurrences();
String source = this.getSource();
-
return "CapabilityDefinition [uniqueId=" + uniqueId + ", description=" + description + ", name=" + name
- + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", capabilitySources="
- + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + ownerName
- + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path + ", source=" + source + "]";
+ + ", type=" + type + ", validSourceTypes=" + validSourceTypes + ", capabilitySources="
+ + capabilitySources + ", ownerId=" + ownerId + ", ownerName=" + ownerName
+ + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + ", path=" + path + ", source=" + source + "]";
}
public enum OwnerType {
this.value = value;
}
- public String getValue() {
- return value;
- }
-
public static OwnerType getByValue(String value) {
for (OwnerType type : values()) {
if (type.getValue().equals(value)) {
return null;
}
+ public String getValue() {
+ return value;
+ }
+
}
}
package org.openecomp.sdc.be.datatypes.elements;
+import java.util.List;
+import lombok.NoArgsConstructor;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.util.List;
-
+@NoArgsConstructor
public class CapabilityTypeDataDefinition extends ToscaDataDefinition {
public CapabilityTypeDataDefinition(CapabilityTypeDataDefinition cdt) {
this.setModificationTime(cdt.getModificationTime());
}
- public CapabilityTypeDataDefinition() {
- super();
- }
-
public String getUniqueId() {
return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
}
setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
}
+ @Override
public String getType() {
return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
}
+ @Override
public void setType(String type) {
setToscaPresentationValue(JsonPresentationFields.TYPE, type);
}
setToscaPresentationValue(JsonPresentationFields.VALID_SOURCE_TYPE, validSourceTypes);
}
+ @Override
public String getVersion() {
return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
}
Long modificationTime = getModificationTime();
return "CapabilityTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type
- + ", validSourceTypes=" + validSourceTypes + ", version=" + version + ", creationTime=" + creationTime
- + ", modificationTime=" + modificationTime + "]";
+ + ", validSourceTypes=" + validSourceTypes + ", version=" + version + ", creationTime=" + creationTime
+ + ", modificationTime=" + modificationTime + "]";
}
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.apache.commons.collections.CollectionUtils;
-import org.openecomp.sdc.be.datatypes.enums.CreatedFrom;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import org.openecomp.sdc.common.util.ValidationUtils;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
+import org.apache.commons.collections.CollectionUtils;
+import org.openecomp.sdc.be.datatypes.enums.CreatedFrom;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.enums.OriginTypeEnum;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import org.openecomp.sdc.common.util.ValidationUtils;
public class ComponentInstanceDataDefinition extends ToscaDataDefinition {
public void setModificationTime(Long modificationTime) {
setToscaPresentationValue(JsonPresentationFields.MODIFICATION_TIME, modificationTime);
- }
+ }
- public CreatedFrom getCreatedFrom() {
- String createdFrom = (String) getToscaPresentationValue(JsonPresentationFields.CREATED_FROM);
- return Objects.nonNull(createdFrom) ? CreatedFrom.valueOf(createdFrom) : null;
- }
+ public CreatedFrom getCreatedFrom() {
+ String createdFrom = (String) getToscaPresentationValue(JsonPresentationFields.CREATED_FROM);
+ return Objects.nonNull(createdFrom) ? CreatedFrom.valueOf(createdFrom) : null;
+ }
- public void setCreatedFrom(CreatedFrom createdFrom) {
- if (Objects.nonNull(createdFrom)){
- setToscaPresentationValue(JsonPresentationFields.CREATED_FROM, createdFrom.name());
- }
+ public void setCreatedFrom(CreatedFrom createdFrom) {
+ if (Objects.nonNull(createdFrom)) {
+ setToscaPresentationValue(JsonPresentationFields.CREATED_FROM, createdFrom.name());
+ }
}
public String getDescription() {
setToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_UID, resourceUid);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
public void setName(String name) {
if (this.getInvariantName() == null && name != null) {
this.setInvariantName(ValidationUtils.normalizeComponentInstanceName(name));
return (String) getToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_VERSION);
}
+ public void setComponentVersion(String resourceVersion) {
+ setToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_VERSION, resourceVersion);
+ }
+
public String getToscaComponentName() {
return (String) getToscaPresentationValue(JsonPresentationFields.CI_TOSCA_COMPONENT_NAME);
}
setToscaPresentationValue(JsonPresentationFields.CI_TOSCA_COMPONENT_NAME, toscaComponentName);
}
- public void setComponentVersion(String resourceVersion) {
- setToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_VERSION, resourceVersion);
+ public String getSourceModelUuid() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_UUID);
}
public void setSourceModelUuid(String targetModelUuid) {
setToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_UUID, targetModelUuid);
}
- public void setSourceModelUid(String targetModelUid) {
- setToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_UID, targetModelUid);
+ public String getSourceModelUid() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_UID);
}
- public void setSourceModelName(String targetModelName) {
- setToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_NAME, targetModelName);
+ public void setSourceModelUid(String targetModelUid) {
+ setToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_UID, targetModelUid);
}
- public void setSourceModelInvariant(String targetModelInvariant) {
- setToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_INVARIANT, targetModelInvariant);
+ public String getSourceModelName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_NAME);
}
- public String getSourceModelUuid() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_UUID);
+ public void setSourceModelName(String targetModelName) {
+ setToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_NAME, targetModelName);
}
- public String getSourceModelUid() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_UID);
+ public String getSourceModelInvariant() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_INVARIANT);
}
- public String getSourceModelName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_NAME);
+ public void setSourceModelInvariant(String targetModelInvariant) {
+ setToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_INVARIANT, targetModelInvariant);
}
- public String getSourceModelInvariant() {
- return (String) getToscaPresentationValue(JsonPresentationFields.CI_SOURCE_MODEL_INVARIANT);
+ public Boolean getIsProxy() {
+ Boolean isProxy = (Boolean) getToscaPresentationValue(JsonPresentationFields.CI_IS_PROXY);
+ return (isProxy != null) ? isProxy : false;
}
public void setIsProxy(Boolean isProxy) {
}
}
- public Boolean getIsProxy() {
- Boolean isProxy = (Boolean) getToscaPresentationValue(JsonPresentationFields.CI_IS_PROXY);
- return (isProxy != null) ? isProxy : false;
- }
-
public Boolean isServiceSubstitution() {
return getOriginType() == OriginTypeEnum.ServiceSubstitution;
}
setToscaPresentationValue(JsonPresentationFields.CI_DIRECTIVES, directives);
}
- public Map<String, ToscaArtifactDataDefinition> getToscaArtifacts() {
- return ( Map<String, ToscaArtifactDataDefinition>) getToscaPresentationValue(JsonPresentationFields.CI_ARTIFACTS);
+ public Map<String, ToscaArtifactDataDefinition> getToscaArtifacts() {
+ return (Map<String, ToscaArtifactDataDefinition>) getToscaPresentationValue(JsonPresentationFields.CI_ARTIFACTS);
}
- public void setToscaArtifacts(Map<String, ToscaArtifactDataDefinition> artifacts) {
- if (artifacts == null){
+ public void setToscaArtifacts(Map<String, ToscaArtifactDataDefinition> artifacts) {
+ if (artifacts == null) {
artifacts = new HashMap<>();
}
setToscaPresentationValue(JsonPresentationFields.CI_ARTIFACTS, artifacts);
@Override
public String toString() {
return "ComponentInstanceDataDefinition [icon=" + getIcon() + ", uniqueId=" + getUniqueId() + ", name="
- + getName() + ", normalizedName=" + getNormalizedName() + ", componentUid=" + getComponentUid()
- + ", creationTime=" + getCreationTime() + ", modificationTime=" + getModificationTime()
- + ", description=" + getDescription() + ", posX=" + getPosX() + ", posY=" + getPosY()
- + ", propertyValueCounter=" + getPropertyValueCounter() + ", attributeValueCounter="
- + getAttributeValueCounter() + ", inputValueCounter=" + getInputValueCounter() + ", originType="
- + getOriginType() + ", customizationUUID=" + getCustomizationUUID() + ", componentName="
- + getComponentName() + ", componentVersion=" + getComponentVersion() + ", toscaComponentName="
- + getToscaComponentName() + ", directives =" + getDirectivesString() + "]";
+ + getName() + ", normalizedName=" + getNormalizedName() + ", componentUid=" + getComponentUid()
+ + ", creationTime=" + getCreationTime() + ", modificationTime=" + getModificationTime()
+ + ", description=" + getDescription() + ", posX=" + getPosX() + ", posY=" + getPosY()
+ + ", propertyValueCounter=" + getPropertyValueCounter() + ", attributeValueCounter="
+ + getAttributeValueCounter() + ", inputValueCounter=" + getInputValueCounter() + ", originType="
+ + getOriginType() + ", customizationUUID=" + getCustomizationUUID() + ", componentName="
+ + getComponentName() + ", componentVersion=" + getComponentVersion() + ", toscaComponentName="
+ + getToscaComponentName() + ", directives =" + getDirectivesString() + "]";
}
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.HashMap;
import java.util.Map;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
public class CompositionDataDefinition extends ToscaDataDefinition {
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
-import org.apache.commons.lang3.builder.HashCodeExclude;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
@Getter
package org.openecomp.sdc.be.datatypes.elements;
+import java.util.List;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.util.List;
-
@Getter
@Setter
@NoArgsConstructor
+++ /dev/null
-package org.openecomp.sdc.be.datatypes.elements;
-
-import java.util.List;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.NoArgsConstructor;
-import lombok.Setter;
-import org.onap.sdc.tosca.datatypes.model.Constraint;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
-@Getter
-@Setter
-@AllArgsConstructor
-@NoArgsConstructor
-public class EntrySchemaDataDefinition extends ToscaDataDefinition {
-
- private String description;
- private String type;
- private List<Constraint> constraints;
-
-}
package org.openecomp.sdc.be.datatypes.elements;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.DESCRIPTION;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.PATH_DESTINATION_PORT_NUMBER;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.PATH_ELEMENT_LIST;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.UNIQUE_ID;
+import com.fasterxml.jackson.annotation.JsonCreator;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+
public class ForwardingPathDataDefinition extends ToscaDataDefinition {
@JsonCreator
public ForwardingPathDataDefinition() {
- super();
}
public ForwardingPathDataDefinition(String name) {
- super();
setName(name);
-
}
public ForwardingPathDataDefinition(ForwardingPathDataDefinition path) {
import com.fasterxml.jackson.annotation.JsonCreator;
import com.google.common.base.MoreObjects;
+import java.util.Objects;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.util.Objects;
-
public class ForwardingPathElementDataDefinition extends ToscaDataDefinition {
+
@JsonCreator
public ForwardingPathElementDataDefinition() {
- super();
}
- public ForwardingPathElementDataDefinition(String fromNode, String toNode, String fromCPName, String toCPName, String fromCPOriginId, String toCPOriginId) {
+ public ForwardingPathElementDataDefinition(String fromNode, String toNode, String fromCPName, String toCPName, String fromCPOriginId,
+ String toCPOriginId) {
super();
setFromNode(fromNode);
setToNode(toNode);
}
ForwardingPathElementDataDefinition that = (ForwardingPathElementDataDefinition) o;
return Objects.equals(getFromNode(), that.getFromNode()) && Objects.equals(getToNode(), that.getToNode())
- && Objects.equals(getFromCPOriginId(), that.getFromCPOriginId()) && Objects.equals(getToCPOriginId(), that.getToCPOriginId());
+ && Objects.equals(getFromCPOriginId(), that.getFromCPOriginId()) && Objects.equals(getToCPOriginId(), that.getToCPOriginId());
}
@Override
@Override
public String toString() {
return MoreObjects.toStringHelper(this)
- .add("fromNode", getFromNode()).add("toNode", getToNode())
- .add("fromCPOriginId", getFromCPOriginId()).add("toCPOriginId", getToCPOriginId())
- .add("fromCPName", getFromCP()).add("toCPName", getToCP()).toString();
+ .add("fromNode", getFromNode()).add("toNode", getToNode())
+ .add("fromCPOriginId", getFromCPOriginId()).add("toCPOriginId", getToCPOriginId())
+ .add("fromCPName", getFromCP()).add("toCPName", getToCP()).toString();
}
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.Map;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode
+@ToString
public class GetInputValueDataDefinition extends ToscaDataDefinition {
private String propName;
private String inputName;
+
+ @EqualsAndHashCode.Exclude
+ @ToString.Exclude
private String inputId;
+
private Integer indexValue;
private GetInputValueDataDefinition getInputIndex;
private boolean isList = false;
- public GetInputValueDataDefinition() {
- super();
- }
-
public GetInputValueDataDefinition(Map<String, Object> pr) {
super(pr);
}
this.setIndexValue(p.getIndexValue());
this.setGetInputIndex(p.getGetInputIndex());
this.setList(p.isList());
-
-
- }
-
- public String getPropName() {
- return propName;
- }
-
- public void setPropName(String propName) {
- this.propName = propName;
- }
-
- public String getInputName() {
- return inputName;
- }
-
- public void setInputName(String inputName) {
- this.inputName = inputName;
- }
-
- public Integer getIndexValue() {
- return indexValue;
- }
-
- public void setIndexValue(Integer indexValue) {
- this.indexValue = indexValue;
}
- public GetInputValueDataDefinition getGetInputIndex() {
- return getInputIndex;
- }
-
- public void setGetInputIndex(GetInputValueDataDefinition getInputIndex) {
- this.getInputIndex = getInputIndex;
- }
-
- public boolean isList() {
- return isList;
- }
-
- public void setList(boolean isList) {
- this.isList = isList;
- }
-
-
- public String getInputId() {
- return inputId;
- }
-
- public void setInputId(String inputId) {
- this.inputId = inputId;
- }
-
- @Override
- public String toString() {
- return "GetInputValueDataDefinition [propName=" + propName + ", inputName=" + inputName + ", indexValue=" + indexValue + ", getInputIndex=" + getInputIndex + ", isList=" + isList + "]";
- }
-
- @Override
- public int hashCode() {
- final int hashingNumerList = 1231;
- final int hashingNumerNoList = 1237;
- final int prime = 31;
- int result = 1;
- result = prime * result + ((getInputIndex == null) ? 0 : getInputIndex.hashCode());
- result = prime * result + ((indexValue == null) ? 0 : indexValue.hashCode());
- result = prime * result + ((inputName == null) ? 0 : inputName.hashCode());
- result = prime * result + (isList ? hashingNumerList : hashingNumerNoList);
- result = prime * result + ((propName == null) ? 0 : propName.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- GetInputValueDataDefinition other = (GetInputValueDataDefinition) obj;
- if (getInputIndex == null) {
- if (other.getInputIndex != null) {
- return false;
- }
- } else if (!getInputIndex.equals(other.getInputIndex)) {
- return false;
- }
- if (indexValue == null) {
- if (other.indexValue != null) {
- return false;
- }
- } else if (!indexValue.equals(other.indexValue)) {
- return false;
- }
- if (inputName == null) {
- if (other.inputName != null) {
- return false;
- }
- } else if (!inputName.equals(other.inputName)) {
- return false;
- }
- if (isList != other.isList) {
- return false;
- }
- if (propName == null) {
- return other.propName == null;
- } else {
- return propName.equals(other.propName);
- }
- }
-
-
}
import java.util.Map;
import lombok.EqualsAndHashCode;
import lombok.Getter;
+import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
@Getter
@Setter
+@NoArgsConstructor
@EqualsAndHashCode
@ToString
public class GetOutputValueDataDefinition extends ToscaDataDefinition {
private GetOutputValueDataDefinition getOutputIndex;
private boolean isList;
- public GetOutputValueDataDefinition() {
- super();
- }
-
public GetOutputValueDataDefinition(Map<String, Object> pr) {
super(pr);
}
import lombok.EqualsAndHashCode;
import lombok.Getter;
+import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
+@NoArgsConstructor
@EqualsAndHashCode
public class GetPolicyValueDataDefinition {
+
private String policyId;
private String propertyName;
private String origPropertyValue;
package org.openecomp.sdc.be.datatypes.elements;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import org.openecomp.sdc.be.datatypes.enums.CreatedFrom;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import static java.util.Collections.emptyMap;
+import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.openecomp.sdc.be.datatypes.enums.CreatedFrom;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import static java.util.Collections.emptyMap;
-
-
+@Getter
+@Setter
+@NoArgsConstructor
public class GroupDataDefinition extends ToscaDataDefinition {
+
@JsonInclude
private String typeUid;
@JsonInclude
private Integer propertyValueCounter = 0;
- public GroupDataDefinition() {
- }
-
public GroupDataDefinition(Map<String, Object> gr) {
super(gr);
propertyValueCounter = 0;
this.setTypeUid(other.typeUid);
}
-
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public String getInvariantName() {
String invariantName = (String) getToscaPresentationValue(JsonPresentationFields.CI_INVARIANT_NAME);
return invariantName == null ? getName() : invariantName;
setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
}
+ @Override
public String getType() {
return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
}
+ @Override
public void setType(String type) {
setToscaPresentationValue(JsonPresentationFields.TYPE, type);
}
+ @Override
public String getVersion() {
return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
}
setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
}
- public Integer getPropertyValueCounter() {
- return propertyValueCounter;
- }
-
- public void setPropertyValueCounter(Integer propertyValueCounter) {
- this.propertyValueCounter = propertyValueCounter;
- }
-
public String getGroupUUID() {
return (String) getToscaPresentationValue(JsonPresentationFields.GROUP_UUID);
}
return (Map<String, String>) getToscaPresentationValue(JsonPresentationFields.GROUP_MEMBER);
}
+ public void setMembers(Map<String, String> members) {
+ setToscaPresentationValue(JsonPresentationFields.GROUP_MEMBER, members);
+ }
+
//this is used by GroupCompositionMixin
public Map<String, String> resolveMembersList() {
Map<String, String> members = getMembers();
}
- public void setMembers(Map<String, String> members) {
- setToscaPresentationValue(JsonPresentationFields.GROUP_MEMBER, members);
- }
-
public List<String> getArtifacts() {
return (List<String>) getToscaPresentationValue(JsonPresentationFields.GROUP_ARTIFACTS);
}
setToscaPresentationValue(JsonPresentationFields.GROUP_PROPERTIES, properties);
}
- public String getTypeUid() {
- return typeUid;
- }
-
- public void setTypeUid(String typeUid) {
- this.typeUid = typeUid;
- }
-
public boolean isUserDefined() {
return CreatedFrom.UI.equals(getCreatedFrom());
}
@Override
public String toString() {
- return "GroupDataDefinition [propertyValueCounter=" + propertyValueCounter + ", toscaPresentation=" + toscaPresentation + ", getName()=" + getName() + ", getUniqueId()=" + getUniqueId() + ", getType()=" + getType() + ", getVersion()="
- + getVersion() + ", getInvariantUUID()=" + getInvariantUUID() + ", getDescription()=" + getDescription() + ", getPropertyValueCounter()=" + getPropertyValueCounter() + ", getGroupUUID()=" + getGroupUUID() + ", getMembers()="
- + getMembers() + ", getArtifacts()=" + getArtifacts() + ", getArtifactsUuid()=" + getArtifactsUuid() + ", getClass()=" + getClass() + ", hashCode()=" + hashCode() + ", toString()="
- + super.toString() + "]";
+ return "GroupDataDefinition [propertyValueCounter=" + propertyValueCounter + ", toscaPresentation=" + toscaPresentation + ", getName()="
+ + getName() + ", getUniqueId()=" + getUniqueId() + ", getType()=" + getType() + ", getVersion()="
+ + getVersion() + ", getInvariantUUID()=" + getInvariantUUID() + ", getDescription()=" + getDescription() + ", getPropertyValueCounter()="
+ + getPropertyValueCounter() + ", getGroupUUID()=" + getGroupUUID() + ", getMembers()="
+ + getMembers() + ", getArtifacts()=" + getArtifacts() + ", getArtifactsUuid()=" + getArtifactsUuid() + ", getClass()=" + getClass()
+ + ", hashCode()=" + hashCode() + ", toString()="
+ + super.toString() + "]";
}
-
public boolean containsInstanceAsMember(String instanceId) {
return getMembers() != null && getMembers().values().contains(instanceId);
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import lombok.NoArgsConstructor;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@NoArgsConstructor
public class GroupInstanceDataDefinition extends ToscaDataDefinition {
- public GroupInstanceDataDefinition() {
- super();
- }
-
public GroupInstanceDataDefinition(Map<String, Object> gi) {
super(gi);
}
setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public String getNormalizedName() {
return (String) getToscaPresentationValue(JsonPresentationFields.NORMALIZED_NAME);
}
setToscaPresentationValue(JsonPresentationFields.INVARIANT_UUID, invariantUUID);
}
+ @Override
public String getType() {
return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
}
+ @Override
public void setType(String type) {
setToscaPresentationValue(JsonPresentationFields.TYPE, type);
}
setToscaPresentationValue(JsonPresentationFields.GROUP_UUID, groupUUID);
}
+ @Override
public String getVersion() {
return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
}
import java.util.List;
import java.util.Map;
-
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@ToString
public class GroupTypeDataDefinition extends ToscaTypeDataDefinition {
private String uniqueId;
*/
private Long modificationTime;
- public GroupTypeDataDefinition() {
- }
-
public GroupTypeDataDefinition(GroupTypeDataDefinition other) {
super(other);
this.uniqueId = other.uniqueId;
this.derivedFrom = other.derivedFrom;
}
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public List<String> getMembers() {
- return members;
- }
-
- public void setMembers(List<String> members) {
- this.members = members;
- }
-
- public Map<String, String> getMetadata() {
- return metadata;
- }
-
- public void setMetadata(Map<String, String> metadata) {
- this.metadata = metadata;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public Long getCreationTime() {
- return creationTime;
- }
-
- public void setCreationTime(Long creationTime) {
- this.creationTime = creationTime;
- }
-
- public Long getModificationTime() {
- return modificationTime;
- }
-
- public void setModificationTime(Long modificationTime) {
- this.modificationTime = modificationTime;
- }
-
- @Override
- public String toString() {
- return "GroupTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + getType() + ", name=" + getName() + ", icon=" + getIcon() + ", version=" + version
- + ", members=" + members + ", metadata=" + metadata + ", description=" + description + ", creationTime="
- + creationTime + ", modificationTime=" + modificationTime + "]";
- }
-
- public String getDerivedFrom() {
- return derivedFrom;
- }
-
- public void setDerivedFrom(String derivedFrom) {
- this.derivedFrom = derivedFrom;
- }
-
- public boolean isHighestVersion() {
- return highestVersion;
- }
-
- public void setHighestVersion(boolean isLatestVersion) {
- this.highestVersion = isLatestVersion;
- }
-
}
package org.openecomp.sdc.be.datatypes.elements;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode
+@ToString
public class HeatParameterDataDefinition extends ToscaDataDefinition {
private String uniqueId;
private String currentValue;
private String defaultValue;
- public HeatParameterDataDefinition() {
- }
-
public HeatParameterDataDefinition(HeatParameterDataDefinition hp) {
this.uniqueId = hp.uniqueId;
this.name = hp.name;
this.defaultValue = hp.defaultValue;
}
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getCurrentValue() {
- return currentValue;
- }
-
- public void setCurrentValue(String currentValue) {
- this.currentValue = currentValue;
- }
-
- public String getDefaultValue() {
- return defaultValue;
- }
-
- public void setDefaultValue(String defaultValue) {
- this.defaultValue = defaultValue;
- }
-
- @Override
- public String toString() {
- return "HeatParameterDataDefinition [uniqueId=" + uniqueId + ", name=" + name + ", type=" + type
- + ", description=" + description + ", currentValue=" + currentValue + ", defaultValue=" + defaultValue
- + "]";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((currentValue == null) ? 0 : currentValue.hashCode());
- result = prime * result + ((defaultValue == null) ? 0 : defaultValue.hashCode());
- result = prime * result + ((description == null) ? 0 : description.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- result = prime * result + ((type == null) ? 0 : type.hashCode());
- result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- HeatParameterDataDefinition other = (HeatParameterDataDefinition) obj;
- if (currentValue == null) {
- if (other.currentValue != null) {
- return false;
- }
- } else if (!currentValue.equals(other.currentValue)) {
- return false;
- }
- if (defaultValue == null) {
- if (other.defaultValue != null) {
- return false;
- }
- } else if (!defaultValue.equals(other.defaultValue)) {
- return false;
- }
- if (description == null) {
- if (other.description != null) {
- return false;
- }
- } else if (!description.equals(other.description)) {
- return false;
- }
- if (name == null) {
- if (other.name != null) {
- return false;
- }
- } else if (!name.equals(other.name)) {
- return false;
- }
- if (type == null) {
- if (other.type != null) {
- return false;
- }
- } else if (!type.equals(other.type)) {
- return false;
- }
- if (uniqueId == null) {
- return other.uniqueId == null;
- } else {
- return uniqueId.equals(other.uniqueId);
- }
- }
}
package org.openecomp.sdc.be.datatypes.elements;
import java.util.Map;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
public class InputDataDefinition extends PropertyDataDefinition {
- InputDataDefinition() {
- super();
- }
-
InputDataDefinition(Map<String, Object> pr) {
super(pr);
}
package org.openecomp.sdc.be.datatypes.elements;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@Getter
+@Setter
+@NoArgsConstructor
public class InputsValueDataDefinition extends ToscaDataDefinition {
+
private String name;
private String value;
private String uniqueId;
this.value = value;
}
- public InputsValueDataDefinition() {
- super();
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
}
package org.openecomp.sdc.be.datatypes.elements;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
+import com.fasterxml.jackson.annotation.JsonCreator;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
-
-import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
public class InterfaceDataDefinition extends ToscaDataDefinition implements Serializable {
setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
}
+ @Override
public void setType(String type) {
setToscaPresentationValue(JsonPresentationFields.TYPE, type);
}
return (String) getToscaPresentationValue(TOSCA_RESOURCE_NAME);
}
+ public void setToscaResourceName(String toscaResourceName) {
+ setToscaPresentationValue(TOSCA_RESOURCE_NAME, toscaResourceName);
+ }
+
public Map<String, OperationDataDefinition> getOperations() {
return (Map<String, OperationDataDefinition>) getToscaPresentationValue(JsonPresentationFields.OPERATIONS);
}
setToscaPresentationValue(JsonPresentationFields.OPERATIONS, operations);
}
- public void setToscaResourceName(String toscaResourceName) {
- setToscaPresentationValue(TOSCA_RESOURCE_NAME, toscaResourceName);
- }
-
public Long getCreationDate() {
return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_DATE);
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
public class InterfaceInstanceDataDefinition extends ToscaDataDefinition implements Serializable {
public InterfaceInstanceDataDefinition(
- InterfaceInstanceDataDefinition inter) {
+ InterfaceInstanceDataDefinition inter) {
this.toscaPresentation = null;
- setInputs(inter.getInputs() == null ? new HashMap() : new HashMap<>(inter.getInputs()));
+ setInputs(inter.getInputs() == null ? new HashMap<String, Object>() : new HashMap<>(inter.getInputs()));
setOperations(new HashMap<>(inter.getOperations()));
}
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.List;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
public class ListCapabilityDataDefinition extends ListDataDefinition<CapabilityDataDefinition> {
public ListCapabilityDataDefinition(ListCapabilityDataDefinition cdt) {
super(listToscaDataDefinition);
}
- public ListCapabilityDataDefinition() {
- super();
-
- }
-
@JsonValue
@Override
public List<CapabilityDataDefinition> getListToscaDataDefinition() {
package org.openecomp.sdc.be.datatypes.elements;
import com.fasterxml.jackson.annotation.JsonCreator;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
public class ListDataDefinition<T extends ToscaDataDefinition> extends ToscaDataDefinition {
Map<String, T> mapByName = listToMapByName(listToscaDataDefinition);
List<T> otherList = ((ListDataDefinition) other).getListToscaDataDefinition();
for (T item : otherList) {
- mapByName.merge((String) item.getToscaPresentationValue(JsonPresentationFields.NAME), item, (thisItem, otherItem) -> thisItem.mergeFunction(otherItem, allowDefaultValueOverride));
+ mapByName.merge((String) item.getToscaPresentationValue(JsonPresentationFields.NAME), item,
+ (thisItem, otherItem) -> thisItem.mergeFunction(otherItem, allowDefaultValueOverride));
}
((ListDataDefinition) other).listToscaDataDefinition = mapByName.values().stream().collect(Collectors.toList());
return other;
list.forEach(e -> {
String nameFromPrev = (String) e.getToscaPresentationValue(JsonPresentationFields.NAME);
if (nameFromPrev != null) {
- Optional<T> findAny = (Optional<T>) listToscaDataDefinition.stream().filter(o -> nameFromPrev.equals(e.getToscaPresentationValue(JsonPresentationFields.NAME))).findAny();
+ Optional<T> findAny = (Optional<T>) listToscaDataDefinition.stream()
+ .filter(o -> nameFromPrev.equals(e.getToscaPresentationValue(JsonPresentationFields.NAME))).findAny();
if (findAny.isPresent()) {
e.mergeFunction(findAny.get(), allowDefaultValueOverride);
}
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.List;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+@Getter
+@Setter
+@NoArgsConstructor
public class ListMapPropertiesDataDefinition extends ListDataDefinition<MapPropertiesDataDefinition> {
public ListMapPropertiesDataDefinition(ListMapPropertiesDataDefinition cdt) {
super(listToscaDataDefinition);
}
- public ListMapPropertiesDataDefinition() {
- super();
-
- }
-
@JsonValue
@Override
public List<MapPropertiesDataDefinition> getListToscaDataDefinition() {
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.List;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
public class ListRequirementDataDefinition extends ListDataDefinition<RequirementDataDefinition> {
public ListRequirementDataDefinition(ListRequirementDataDefinition cdt) {
super(listToscaDataDefinition);
}
- public ListRequirementDataDefinition() {
- super();
-
- }
-
@JsonValue
@Override
public List<RequirementDataDefinition> getListToscaDataDefinition() {
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.Map;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+@Getter
+@Setter
+@NoArgsConstructor
public class MapArtifactDataDefinition extends MapDataDefinition<ArtifactDataDefinition> {
private String parentName;
super(mapToscaDataDefinition);
}
- public MapArtifactDataDefinition() {
- super();
-
- }
-
@JsonValue
@Override
public Map<String, ArtifactDataDefinition> getMapToscaDataDefinition() {
this.mapToscaDataDefinition = mapToscaDataDefinition;
}
- public String getParentName() {
- return parentName;
- }
-
- public void setParentName(String parentName) {
- this.parentName = parentName;
- }
-
-
}
import java.util.HashMap;
import java.util.Map;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
@Getter
@Setter
*/
public MapAttributesDataDefinition(MapAttributesDataDefinition toBeDeepCopiedMapPropertiesDataDefinition) {
this.parentName = toBeDeepCopiedMapPropertiesDataDefinition.parentName;
- this.toscaPresentation = toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation == null ? null : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation);
- this.mapToscaDataDefinition = toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition == null ? null : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition);
+ this.toscaPresentation = toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation == null ? null
+ : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation);
+ this.mapToscaDataDefinition = toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition == null ? null
+ : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition);
}
-
@JsonValue
@Override
public Map<String, AttributeDataDefinition> getMapToscaDataDefinition() {
return mapToscaDataDefinition;
}
-
public void setMapToscaDataDefinition(Map<String, AttributeDataDefinition> mapToscaDataDefinition) {
this.mapToscaDataDefinition = mapToscaDataDefinition;
}
+
}
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.Map;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
public class MapCapabilityProperty extends MapDataDefinition<MapPropertiesDataDefinition> {
+
@JsonCreator
public MapCapabilityProperty(Map<String, MapPropertiesDataDefinition> mapToscaDataDefinition) {
super(mapToscaDataDefinition);
}
- public MapCapabilityProperty() {
- super();
-
- }
-
@JsonValue
@Override
public Map<String, MapPropertiesDataDefinition> getMapToscaDataDefinition() {
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
/**
* Maps an object type (e.g. "monitoring", "workflows" etc) to a list of external references.
- *
- * "monitoring" -> { "ref1", "ref2" },
- * "workflows" -> { "ref1", "ref2" }
+ * <p>
+ * "monitoring" -> { "ref1", "ref2" }, "workflows" -> { "ref1", "ref2" }
*/
public class MapComponentInstanceExternalRefs extends ToscaDataDefinition {
return (Map<String, List<String>>) getToscaPresentationValue(JsonPresentationFields.EXTERNAL_REF);
}
- public List<String> getExternalRefsByObjectType(String objectType) {
- return ((Map<String, List<String>>) getToscaPresentationValue(JsonPresentationFields.EXTERNAL_REF)).get(objectType);
- }
-
public void setComponentInstanceExternalRefs(Map<String, List<String>> componentInstanceExternalRefs) {
setToscaPresentationValue(JsonPresentationFields.EXTERNAL_REF, componentInstanceExternalRefs);
}
+ public List<String> getExternalRefsByObjectType(String objectType) {
+ return ((Map<String, List<String>>) getToscaPresentationValue(JsonPresentationFields.EXTERNAL_REF)).get(objectType);
+ }
+
/**
* Adds a reference to the given object type. Will do nothing if already exist.
*
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
+import lombok.NoArgsConstructor;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@NoArgsConstructor
public class MapDataDefinition<T extends ToscaDataDefinition> extends ToscaDataDefinition {
protected Map<String, T> mapToscaDataDefinition;
this.mapToscaDataDefinition = mapToscaDataDefinition;
}
- public MapDataDefinition() {
- super();
- }
-
@JsonValue
public Map<String, T> getMapToscaDataDefinition() {
return mapToscaDataDefinition;
}
}
-
public String findKeyByItemUidMatch(String uid) {
if (null == mapToscaDataDefinition || uid == null) {
return null;
}
Map.Entry<String, T> entry = mapToscaDataDefinition.entrySet().stream().filter(e ->
- e.getValue().findUidMatch(uid))
- .findAny().orElse(null);
+ e.getValue().findUidMatch(uid))
+ .findAny().orElse(null);
if (null == entry) {
return null;
}
public <T extends ToscaDataDefinition> T removeByOwnerId(Set<String> ownerIdList) {
if (mapToscaDataDefinition != null) {
Map<String, T> collect = (Map<String, T>) mapToscaDataDefinition.entrySet()
- .stream()
- .filter(e -> ownerIdList.contains(e.getValue().getOwnerId())).collect(Collectors.toMap(Map.Entry::getKey, (Map.Entry::getValue)));
+ .stream()
+ .filter(e -> ownerIdList.contains(e.getValue().getOwnerId())).collect(Collectors.toMap(Map.Entry::getKey, (Map.Entry::getValue)));
MapDataDefinition collectMap = new MapDataDefinition<>(collect);
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.Map;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+@Getter
+@Setter
+@NoArgsConstructor
public class MapGroupsDataDefinition extends MapDataDefinition<GroupInstanceDataDefinition> {
private String parentName;
super(mapToscaDataDefinition);
}
- public MapGroupsDataDefinition() {
- super();
-
- }
-
@JsonValue
@Override
public Map<String, GroupInstanceDataDefinition> getMapToscaDataDefinition() {
this.mapToscaDataDefinition = mapToscaDataDefinition;
}
- public String getParentName() {
- return parentName;
- }
-
- public void setParentName(String parentName) {
- this.parentName = parentName;
- }
-
-
}
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.Map;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
public class MapInterfaceDataDefinition extends MapDataDefinition<InterfaceDataDefinition> {
- public MapInterfaceDataDefinition() {
-
- }
-
@JsonCreator
public MapInterfaceDataDefinition(Map<String, InterfaceDataDefinition> mapToscaDataDefinition) {
super(mapToscaDataDefinition);
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.HashMap;
import java.util.Map;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
public class MapListCapabilityDataDefinition extends MapDataDefinition<ListCapabilityDataDefinition> {
public MapListCapabilityDataDefinition(MapListCapabilityDataDefinition cdt) {
super(mapToscaDataDefinition);
}
- public MapListCapabilityDataDefinition() {
- super();
-
- }
-
@JsonValue
@Override
public Map<String, ListCapabilityDataDefinition> getMapToscaDataDefinition() {
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.HashMap;
import java.util.Map;
+import lombok.NoArgsConstructor;
+@NoArgsConstructor
public class MapListRequirementDataDefinition extends MapDataDefinition<ListRequirementDataDefinition> {
public MapListRequirementDataDefinition(MapListRequirementDataDefinition cdt) {
super(mapToscaDataDefinition);
}
- public MapListRequirementDataDefinition() {
- super();
-
- }
-
@JsonValue
@Override
public Map<String, ListRequirementDataDefinition> getMapToscaDataDefinition() {
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
-
import java.util.HashMap;
import java.util.Map;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+@Getter
+@Setter
+@NoArgsConstructor
public class MapPropertiesDataDefinition extends MapDataDefinition<PropertyDataDefinition> {
private String parentName;
*/
public MapPropertiesDataDefinition(MapPropertiesDataDefinition toBeDeepCopiedMapPropertiesDataDefinition) {
this.parentName = toBeDeepCopiedMapPropertiesDataDefinition.parentName;
- this.toscaPresentation = toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation == null ? null : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation);
- this.mapToscaDataDefinition = toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition == null ? null : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition);
- }
-
- public MapPropertiesDataDefinition() {
- super();
-
+ this.toscaPresentation = toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation == null ? null
+ : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.toscaPresentation);
+ this.mapToscaDataDefinition = toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition == null ? null
+ : new HashMap(toBeDeepCopiedMapPropertiesDataDefinition.mapToscaDataDefinition);
}
@JsonValue
return mapToscaDataDefinition;
}
-
public void setMapToscaDataDefinition(Map<String, PropertyDataDefinition> mapToscaDataDefinition) {
this.mapToscaDataDefinition = mapToscaDataDefinition;
}
- public String getParentName() {
- return parentName;
- }
-
- public void setParentName(String parentName) {
- this.parentName = parentName;
- }
-
}
package org.openecomp.sdc.be.datatypes.elements;
-import com.fasterxml.jackson.annotation.JsonCreator;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
-import java.io.Serializable;
-
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ASSOCIATION_TYPE;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_ID;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_NAME;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION;
import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.IO_WORKFLOW_VERSION_ID;
-public class OperationDataDefinition extends ToscaDataDefinition implements Serializable {
+import com.fasterxml.jackson.annotation.JsonCreator;
+import java.io.Serializable;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+public class OperationDataDefinition extends ToscaDataDefinition implements Serializable {
@JsonCreator
public OperationDataDefinition() {
public ListDataDefinition<OperationInputDefinition> getInputs() {
return (ListDataDefinition<OperationInputDefinition>) getToscaPresentationValue(
- JsonPresentationFields.OPERATION_INPUTS);
+ JsonPresentationFields.OPERATION_INPUTS);
}
public void setInputs(ListDataDefinition<OperationInputDefinition> inputs) {
public ListDataDefinition<OperationOutputDefinition> getOutputs() {
return (ListDataDefinition<OperationOutputDefinition>) getToscaPresentationValue(
- JsonPresentationFields.OPERATION_OUTPUTS);
+ JsonPresentationFields.OPERATION_OUTPUTS);
}
public void setOutputs(ListDataDefinition<OperationOutputDefinition> outputs) {
setToscaPresentationValue(JsonPresentationFields.OPERATION_OUTPUTS, outputs);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
public String getUniqueId() {
return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
}
setToscaPresentationValue(IO_WORKFLOW_ASSOCIATION_TYPE, workflowAssociationType);
}
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public Long getCreationDate() {
return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_DATE);
}
package org.openecomp.sdc.be.datatypes.elements;
-import java.util.HashSet;
import java.util.List;
-import java.util.Objects;
-
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode
public class OperationImplementation {
private String primary;
private List<String> dependencies;
- public String getPrimary() {
- return primary;
- }
-
- public void setPrimary(String primary) {
- this.primary = primary;
- }
-
- public List<String> getDependencies() {
- return dependencies;
- }
-
- public void setDependencies(List<String> dependencies) {
- this.dependencies = dependencies;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof OperationImplementation)) {
- return false;
- }
- OperationImplementation that = (OperationImplementation) o;
- return Objects.equals(primary, that.primary)
- && Objects.equals(new HashSet<>(dependencies), new HashSet<>(that.dependencies));
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(primary, dependencies);
- }
}
import com.fasterxml.jackson.annotation.JsonCreator;
+import lombok.Getter;
+import lombok.Setter;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-
+@Getter
+@Setter
public class OperationInputDefinition extends InputDataDefinition {
+
private String source;
private String sourceProperty;
private String toscaDefaultValue;
setType(type);
}
+ @Override
public String getLabel() {
return (String) getToscaPresentationValue(JsonPresentationFields.ARTIFACT_LABEL);
}
+ @Override
public void setLabel(String name) {
setToscaPresentationValue(JsonPresentationFields.ARTIFACT_LABEL, name);
}
- public String getSource() {
- return source;
- }
-
- public void setSource(String source) {
- this.source = source;
- }
-
- public String getSourceProperty() {
- return sourceProperty;
- }
-
- public void setSourceProperty(String sourceProperty) {
- this.sourceProperty = sourceProperty;
- }
-
- public String getToscaDefaultValue() {
- return toscaDefaultValue;
- }
-
- public void setToscaDefaultValue(String toscaDefaultValue) {
- this.toscaDefaultValue = toscaDefaultValue;
- }
}
package org.openecomp.sdc.be.datatypes.elements;
import java.util.Map;
-import java.util.Objects;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode
+public class OperationInstance {
-public class OperationInstance/* extends Operation*/ {
private OperationImplementation implementation;
private Map<String, Object> inputs;
-
- public OperationImplementation getImplementation() {
- return implementation;
- }
-
- public void setImplementation(OperationImplementation implementation) {
- this.implementation = implementation;
- }
-
- public Map<String, Object> getInputs() {
- return inputs;
- }
-
- public void setInputs(Map<String, Object> inputs) {
- this.inputs = inputs;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof OperationInstance)) {
- return false;
- }
- OperationInstance that = (OperationInstance) o;
- return Objects.equals(implementation, that.implementation)
- && Objects.equals(inputs, that.inputs);
- }
-
- @Override
- public int hashCode() {
-
- return Objects.hash(implementation, inputs);
- }
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import static java.util.Collections.emptyList;
import java.util.List;
import java.util.Map;
-
-import static java.util.Collections.emptyList;
+import lombok.NoArgsConstructor;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
/**
- * public class representing the component policy,
- * described by the next properties:
- *
- * name
- * uniqueId
- * type (policy type name)
- * typeUid (policy type uniqueId)
- * version (version)
- * derivedFrom (policy type derivedFrom)
- * description
- * policyUUID
- * invariantUUID
- * members
- * metadata
- * properties
- * targets
- * isFromCsar
+ * public class representing the component policy, described by the next properties:
+ * <p>
+ * name uniqueId type (policy type name) typeUid (policy type uniqueId) version (version) derivedFrom (policy type derivedFrom) description policyUUID
+ * invariantUUID members metadata properties targets isFromCsar
*/
+@NoArgsConstructor
public class PolicyDataDefinition extends PropertyDataDefinition {
- /**
- * public constructor by default
- */
- public PolicyDataDefinition() {
- super();
- }
-
public PolicyDataDefinition(PropertyDataDefinition propertyDataDefinition) {
super(propertyDataDefinition);
}
}
}
+ public Boolean getIsFromCsar() {
+ Boolean isFromCsar = (Boolean) getToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR);
+ return (isFromCsar != null) ? isFromCsar : false;
+ }
+
private void setIsFromCsar(Boolean isFromCsar) {
if (isFromCsar == null) {
setToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR, false);
}
}
- public Boolean getIsFromCsar() {
- Boolean isFromCsar = (Boolean) getToscaPresentationValue(JsonPresentationFields.IS_FROM_CSAR);
- return (isFromCsar != null) ? isFromCsar : false;
- }
-
public String getComponentName() {
return (String) getToscaPresentationValue(JsonPresentationFields.CI_COMPONENT_NAME);
}
setToscaPresentationValue(JsonPresentationFields.TYPE_UNIQUE_ID, policyTypeUid);
}
+ @Override
public String getVersion() {
return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
}
setToscaPresentationValue(JsonPresentationFields.DERIVED_FROM, derivedFrom);
}
+ @Override
public String getDescription() {
return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
}
+ @Override
public void setDescription(String description) {
setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
}
package org.openecomp.sdc.be.datatypes.elements;
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+@AllArgsConstructor
public enum PolicyTargetType {
GROUPS("GROUPS"),
COMPONENT_INSTANCES("COMPONENT_INSTANCES"),
TYPE_DOES_NOT_EXIST("TYPE_DOES_NOT_EXIST");
- private String name;
-
- PolicyTargetType(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
+ @Getter
+ private final String name;
public static PolicyTargetType getByNameIgnoreCase(String name) {
for (PolicyTargetType inst : PolicyTargetType.values()) {
return null;
}
}
-
import java.util.List;
import java.util.Map;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+@Getter
+@Setter
+@NoArgsConstructor
public class PolicyTypeDataDefinition extends ToscaTypeDataDefinition {
private String uniqueId;
private Long modificationTime;
private boolean highestVersion;
- public PolicyTypeDataDefinition() {
- }
-
public PolicyTypeDataDefinition(PolicyTypeDataDefinition p) {
super(p);
this.uniqueId = p.uniqueId;
this.highestVersion = p.highestVersion;
}
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public List<String> getTargets() {
- return targets;
- }
-
- public void setTargets(List<String> members) {
- this.targets = members;
- }
-
- public Map<String, String> getMetadata() {
- return metadata;
- }
-
- public void setMetadata(Map<String, String> metadata) {
- this.metadata = metadata;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getUniqueId() {
- return uniqueId;
- }
-
- public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
- }
-
- public Long getCreationTime() {
- return creationTime;
- }
-
- public void setCreationTime(Long creationTime) {
- this.creationTime = creationTime;
- }
-
- public Long getModificationTime() {
- return modificationTime;
- }
-
- public void setModificationTime(Long modificationTime) {
- this.modificationTime = modificationTime;
- }
-
@Override
public String toString() {
- return "PolicyTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + getType() + ", name=" + getName() + ", icon=" + getIcon() + ", version=" + version
- + ", targets=" + targets + ", metadata=" + metadata + ", description=" + description + ", creationTime="
- + creationTime + ", modificationTime=" + modificationTime + "]";
+ return "PolicyTypeDataDefinition [uniqueId=" + uniqueId + ", type=" + getType() + ", name=" + getName() + ", icon=" + getIcon() + ", version="
+ + version
+ + ", targets=" + targets + ", metadata=" + metadata + ", description=" + description + ", creationTime="
+ + creationTime + ", modificationTime=" + modificationTime + "]";
}
- public String getDerivedFrom() {
- return derivedFrom;
- }
-
- public void setDerivedFrom(String derivedFrom) {
- this.derivedFrom = derivedFrom;
- }
-
- public boolean isHighestVersion() {
- return highestVersion;
- }
-
- public void setHighestVersion(boolean isLatestVersion) {
- this.highestVersion = isLatestVersion;
- }
}
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFieldsExtractor;
-
import java.util.ArrayList;
import java.util.List;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import lombok.ToString;
+import org.openecomp.sdc.be.datatypes.components.ComponentMetadataDataDefinition;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFieldsExtractor;
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode(callSuper = true)
+@ToString
public class ProductMetadataDataDefinition extends ComponentMetadataDataDefinition {
private String fullName;
-
private List<String> contacts;
-
private Boolean isActive;
- public ProductMetadataDataDefinition() {
- super();
- }
-
- public ProductMetadataDataDefinition(ProductMetadataDataDefinition other) {
- super(other);
- }
-
- public ProductMetadataDataDefinition(JsonPresentationFieldsExtractor extractor){
- super(extractor);
+ public ProductMetadataDataDefinition(JsonPresentationFieldsExtractor extractor) {
+ super(extractor);
}
public Boolean getIsActive() {
isActive = active;
}
- public List<String> getContacts() {
- return contacts;
- }
-
- public void setContacts(List<String> contacts) {
- this.contacts = contacts;
- }
-
public void addContact(String contact) {
if (contact != null) {
if (contacts == null) {
}
}
- public String getFullName() {
- return fullName;
- }
-
- public void setFullName(String fullName) {
- this.fullName = fullName;
- }
-
- @Override
- public String toString() {
- return "ProductMetadataDataDefinition [fullName=" + fullName + ", contacts=" + contacts + ", isActive="
- + isActive + "]";
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
-
- result = prime * result + ((contacts == null) ? 0 : contacts.hashCode());
- result = prime * result + ((fullName == null) ? 0 : fullName.hashCode());
- result = prime * result + ((isActive == null) ? 0 : isActive.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (!super.equals(obj)) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ProductMetadataDataDefinition other = (ProductMetadataDataDefinition) obj;
- if (contacts == null) {
- if (other.contacts != null) {
- return false;
- }
- } else if (!contacts.equals(other.contacts)) {
- return false;
- }
- if (fullName == null) {
- if (other.fullName != null) {
- return false;
- }
- } else if (!fullName.equals(other.fullName)) {
- return false;
- }
- if (isActive == null) {
- if (other.isActive != null) {
- return false;
- }
- } else if (!isActive.equals(other.isActive)) {
- return false;
- }
- return super.equals(obj);
- }
-
@Override
public String getActualComponentType() {
return getComponentType() != null ? getComponentType().getValue() : null;
package org.openecomp.sdc.be.datatypes.elements;
-import org.apache.commons.collections.CollectionUtils;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
import lombok.Data;
import lombok.EqualsAndHashCode;
-
+import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
-import static org.apache.commons.collections.CollectionUtils.isNotEmpty;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
@EqualsAndHashCode(callSuper = false)
@Data
public class PropertyDataDefinition extends ToscaDataDefinition {
+ protected boolean definition = false;
+ protected Boolean hidden = Boolean.FALSE;
private String uniqueId;
-
// "boolean", "string", "float", "integer", "version" })
private String type;
-
private Boolean required = Boolean.FALSE;
-
- protected boolean definition = false;
-
private String defaultValue;
-
private String description;
-
private SchemaDefinition schema;
-
private boolean password;
-
private String name;
-
private String value;
-
private String label;
- protected Boolean hidden = Boolean.FALSE;
private Boolean immutable = Boolean.FALSE;
private String inputPath;
private List<GetPolicyValueDataDefinition> getPolicyValues;
private List<String> propertyConstraints;
-
+
private Map<String, String> metadata;
public PropertyDataDefinition() {
if (MapUtils.isNotEmpty(propertyDataDefinition.getMetadata())) {
setMetadata(new HashMap<>(propertyDataDefinition.getMetadata()));
}
- if(isNotEmpty(propertyDataDefinition.getPropertyConstraints())){
+ if (isNotEmpty(propertyDataDefinition.getPropertyConstraints())) {
setPropertyConstraints(new ArrayList<>(propertyDataDefinition.getPropertyConstraints()));
}
this.setIsDeclaredListInput(propertyDataDefinition.getIsDeclaredListInput());
return required;
}
- public void setSchemaType(String schemaType) {
+ public String getSchemaType() {
if (schema != null && schema.getProperty() != null) {
- schema.getProperty().setType(schemaType);
+ return schema.getProperty().getType();
}
+ return null;
}
- public String getSchemaType() {
+ public void setSchemaType(String schemaType) {
if (schema != null && schema.getProperty() != null) {
- return schema.getProperty().getType();
+ schema.getProperty().setType(schemaType);
}
- return null;
}
public PropertyDataDefinition getSchemaProperty() {
}
private <T extends ToscaDataDefinition> boolean compareSchemaType(T other) {
- return !"list".equals(type) && !"map".equals(type) || this.getSchema().getProperty().getType().equals(((PropertyDataDefinition) other).getSchema().getProperty().getType());
+ return !"list".equals(type) && !"map".equals(type) || this.getSchema().getProperty().getType()
+ .equals(((PropertyDataDefinition) other).getSchema().getProperty().getType());
}
@Override
public <T extends ToscaDataDefinition> T mergeFunction(T other, boolean allowDefaultValueOverride) {
if (this.getType() != null
- && this.getType().equals(other.getToscaPresentationValue(JsonPresentationFields.TYPE))
- && compareSchemaType(other)) {
+ && this.getType().equals(other.getToscaPresentationValue(JsonPresentationFields.TYPE))
+ && compareSchemaType(other)) {
other.setOwnerId(getOwnerId());
if (allowDefaultValueOverride
- && getDefaultValue() != null
- && !getDefaultValue().isEmpty()) {
+ && getDefaultValue() != null
+ && !getDefaultValue().isEmpty()) {
other.setToscaPresentationValue(JsonPresentationFields.DEFAULT_VALUE, getDefaultValue());
}
return other;
return this.getGetInputValues() != null && !this.getGetInputValues().isEmpty();
}
+ public List<Annotation> getAnnotations() {
+ return (List<Annotation>) getToscaPresentationValue(JsonPresentationFields.ANNOTATIONS);
+ }
+
public void setAnnotations(List<Annotation> newAnnotations) {
Set<Annotation> annotationSet = isNotEmpty(newAnnotations) ? new HashSet<>(newAnnotations) : new HashSet<>();
//We would to prioritize the new valid annotations over the old ones if the same one existed.
this.annotations = new ArrayList<>(annotationSet);
setToscaPresentationValue(JsonPresentationFields.ANNOTATIONS, this.annotations);
}
-
- public List<Annotation> getAnnotations() {
- return (List<Annotation>) getToscaPresentationValue(JsonPresentationFields.ANNOTATIONS);
- }
}
package org.openecomp.sdc.be.datatypes.elements;
import com.fasterxml.jackson.annotation.JsonIgnore;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.List;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@Getter
+@Setter
+@NoArgsConstructor
public class PropertyRule extends ToscaDataDefinition {
private static final String FORCE_ALL = "FORCE_ALL";
private static final String ALL = "ALL";
private static final String RULE_ANY_MATCH = ".+";
-
- public static String getForceAll() {
- return FORCE_ALL;
- }
-
- public static String getALL() {
- return ALL;
- }
-
- public static String getRuleAnyMatch() {
- return RULE_ANY_MATCH;
- }
-
-
private List<String> rule;
private String value;
- public PropertyRule() {
- super();
- }
-
public PropertyRule(List<String> rule, String value) {
super();
this.rule = rule;
this.value = value;
}
- public List<String> getRule() {
- return rule;
- }
-
- public void setRule(List<String> rule) {
- this.rule = rule;
+ public static String getForceAll() {
+ return FORCE_ALL;
}
- public String getValue() {
- return value;
+ public static String getALL() {
+ return ALL;
}
- public void setValue(String value) {
- this.value = value;
+ public static String getRuleAnyMatch() {
+ return RULE_ANY_MATCH;
}
@JsonIgnore
package org.openecomp.sdc.be.datatypes.elements;
+import java.util.List;
+import lombok.NoArgsConstructor;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.util.List;
-
+@NoArgsConstructor
public class RelationshipInstDataDefinition extends ToscaDataDefinition {
public RelationshipInstDataDefinition(RelationshipInstDataDefinition cdt) {
this.setCapability(cdt.getCapability());
}
- public void setRequirement(String requirement) {
- setToscaPresentationValue(JsonPresentationFields.REQUIREMENT, requirement);
- }
-
public String getRequirement() {
return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT);
}
- public void setCapability(String capability) {
- setToscaPresentationValue(JsonPresentationFields.CAPABILITY, capability);
+ public void setRequirement(String requirement) {
+ setToscaPresentationValue(JsonPresentationFields.REQUIREMENT, requirement);
}
public String getCapability() {
return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILITY);
}
- public void setToId(Object toId) {
- setToscaPresentationValue(JsonPresentationFields.TO_ID, toId);
- }
-
- public void setFromId(Object fromId) {
- setToscaPresentationValue(JsonPresentationFields.FROM_ID, fromId);
+ public void setCapability(String capability) {
+ setToscaPresentationValue(JsonPresentationFields.CAPABILITY, capability);
}
public String getToId() {
return (String) getToscaPresentationValue(JsonPresentationFields.TO_ID);
}
- public String getFromId() {
- return (String) getToscaPresentationValue(JsonPresentationFields.FROM_ID);
+ public void setToId(Object toId) {
+ setToscaPresentationValue(JsonPresentationFields.TO_ID, toId);
}
- public void setRequirementId(Object requirementId) {
- setToscaPresentationValue(JsonPresentationFields.REQUIREMENT_ID, requirementId);
+ public String getFromId() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.FROM_ID);
}
- public void setCapabilityId(Object capabilityId) {
- setToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID, capabilityId);
+ public void setFromId(Object fromId) {
+ setToscaPresentationValue(JsonPresentationFields.FROM_ID, fromId);
}
public String getRequirementId() {
return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT_ID);
}
+ public void setRequirementId(Object requirementId) {
+ setToscaPresentationValue(JsonPresentationFields.REQUIREMENT_ID, requirementId);
+ }
+
public String getCapabilityId() {
return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID);
}
- public void setRequirementOwnerId(Object requirementOwnerId) {
- setToscaPresentationValue(JsonPresentationFields.REQUIREMENT_OWNER_ID, requirementOwnerId);
+ public void setCapabilityId(Object capabilityId) {
+ setToscaPresentationValue(JsonPresentationFields.CAPABILITY_ID, capabilityId);
}
public String getRequirementOwnerId() {
return (String) getToscaPresentationValue(JsonPresentationFields.REQUIREMENT_OWNER_ID);
}
- public void setCapabilityOwnerId(Object capabilityOwnerId) {
- setToscaPresentationValue(JsonPresentationFields.CAPABILTY_OWNER_ID, capabilityOwnerId);
+ public void setRequirementOwnerId(Object requirementOwnerId) {
+ setToscaPresentationValue(JsonPresentationFields.REQUIREMENT_OWNER_ID, requirementOwnerId);
}
public String getCapabilityOwnerId() {
return (String) getToscaPresentationValue(JsonPresentationFields.CAPABILTY_OWNER_ID);
}
- public RelationshipInstDataDefinition() {
+ public void setCapabilityOwnerId(Object capabilityOwnerId) {
+ setToscaPresentationValue(JsonPresentationFields.CAPABILTY_OWNER_ID, capabilityOwnerId);
}
public String getUniqueId() {
/**
* Identifies the type of the capability.
*/
+ @Override
public String getType() {
return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
}
+ @Override
public void setType(String type) {
setToscaPresentationValue(JsonPresentationFields.TYPE, type);
}
setToscaPresentationValue(JsonPresentationFields.VALID_TARGET_TYPES, validTargetTypes);
}
+ @Override
public String getVersion() {
return (String) getToscaPresentationValue(JsonPresentationFields.VERSION);
}
setToscaPresentationValue(JsonPresentationFields.MODIFICATION_TIME, modificationTime);
}
- public void setInterfaces(final ListDataDefinition<InterfaceDataDefinition> operations) {
- setToscaPresentationValue(JsonPresentationFields.INTERFACES, operations);
- }
-
@SuppressWarnings("unchecked")
public ListDataDefinition<InterfaceDataDefinition> getInterfaces() {
return (ListDataDefinition<InterfaceDataDefinition>) getToscaPresentationValue(JsonPresentationFields.INTERFACES);
}
+ public void setInterfaces(final ListDataDefinition<InterfaceDataDefinition> operations) {
+ setToscaPresentationValue(JsonPresentationFields.INTERFACES, operations);
+ }
+
@Override
public String toString() {
String uniqueId = getUniqueId();
Long creationTime = getCreationTime();
Long modificationTime = getModificationTime();
- return "RelationshipTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type + ", validSourceTypes=" + validSourceTypes
- + ", version=" + version + ", originUI=" + originUI + ", creationTime=" + creationTime + ", modificationTime=" + modificationTime + "]";
+ return "RelationshipTypeDataDefinition [uniqueId=" + uniqueId + ", description=" + description + ", type=" + type + ", validSourceTypes="
+ + validSourceTypes
+ + ", version=" + version + ", originUI=" + originUI + ", creationTime=" + creationTime + ", modificationTime=" + modificationTime + "]";
}
}
package org.openecomp.sdc.be.datatypes.elements;
import com.google.common.collect.Lists;
+import java.util.ArrayList;
+import java.util.List;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.util.ArrayList;
-import java.util.List;
-
/**
* Represents the requirement of the component or component instance
*/
public static final String MIN_OCCURRENCES = "0";
public static final String MAX_OCCURRENCES = "UNBOUNDED";
public static final String MAX_DEFAULT_OCCURRENCES = "1";
-
+
@Getter
@Setter
public boolean external = false;
setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public String getParentName() {
return (String) getToscaPresentationValue(JsonPresentationFields.PARENT_NAME);
}
setToscaPresentationValue(JsonPresentationFields.MAX_OCCURRENCES, maxOccurrences);
}
- public void setPath(List<String> path) {
- setToscaPresentationValue(JsonPresentationFields.PATH, path);
- }
-
@SuppressWarnings({"unchecked"})
public List<String> getPath() {
return (List<String>) getToscaPresentationValue(JsonPresentationFields.PATH);
}
- public void setSource(String source) {
- setToscaPresentationValue(JsonPresentationFields.SOURCE, source);
+ public void setPath(List<String> path) {
+ setToscaPresentationValue(JsonPresentationFields.PATH, path);
}
public String getSource() {
return (String) getToscaPresentationValue(JsonPresentationFields.SOURCE);
}
+ public void setSource(String source) {
+ setToscaPresentationValue(JsonPresentationFields.SOURCE, source);
+ }
+
/**
* Adds the element to the path avoiding duplication
*
package org.openecomp.sdc.be.datatypes.elements;
+import java.io.Serializable;
+import lombok.NoArgsConstructor;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-import java.io.Serializable;
-
+@NoArgsConstructor
public class RequirementNodeFilterCapabilityDataDefinition extends ToscaDataDefinition implements Serializable {
- /**
- * Default Constructor
- */
- public RequirementNodeFilterCapabilityDataDefinition() {
- }
-
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> getProperties() {
return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue(
- JsonPresentationFields.PROPERTIES);
+ JsonPresentationFields.PROPERTIES);
}
public void setProperties(ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> properties) {
*/
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.io.Serializable;
import java.util.List;
+import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
public class RequirementNodeFilterPropertyDataDefinition extends ToscaDataDefinition implements Serializable {
package org.openecomp.sdc.be.datatypes.elements;
import java.io.Serializable;
+import lombok.NoArgsConstructor;
import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@NoArgsConstructor
public class RequirementSubstitutionFilterCapabilityDataDefinition extends ToscaDataDefinition implements Serializable {
- /**
- * Default Constructor
- */
- public RequirementSubstitutionFilterCapabilityDataDefinition() {
- }
-
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(final String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> getProperties() {
return (ListDataDefinition<RequirementNodeFilterPropertyDataDefinition>) getToscaPresentationValue(
- JsonPresentationFields.PROPERTIES);
+ JsonPresentationFields.PROPERTIES);
}
public void setProperties(final ListDataDefinition<RequirementNodeFilterPropertyDataDefinition> properties) {
package org.openecomp.sdc.be.datatypes.elements;
-import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
-
import java.util.List;
import java.util.Map;
+import lombok.EqualsAndHashCode;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
+import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
/**
* Schema allows to create new types that can be used along TOSCA definitions.
*/
+@Getter
+@Setter
+@NoArgsConstructor
+@EqualsAndHashCode
public class SchemaDefinition extends ToscaDataDefinition {
private String derivedFrom;
private List<String> constraints;
private Map<String, PropertyDataDefinition> properties;
-
private PropertyDataDefinition property;
-
- public SchemaDefinition() {
- }
-
public SchemaDefinition(String derivedFrom, List<String> constraints,
Map<String, PropertyDataDefinition> properties) {
this.setDerivedFrom(derivedFrom);
}
- public String getDerivedFrom() {
- return derivedFrom;
- }
-
- public void setProperty(PropertyDataDefinition property) {
- this.property = property;
- }
-
- public PropertyDataDefinition getProperty() {
- return this.property;
- }
-
- public void setDerivedFrom(String derivedFrom) {
- this.derivedFrom = derivedFrom;
- }
-
- public List<String> getConstraints() {
- return constraints;
- }
-
- public void setConstraints(List<String> constraints) {
- this.constraints = constraints;
- }
-
- public Map<String, PropertyDataDefinition> getProperties() {
- return properties;
- }
-
- public void setProperties(Map<String, PropertyDataDefinition> properties) {
- this.properties = properties;
- }
-
public void addProperty(String key, PropertyDataDefinition property) {
-
properties.put(key, property);
}
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((constraints == null) ? 0 : constraints.hashCode());
- result = prime * result + ((derivedFrom == null) ? 0 : derivedFrom.hashCode());
- result = prime * result + ((properties == null) ? 0 : properties.hashCode());
- result = prime * result + ((property == null) ? 0 : property.hashCode());
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- SchemaDefinition other = (SchemaDefinition) obj;
- if (constraints == null) {
- if (other.constraints != null) {
- return false;
- }
- } else if (!constraints.equals(other.constraints)) {
- return false;
- }
- if (derivedFrom == null) {
- if (other.derivedFrom != null) {
- return false;
- }
- } else if (!derivedFrom.equals(other.derivedFrom)) {
- return false;
- }
- if (properties == null) {
- if (other.properties != null) {
- return false;
- }
- } else if (!properties.equals(other.properties)) {
- return false;
- }
- if (property == null) {
- return other.property == null;
- } else {
- return property.equals(other.property);
- }
- }
-
@Override
public String toString() {
return "SchemaDefinition [" + "derivedFrom='" + derivedFrom + ", constraints=" + constraints + ", properties="
- + properties + ", property=" + property + ']';
+ + properties + ", property=" + property + ']';
}
}
this.setCapabilities(substitutionFilterDataDefinition.getCapabilities());
}
- public void setTosca_id(final Object tosca_id) {
- setToscaPresentationValue(JsonPresentationFields.TOSCA_ID, tosca_id);
- }
-
public Object getTosca_id() {
return getToscaPresentationValue(JsonPresentationFields.TOSCA_ID);
}
+ public void setTosca_id(final Object tosca_id) {
+ setToscaPresentationValue(JsonPresentationFields.TOSCA_ID, tosca_id);
+ }
+
public ListDataDefinition<RequirementSubstitutionFilterPropertyDataDefinition> getProperties() {
return (ListDataDefinition<RequirementSubstitutionFilterPropertyDataDefinition>) getToscaPresentationValue(
- JsonPresentationFields.PROPERTIES);
+ JsonPresentationFields.PROPERTIES);
}
public void setProperties(final ListDataDefinition<RequirementSubstitutionFilterPropertyDataDefinition> properties) {
public ListDataDefinition<RequirementSubstitutionFilterCapabilityDataDefinition> getCapabilities() {
return (ListDataDefinition<RequirementSubstitutionFilterCapabilityDataDefinition>) getToscaPresentationValue(
- JsonPresentationFields.NODE_FILTER_CAPABILITIES);
+ JsonPresentationFields.NODE_FILTER_CAPABILITIES);
}
public void setCapabilities(ListDataDefinition<RequirementSubstitutionFilterCapabilityDataDefinition> capabilities) {
setToscaPresentationValue(JsonPresentationFields.NODE_FILTER_CAPABILITIES, capabilities);
}
- public String getName() {
- return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
- }
-
- public void setName(final String name) {
- setToscaPresentationValue(JsonPresentationFields.NAME, name);
- }
-
public String getID() {
return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
}
setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, name);
}
-
}
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package org.openecomp.sdc.be.datatypes.elements;
import lombok.Getter;
+import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
+@NoArgsConstructor
public class ToscaArtifactDataDefinition {
private String file;
package org.openecomp.sdc.be.datatypes.elements;
+import lombok.Getter;
+import lombok.NoArgsConstructor;
+import lombok.Setter;
import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
+@Getter
+@Setter
+@NoArgsConstructor
public class ToscaTypeDataDefinition extends ToscaDataDefinition {
private String name;
private String icon;
private String type;
- ToscaTypeDataDefinition() {
- }
-
ToscaTypeDataDefinition(ToscaTypeDataDefinition other) {
this.name = other.getName();
this.icon = other.icon;
this.type = other.type;
}
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getIcon() {
- return icon;
- }
-
- public void setIcon(String icon) {
- this.icon = icon;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
}
return null;
}
+ public String getName() {
+ return (String) getToscaPresentationValue(JsonPresentationFields.NAME);
+ }
+
+ public void setName(String name) {
+ setToscaPresentationValue(JsonPresentationFields.NAME, name);
+ }
+
public void setToscaPresentationValue(JsonPresentationFields name, Object value) {
if(name !=null) {
if (toscaPresentation == null) {
return new ProductMetadataDataDefinition();
}
-
- @Test
- public void testGetIsActive() throws Exception {
- ProductMetadataDataDefinition testSubject;
- Boolean result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getIsActive();
- }
-
-
- @Test
- public void testSetIsActive() throws Exception {
- ProductMetadataDataDefinition testSubject;
- Boolean active = null;
-
- // default test
- testSubject = createTestSubject();
- testSubject.setIsActive(active);
- }
-
-
- @Test
- public void testGetContacts() throws Exception {
- ProductMetadataDataDefinition testSubject;
- List<String> result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getContacts();
- }
-
-
- @Test
- public void testSetContacts() throws Exception {
- ProductMetadataDataDefinition testSubject;
- List<String> contacts = null;
-
- // default test
- testSubject = createTestSubject();
- testSubject.setContacts(contacts);
- }
-
-
@Test
public void testAddContact() throws Exception {
ProductMetadataDataDefinition testSubject;
testSubject.addContact(contact);
}
-
- @Test
- public void testGetFullName() throws Exception {
- ProductMetadataDataDefinition testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.getFullName();
- }
-
-
- @Test
- public void testSetFullName() throws Exception {
- ProductMetadataDataDefinition testSubject;
- String fullName = "";
-
- // default test
- testSubject = createTestSubject();
- testSubject.setFullName(fullName);
- }
-
-
- @Test
- public void testToString() throws Exception {
- ProductMetadataDataDefinition testSubject;
- String result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.toString();
- }
-
-
- @Test
- public void testHashCode() throws Exception {
- ProductMetadataDataDefinition testSubject;
- int result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.hashCode();
- }
-
-
- @Test
- public void testEquals() throws Exception {
- ProductMetadataDataDefinition testSubject;
- Object obj = null;
- boolean result;
-
- // default test
- testSubject = createTestSubject();
- result = testSubject.equals(obj);
- result = testSubject.equals(testSubject);
- result = testSubject.equals(createTestSubject());
- }
-
@Test
public void testGetActualComponentType() throws Exception {
ProductMetadataDataDefinition testSubject;