@Override public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof TCapabilityDefinition)) return false; TCapabilityDefinition that = (TCapabilityDefinition) o; return Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getOccurrences(), that.getOccurrences()) && Objects.equals(getValidSourceTypes(), that.getValidSourceTypes()) && Objects.equals(getType(), that.getType()) && Objects.equals(getProperties(), that.getProperties()) && Objects.equals(getAttributes(), that.getAttributes()); }
@Override public int hashCode() { return Objects.hash(getDescription(), getOccurrences(), getValidSourceTypes(), getType(), getProperties(), getAttributes()); }
@Override public String toString() { return "TCapabilityDefinition{" + "description='" + getDescription() + '\'' + ", occurrences=" + getOccurrences() + ", validSourceTypes=" + getValidSourceTypes() + ", type=" + getType() + ", properties=" + getProperties() + ", attributes=" + getAttributes() + '}'; }
/** * Converts TOSCA YAML CapabilityDefinitions to TOSCA XML CapabilityDefinitions Additional TOSCA YAML elements * properties, attributes and valid_source_types are not converted * * @param node TOSCA YAML CapabilityDefinition * @return TOSCA XML CapabilityDefinition */ private TCapabilityDefinition convert(org.eclipse.winery.model.tosca.yaml.TCapabilityDefinition node, String id) { if (Objects.isNull(node)) return null; return new TCapabilityDefinition.Builder(id, node.getType()) .addDocumentation(node.getDescription()) .setLowerBound(node.getLowerBound()) .setUpperBound(node.getUpperBound()) .build(); }
public Printer visit(TCapabilityDefinition node, Parameter parameter) { return new Printer(parameter.getIndent()) .printKeyValue("description", node.getDescription()) .printKeyValue("occurrences", node.getOccurrences()) .printKeyValue("valid_source_types", node.getValidSourceTypes()) .printKeyValue("type", node.getType()) .print(printMap("properties", node.getProperties(), parameter)) .print(printMap("attributes", node.getAttributes(), parameter)); }