@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TOperationDefinition)) return false; TOperationDefinition that = (TOperationDefinition) o; return Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getInputs(), that.getInputs()) && Objects.equals(getOutputs(), that.getOutputs()) && Objects.equals(getImplementation(), that.getImplementation()); }
@Override public int hashCode() { return Objects.hash(getDescription(), getInputs(), getOutputs(), getImplementation()); }
@Override public String toString() { return "TOperationDefinition{" + "description='" + getDescription() + '\'' + ", inputs=" + getInputs() + ", outputs=" + getOutputs() + ", implementation=" + getImplementation() + '}'; }
@Override public R visit(TOperationDefinition node, P parameter) { return reduce(Stream.of( visitElement(node.getInputs(), parameter, "inputs"), visitElement(node.getImplementation(), parameter, "implementation") )); }
private TOperation convert(TOperationDefinition node, String id) { return new TOperation.Builder(id) .addDocumentation(node.getDescription()) .addInputParameters(convertParameters(node.getInputs())) .addOutputParameters(convertParameters(node.getOutputs())) .build(); }
public Printer visit(TOperationDefinition node, Parameter parameter) { return new Printer(parameter.getIndent()) .printKeyValue("description", node.getDescription()) .print(printMap("inputs", node.getInputs(), new Parameter(parameter.getIndent()))) .print(printMap("outputs", node.getOutputs(), new Parameter(parameter.getIndent()))) .print(printVisitorNode(node.getImplementation(), new Parameter(parameter.getIndent()).addContext("implementation"))); }