@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TNodeType)) return false; if (!super.equals(o)) return false; TNodeType tNodeType = (TNodeType) o; return Objects.equals(getAttributes(), tNodeType.getAttributes()) && Objects.equals(getRequirements(), tNodeType.getRequirements()) && Objects.equals(getCapabilities(), tNodeType.getCapabilities()) && Objects.equals(getInterfaces(), tNodeType.getInterfaces()) && Objects.equals(getArtifacts(), tNodeType.getArtifacts()); }
@Override public int hashCode() { return Objects.hash(super.hashCode(), getAttributes(), getRequirements(), getCapabilities(), getInterfaces(), getArtifacts()); }
for (Map.Entry<String, TInterfaceDefinition> entry : node.getInterfaces().entrySet()) { entry.getValue().getOperations() .entrySet().stream()
@Override public R visit(TNodeType node, P parameter) { return reduce(Stream.of( visitMapElement(node.getRequirements(), parameter, "requirements"), visitElement(node.getInterfaces(), parameter, "interfaces"), visitElement(node.getArtifacts(), parameter, "artifacts") )); }
@Override public String toString() { return "TNodeType{" + "attributes=" + getAttributes() + ", requirements=" + getRequirements() + ", capabilities=" + getCapabilities() + ", interfaces=" + getInterfaces() + ", artifacts=" + getArtifacts() + "} " + super.toString(); }
public Printer visit(TNodeType node, Parameter parameter) { return new Printer(parameter.getIndent()) .print(printMap("attributes", node.getAttributes(), parameter)) .print(printListMap("requirements", node.getRequirements().stream().map(TMapRequirementDefinition::getMap).collect(Collectors.toList()), parameter)) .print(printMap("capabilities", node.getCapabilities(), parameter)) .print(printMap("interfaces", node.getInterfaces(), parameter)) .print(printMap("artifacts", node.getArtifacts(), parameter)); }
/** * Converts TOSCA YAML NodeTypes to TOSCA XML NodeTypes * * @param node TOSCA YAML NodeType * @return TOSCA XML NodeType */ private TNodeType convert(org.eclipse.winery.model.tosca.yaml.TNodeType node, String id) { if (Objects.isNull(node)) return null; TNodeType.Builder builder = convert(node, new TNodeType.Builder(id)) .addRequirementDefinitions(convert(node.getRequirements())) .addCapabilityDefinitions(convert(node.getCapabilities())) .addInterfaces(convert(refactor(node.getInterfaces(), node))); convertNodeTypeImplementation( refactorImplementationArtifacts(node.getArtifacts(), node), refactorDeploymentArtifacts(node.getArtifacts()), id ); return builder.build(); }