public static Builder builder() { return new AutoValue_OneOfElement.Builder() .documentation("") .fields(ImmutableList.<FieldElement>of()) .groups(ImmutableList.<GroupElement>of()); }
private OneOfElement readOneOf(String documentation) { OneOfElement.Builder builder = OneOfElement.builder() .name(reader.readName()) .documentation(documentation); ImmutableList.Builder<FieldElement> fields = ImmutableList.builder(); ImmutableList.Builder<GroupElement> groups = ImmutableList.builder(); reader.require('{'); while (true) { String nestedDocumentation = reader.readDocumentation(); if (reader.peekChar('}')) break; Location location = reader.location(); String type = reader.readDataType(); if (type.equals("group")) { groups.add(readGroup(location, nestedDocumentation, null)); } else { fields.add(readField(location, nestedDocumentation, null, type)); } } return builder.fields(fields.build()) .groups(groups.build()) .build(); }
.tag(1) .build())) .groups(ImmutableList.of(GroupElement.builder(location.at(5, 5)) .name("Stuff") .tag(3)
private OneOfElement readOneOf(String documentation) { OneOfElement.Builder builder = OneOfElement.builder() .name(readName()) .documentation(documentation); ImmutableList.Builder<FieldElement> fields = ImmutableList.builder(); ImmutableList.Builder<GroupElement> groups = ImmutableList.builder(); if (readChar() != '{') throw unexpected("expected '{'"); while (true) { String nestedDocumentation = readDocumentation(); if (peekChar() == '}') { pos++; break; } Location location = location(); String type = readDataType(); if (type.equals("group")) { groups.add(readGroup(nestedDocumentation, null)); } else { fields.add(readField(location, nestedDocumentation, null, type)); } } return builder.fields(fields.build()) .groups(groups.build()) .build(); }
private OneOfElement readOneOf(String documentation) { OneOfElement.Builder builder = OneOfElement.builder() .name(reader.readName()) .documentation(documentation); ImmutableList.Builder<FieldElement> fields = ImmutableList.builder(); ImmutableList.Builder<GroupElement> groups = ImmutableList.builder(); reader.require('{'); while (true) { String nestedDocumentation = reader.readDocumentation(); if (reader.peekChar('}')) break; Location location = reader.location(); String type = reader.readDataType(); if (type.equals("group")) { groups.add(readGroup(nestedDocumentation, null)); } else { fields.add(readField(location, nestedDocumentation, null, type)); } } return builder.fields(fields.build()) .groups(groups.build()) .build(); }
public static Builder builder() { return new AutoValue_OneOfElement.Builder() .documentation("") .fields(ImmutableList.<FieldElement>of()) .groups(ImmutableList.<GroupElement>of()); }
public static Builder builder() { return new AutoValue_OneOfElement.Builder() .documentation("") .fields(ImmutableList.<FieldElement>of()) .groups(ImmutableList.<GroupElement>of()); }
.tag(2) .build())) .groups(ImmutableList.of(GroupElement.builder(location.at(5, 5)) .name("Stuff") .tag(3)