@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TArtifactDefinition)) return false; TArtifactDefinition that = (TArtifactDefinition) o; return Objects.equals(getType(), that.getType()) && Objects.equals(getRepository(), that.getRepository()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getDeployPath(), that.getDeployPath()) && Objects.equals(getFiles(), that.getFiles()) && Objects.equals(getProperties(), that.getProperties()); }
@Override public int hashCode() { return Objects.hash(getType(), getRepository(), getDescription(), getDeployPath(), getFiles(), getProperties()); }
@Override public String toString() { return "TArtifactDefinition{" + "type=" + getType() + ", repository='" + getRepository() + '\'' + ", description='" + getDescription() + '\'' + ", deployPath='" + getDeployPath() + '\'' + ", files=" + getFiles() + ", properties=" + getProperties() + '}'; }
public Builder(TArtifactDefinition artifactDefinition) { this.type = artifactDefinition.getType(); this.files = artifactDefinition.getFiles(); this.repository = artifactDefinition.getRepository(); this.description = artifactDefinition.getDescription(); this.deployPath = artifactDefinition.getDeployPath(); this.properties = artifactDefinition.getProperties(); }
/** * Converts a TOSCA YAML ArtifactDefinition to a TOSCA XML ArtifactTemplate * * @param node TOSCA YAML ArtifactDefinition * @return TOSCA XML ArtifactTemplate */ @NonNull private TArtifactTemplate convert(TArtifactDefinition node, String id) { return new TArtifactTemplate.Builder(id, node.getType()) .addArtifactReferences(node.getFiles().stream() .filter(Objects::nonNull) // TODO change filepath .map(file -> new TArtifactReference.Builder(file).build()) .collect(Collectors.toList()) ) .setProperties(convertPropertyAssignments(node.getProperties(), getPropertyTypeName(node.getType()))) .build(); }