public final String toSchema() { StringBuilder builder = new StringBuilder(); appendDocumentation(builder, documentation()); if (label() != null) { builder.append(label().name().toLowerCase(Locale.US)).append(' '); } builder.append("group ") .append(name()) .append(" = ") .append(tag()) .append(" {"); if (!fields().isEmpty()) { builder.append('\n'); for (FieldElement field : fields()) { appendIndented(builder, field.toSchema()); } } return builder.append("}\n").toString(); }
public final String toSchema() { StringBuilder builder = new StringBuilder(); appendDocumentation(builder, documentation()); if (label() != null) { builder.append(label().name().toLowerCase(Locale.US)).append(' '); } builder.append("group ") .append(name()) .append(" = ") .append(tag()) .append(" {"); if (!fields().isEmpty()) { builder.append('\n'); for (FieldElement field : fields()) { appendIndented(builder, field.toSchema()); } } return builder.append("}\n").toString(); }
public final String toSchema() { StringBuilder builder = new StringBuilder(); appendDocumentation(builder, documentation()); if (label() != null) { builder.append(label().name().toLowerCase(Locale.US)).append(' '); } builder.append("group ") .append(name()) .append(" = ") .append(tag()) .append(" {"); if (!fields().isEmpty()) { builder.append('\n'); for (FieldElement field : fields()) { appendIndented(builder, field.toSchema()); } } return builder.append("}\n").toString(); }
@Override public boolean equals(Object o) { if (o == this) { return true; } if (o instanceof GroupElement) { GroupElement that = (GroupElement) o; return ((this.label == null) ? (that.label() == null) : this.label.equals(that.label())) && (this.name.equals(that.name())) && (this.tag == that.tag()) && (this.documentation.equals(that.documentation())) && (this.fields.equals(that.fields())); } return false; }
Builder(GroupElement source) { this.label = source.label(); this.name = source.name(); this.tag = source.tag(); this.documentation = source.documentation(); this.fields = source.fields(); } @Override