@NonNull public Integer getLowerBound() { if (getOccurrences() == null || getOccurrences().isEmpty()) { return 1; } else { return Integer.valueOf(getOccurrences().get(0)); } }
@NonNull public String getUpperBound() { if (getOccurrences() == null || getOccurrences().size() <= 1) { return "1"; } else { return getOccurrences().get(1); } }
@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() + '}'; }
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)); }