@Override Type retainAll(Schema schema, MarkSet markSet) { // If this type is not retained, prune it. if (!markSet.contains(protoType)) return null; ImmutableList.Builder<EnumConstant> retainedConstants = ImmutableList.builder(); for (EnumConstant constant : constants) { if (markSet.contains(ProtoMember.get(protoType, constant.name()))) { retainedConstants.add(constant.retainAll(schema, markSet)); } } EnumType result = new EnumType(protoType, location, documentation, name, retainedConstants.build(), options.retainAll(schema, markSet)); result.allowAlias = allowAlias; return result; }
static EnumType fromElement(ProtoType protoType, EnumElement enumElement) { ImmutableList<EnumConstant> constants = EnumConstant.fromElements(enumElement.constants()); Options options = new Options(Options.ENUM_OPTIONS, enumElement.options()); return new EnumType(protoType, enumElement.location(), enumElement.documentation(), enumElement.name(), constants, options); }
@Override Type retainAll(Schema schema, MarkSet markSet) { // If this type is not retained, prune it. if (!markSet.contains(protoType)) return null; ImmutableList.Builder<EnumConstant> retainedConstants = ImmutableList.builder(); for (EnumConstant constant : constants) { if (markSet.contains(ProtoMember.get(protoType, constant.name()))) { retainedConstants.add(constant.retainAll(schema, markSet)); } } EnumType result = new EnumType(protoType, location, documentation, name, retainedConstants.build(), options.retainAll(schema, markSet)); result.allowAlias = allowAlias; return result; }
@Override Type retainAll(Schema schema, MarkSet markSet) { // If this type is not retained, prune it. if (!markSet.contains(protoType)) return null; ImmutableList.Builder<EnumConstant> retainedConstants = ImmutableList.builder(); for (EnumConstant constant : constants) { if (markSet.contains(ProtoMember.get(protoType, constant.name()))) { retainedConstants.add(constant.retainAll(schema, markSet)); } } EnumType result = new EnumType(protoType, location, documentation, name, retainedConstants.build(), options.retainAll(schema, markSet)); result.allowAlias = allowAlias; return result; }
static EnumType fromElement(ProtoType protoType, EnumElement enumElement) { ImmutableList<EnumConstant> constants = EnumConstant.fromElements(enumElement.constants()); Options options = new Options(Options.ENUM_OPTIONS, enumElement.options()); return new EnumType(protoType, enumElement.location(), enumElement.documentation(), enumElement.name(), constants, options); }
static EnumType fromElement(ProtoType protoType, EnumElement enumElement) { ImmutableList<EnumConstant> constants = EnumConstant.fromElements(enumElement.constants()); Options options = new Options(Options.ENUM_OPTIONS, enumElement.options()); return new EnumType(protoType, enumElement.location(), enumElement.documentation(), enumElement.name(), constants, options); }