static ImmutableList<Field> fromElements(String packageName, ImmutableList<FieldElement> fieldElements, boolean extension) { ImmutableList.Builder<Field> fields = ImmutableList.builder(); for (FieldElement field : fieldElements) { fields.add(new Field(packageName, field.location(), field.label(), field.name(), field.documentation(), field.tag(), field.defaultValue(), field.type(), new Options(Options.FIELD_OPTIONS, field.options()), extension)); } return fields.build(); }
Field retainAll(Schema schema, MarkSet markSet) { // For map types only the value can participate in pruning as the key will always be scalar. if (type.isMap() && !markSet.contains(type.valueType())) return null; if (!markSet.contains(type)) return null; Field result = new Field(packageName, location, label, name, documentation, tag, defaultValue, elementType, options.retainAll(schema, markSet), extension); result.type = type; result.deprecated = deprecated; result.packed = packed; result.redacted = redacted; return result; }
static ImmutableList<Field> fromElements(String packageName, ImmutableList<FieldElement> fieldElements, boolean extension) { ImmutableList.Builder<Field> fields = ImmutableList.builder(); for (FieldElement field : fieldElements) { fields.add(new Field(packageName, field.location(), field.label(), field.name(), field.documentation(), field.tag(), field.defaultValue(), field.type(), new Options(Options.FIELD_OPTIONS, field.options()), extension)); } return fields.build(); }
static ImmutableList<Field> fromElements(String packageName, ImmutableList<FieldElement> fieldElements, boolean extension) { ImmutableList.Builder<Field> fields = ImmutableList.builder(); for (FieldElement field : fieldElements) { fields.add(new Field(packageName, field.location(), field.label(), field.name(), field.documentation(), field.tag(), field.defaultValue(), field.type(), new Options(Options.FIELD_OPTIONS, field.options()), extension)); } return fields.build(); }
Field retainAll(Schema schema, MarkSet markSet) { // For map types only the value can participate in pruning as the key will always be scalar. if (type.isMap() && !markSet.contains(type.valueType())) return null; if (!markSet.contains(type)) return null; Field result = new Field(packageName, location, label, name, documentation, tag, defaultValue, elementType, options.retainAll(schema, markSet), extension); result.type = type; result.deprecated = deprecated; result.packed = packed; result.redacted = redacted; return result; }
Field retainAll(Schema schema, MarkSet markSet) { // For map types only the value can participate in pruning as the key will always be scalar. if (type.isMap() && !markSet.contains(type.valueType())) return null; if (!markSet.contains(type)) return null; Field result = new Field(packageName, location, label, name, documentation, tag, defaultValue, elementType, options.retainAll(schema, markSet), extension); result.type = type; result.deprecated = deprecated; result.packed = packed; result.redacted = redacted; return result; }