// 
// Decompiled by Procyon v0.6.0
// 

package com.google.protobuf;

import java.util.ArrayList;
import java.util.Collection;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.io.IOException;
import java.util.Collections;
import java.util.List;

public final class Type extends GeneratedMessage implements TypeOrBuilder
{
    private static final long serialVersionUID = 0L;
    private int bitField0_;
    public static final int NAME_FIELD_NUMBER = 1;
    private volatile Object name_;
    public static final int FIELDS_FIELD_NUMBER = 2;
    private List<Field> fields_;
    public static final int ONEOFS_FIELD_NUMBER = 3;
    private LazyStringArrayList oneofs_;
    public static final int OPTIONS_FIELD_NUMBER = 4;
    private List<Option> options_;
    public static final int SOURCE_CONTEXT_FIELD_NUMBER = 5;
    private SourceContext sourceContext_;
    public static final int SYNTAX_FIELD_NUMBER = 6;
    private int syntax_;
    public static final int EDITION_FIELD_NUMBER = 7;
    private volatile Object edition_;
    private byte memoizedIsInitialized;
    private static final Type DEFAULT_INSTANCE;
    private static final Parser<Type> PARSER;
    
    private Type(final GeneratedMessage.Builder<?> builder) {
        super(builder);
        this.name_ = "";
        this.oneofs_ = LazyStringArrayList.emptyList();
        this.syntax_ = 0;
        this.edition_ = "";
        this.memoizedIsInitialized = -1;
    }
    
    private Type() {
        this.name_ = "";
        this.oneofs_ = LazyStringArrayList.emptyList();
        this.syntax_ = 0;
        this.edition_ = "";
        this.memoizedIsInitialized = -1;
        this.name_ = "";
        this.fields_ = Collections.emptyList();
        this.oneofs_ = LazyStringArrayList.emptyList();
        this.options_ = Collections.emptyList();
        this.syntax_ = 0;
        this.edition_ = "";
    }
    
    public static final Descriptors.Descriptor getDescriptor() {
        return TypeProto.internal_static_google_protobuf_Type_descriptor;
    }
    
    @Override
    protected FieldAccessorTable internalGetFieldAccessorTable() {
        return TypeProto.internal_static_google_protobuf_Type_fieldAccessorTable.ensureFieldAccessorsInitialized(Type.class, Builder.class);
    }
    
    @Override
    public String getName() {
        final Object ref = this.name_;
        if (ref instanceof String) {
            return (String)ref;
        }
        final ByteString bs = (ByteString)ref;
        final String s = bs.toStringUtf8();
        return (String)(this.name_ = s);
    }
    
    @Override
    public ByteString getNameBytes() {
        final Object ref = this.name_;
        if (ref instanceof String) {
            final ByteString b = ByteString.copyFromUtf8((String)ref);
            return (ByteString)(this.name_ = b);
        }
        return (ByteString)ref;
    }
    
    @Override
    public List<Field> getFieldsList() {
        return this.fields_;
    }
    
    @Override
    public List<? extends FieldOrBuilder> getFieldsOrBuilderList() {
        return this.fields_;
    }
    
    @Override
    public int getFieldsCount() {
        return this.fields_.size();
    }
    
    @Override
    public Field getFields(final int index) {
        return this.fields_.get(index);
    }
    
    @Override
    public FieldOrBuilder getFieldsOrBuilder(final int index) {
        return this.fields_.get(index);
    }
    
    @Override
    public ProtocolStringList getOneofsList() {
        return this.oneofs_;
    }
    
    @Override
    public int getOneofsCount() {
        return this.oneofs_.size();
    }
    
    @Override
    public String getOneofs(final int index) {
        return this.oneofs_.get(index);
    }
    
    @Override
    public ByteString getOneofsBytes(final int index) {
        return this.oneofs_.getByteString(index);
    }
    
    @Override
    public List<Option> getOptionsList() {
        return this.options_;
    }
    
    @Override
    public List<? extends OptionOrBuilder> getOptionsOrBuilderList() {
        return this.options_;
    }
    
    @Override
    public int getOptionsCount() {
        return this.options_.size();
    }
    
    @Override
    public Option getOptions(final int index) {
        return this.options_.get(index);
    }
    
    @Override
    public OptionOrBuilder getOptionsOrBuilder(final int index) {
        return this.options_.get(index);
    }
    
    @Override
    public boolean hasSourceContext() {
        return (this.bitField0_ & 0x1) != 0x0;
    }
    
    @Override
    public SourceContext getSourceContext() {
        return (this.sourceContext_ == null) ? SourceContext.getDefaultInstance() : this.sourceContext_;
    }
    
    @Override
    public SourceContextOrBuilder getSourceContextOrBuilder() {
        return (this.sourceContext_ == null) ? SourceContext.getDefaultInstance() : this.sourceContext_;
    }
    
    @Override
    public int getSyntaxValue() {
        return this.syntax_;
    }
    
    @Override
    public Syntax getSyntax() {
        final Syntax result = Syntax.forNumber(this.syntax_);
        return (result == null) ? Syntax.UNRECOGNIZED : result;
    }
    
    @Override
    public String getEdition() {
        final Object ref = this.edition_;
        if (ref instanceof String) {
            return (String)ref;
        }
        final ByteString bs = (ByteString)ref;
        final String s = bs.toStringUtf8();
        return (String)(this.edition_ = s);
    }
    
    @Override
    public ByteString getEditionBytes() {
        final Object ref = this.edition_;
        if (ref instanceof String) {
            final ByteString b = ByteString.copyFromUtf8((String)ref);
            return (ByteString)(this.edition_ = b);
        }
        return (ByteString)ref;
    }
    
    @Override
    public final boolean isInitialized() {
        final byte isInitialized = this.memoizedIsInitialized;
        if (isInitialized == 1) {
            return true;
        }
        if (isInitialized == 0) {
            return false;
        }
        this.memoizedIsInitialized = 1;
        return true;
    }
    
    @Override
    public void writeTo(final CodedOutputStream output) throws IOException {
        if (!GeneratedMessage.isStringEmpty(this.name_)) {
            GeneratedMessage.writeString(output, 1, this.name_);
        }
        for (int i = 0; i < this.fields_.size(); ++i) {
            output.writeMessage(2, this.fields_.get(i));
        }
        for (int i = 0; i < this.oneofs_.size(); ++i) {
            GeneratedMessage.writeString(output, 3, this.oneofs_.getRaw(i));
        }
        for (int i = 0; i < this.options_.size(); ++i) {
            output.writeMessage(4, this.options_.get(i));
        }
        if ((this.bitField0_ & 0x1) != 0x0) {
            output.writeMessage(5, this.getSourceContext());
        }
        if (this.syntax_ != Syntax.SYNTAX_PROTO2.getNumber()) {
            output.writeEnum(6, this.syntax_);
        }
        if (!GeneratedMessage.isStringEmpty(this.edition_)) {
            GeneratedMessage.writeString(output, 7, this.edition_);
        }
        this.getUnknownFields().writeTo(output);
    }
    
    @Override
    public int getSerializedSize() {
        int size = this.memoizedSize;
        if (size != -1) {
            return size;
        }
        size = 0;
        if (!GeneratedMessage.isStringEmpty(this.name_)) {
            size += GeneratedMessage.computeStringSize(1, this.name_);
        }
        for (int i = 0; i < this.fields_.size(); ++i) {
            size += CodedOutputStream.computeMessageSize(2, this.fields_.get(i));
        }
        int dataSize = 0;
        for (int j = 0; j < this.oneofs_.size(); ++j) {
            dataSize += GeneratedMessage.computeStringSizeNoTag(this.oneofs_.getRaw(j));
        }
        size += dataSize;
        size += 1 * this.getOneofsList().size();
        for (int i = 0; i < this.options_.size(); ++i) {
            size += CodedOutputStream.computeMessageSize(4, this.options_.get(i));
        }
        if ((this.bitField0_ & 0x1) != 0x0) {
            size += CodedOutputStream.computeMessageSize(5, this.getSourceContext());
        }
        if (this.syntax_ != Syntax.SYNTAX_PROTO2.getNumber()) {
            size += CodedOutputStream.computeEnumSize(6, this.syntax_);
        }
        if (!GeneratedMessage.isStringEmpty(this.edition_)) {
            size += GeneratedMessage.computeStringSize(7, this.edition_);
        }
        size += this.getUnknownFields().getSerializedSize();
        return this.memoizedSize = size;
    }
    
    @Override
    public boolean equals(final Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof Type)) {
            return super.equals(obj);
        }
        final Type other = (Type)obj;
        return this.getName().equals(other.getName()) && this.getFieldsList().equals(other.getFieldsList()) && this.getOneofsList().equals(other.getOneofsList()) && this.getOptionsList().equals(other.getOptionsList()) && this.hasSourceContext() == other.hasSourceContext() && (!this.hasSourceContext() || this.getSourceContext().equals(other.getSourceContext())) && this.syntax_ == other.syntax_ && this.getEdition().equals(other.getEdition()) && this.getUnknownFields().equals(other.getUnknownFields());
    }
    
    @Override
    public int hashCode() {
        if (this.memoizedHashCode != 0) {
            return this.memoizedHashCode;
        }
        int hash = 41;
        hash = 19 * hash + getDescriptor().hashCode();
        hash = 37 * hash + 1;
        hash = 53 * hash + this.getName().hashCode();
        if (this.getFieldsCount() > 0) {
            hash = 37 * hash + 2;
            hash = 53 * hash + this.getFieldsList().hashCode();
        }
        if (this.getOneofsCount() > 0) {
            hash = 37 * hash + 3;
            hash = 53 * hash + this.getOneofsList().hashCode();
        }
        if (this.getOptionsCount() > 0) {
            hash = 37 * hash + 4;
            hash = 53 * hash + this.getOptionsList().hashCode();
        }
        if (this.hasSourceContext()) {
            hash = 37 * hash + 5;
            hash = 53 * hash + this.getSourceContext().hashCode();
        }
        hash = 37 * hash + 6;
        hash = 53 * hash + this.syntax_;
        hash = 37 * hash + 7;
        hash = 53 * hash + this.getEdition().hashCode();
        hash = 29 * hash + this.getUnknownFields().hashCode();
        return this.memoizedHashCode = hash;
    }
    
    public static Type parseFrom(final ByteBuffer data) throws InvalidProtocolBufferException {
        return Type.PARSER.parseFrom(data);
    }
    
    public static Type parseFrom(final ByteBuffer data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return Type.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static Type parseFrom(final ByteString data) throws InvalidProtocolBufferException {
        return Type.PARSER.parseFrom(data);
    }
    
    public static Type parseFrom(final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return Type.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static Type parseFrom(final byte[] data) throws InvalidProtocolBufferException {
        return Type.PARSER.parseFrom(data);
    }
    
    public static Type parseFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
        return Type.PARSER.parseFrom(data, extensionRegistry);
    }
    
    public static Type parseFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(Type.PARSER, input);
    }
    
    public static Type parseFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(Type.PARSER, input, extensionRegistry);
    }
    
    public static Type parseDelimitedFrom(final InputStream input) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(Type.PARSER, input);
    }
    
    public static Type parseDelimitedFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseDelimitedWithIOException(Type.PARSER, input, extensionRegistry);
    }
    
    public static Type parseFrom(final CodedInputStream input) throws IOException {
        return GeneratedMessage.parseWithIOException(Type.PARSER, input);
    }
    
    public static Type parseFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
        return GeneratedMessage.parseWithIOException(Type.PARSER, input, extensionRegistry);
    }
    
    @Override
    public Builder newBuilderForType() {
        return newBuilder();
    }
    
    public static Builder newBuilder() {
        return Type.DEFAULT_INSTANCE.toBuilder();
    }
    
    public static Builder newBuilder(final Type prototype) {
        return Type.DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }
    
    @Override
    public Builder toBuilder() {
        return (this == Type.DEFAULT_INSTANCE) ? new Builder() : new Builder().mergeFrom(this);
    }
    
    @Override
    protected Builder newBuilderForType(final BuilderParent parent) {
        final Builder builder = new Builder(parent);
        return builder;
    }
    
    public static Type getDefaultInstance() {
        return Type.DEFAULT_INSTANCE;
    }
    
    public static Parser<Type> parser() {
        return Type.PARSER;
    }
    
    @Override
    public Parser<Type> getParserForType() {
        return Type.PARSER;
    }
    
    @Override
    public Type getDefaultInstanceForType() {
        return Type.DEFAULT_INSTANCE;
    }
    
    static {
        RuntimeVersion.validateProtobufGencodeVersion(RuntimeVersion.RuntimeDomain.PUBLIC, 4, 33, 0, "", "Type");
        DEFAULT_INSTANCE = new Type();
        PARSER = new AbstractParser<Type>() {
            @Override
            public Type parsePartialFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
                final Builder builder = Type.newBuilder();
                try {
                    builder.mergeFrom(input, extensionRegistry);
                }
                catch (final InvalidProtocolBufferException e) {
                    throw e.setUnfinishedMessage(builder.buildPartial());
                }
                catch (final UninitializedMessageException e2) {
                    throw e2.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
                }
                catch (final IOException e3) {
                    throw new InvalidProtocolBufferException(e3).setUnfinishedMessage(builder.buildPartial());
                }
                return builder.buildPartial();
            }
        };
    }
    
    public static final class Builder extends GeneratedMessage.Builder<Builder> implements TypeOrBuilder
    {
        private int bitField0_;
        private Object name_;
        private List<Field> fields_;
        private RepeatedFieldBuilder<Field, Field.Builder, FieldOrBuilder> fieldsBuilder_;
        private LazyStringArrayList oneofs_;
        private List<Option> options_;
        private RepeatedFieldBuilder<Option, Option.Builder, OptionOrBuilder> optionsBuilder_;
        private SourceContext sourceContext_;
        private SingleFieldBuilder<SourceContext, SourceContext.Builder, SourceContextOrBuilder> sourceContextBuilder_;
        private int syntax_;
        private Object edition_;
        
        public static final Descriptors.Descriptor getDescriptor() {
            return TypeProto.internal_static_google_protobuf_Type_descriptor;
        }
        
        @Override
        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return TypeProto.internal_static_google_protobuf_Type_fieldAccessorTable.ensureFieldAccessorsInitialized(Type.class, Builder.class);
        }
        
        private Builder() {
            this.name_ = "";
            this.fields_ = Collections.emptyList();
            this.oneofs_ = LazyStringArrayList.emptyList();
            this.options_ = Collections.emptyList();
            this.syntax_ = 0;
            this.edition_ = "";
            this.maybeForceBuilderInitialization();
        }
        
        private Builder(final BuilderParent parent) {
            super(parent);
            this.name_ = "";
            this.fields_ = Collections.emptyList();
            this.oneofs_ = LazyStringArrayList.emptyList();
            this.options_ = Collections.emptyList();
            this.syntax_ = 0;
            this.edition_ = "";
            this.maybeForceBuilderInitialization();
        }
        
        private void maybeForceBuilderInitialization() {
            if (GeneratedMessage.alwaysUseFieldBuilders) {
                this.internalGetFieldsFieldBuilder();
                this.internalGetOptionsFieldBuilder();
                this.internalGetSourceContextFieldBuilder();
            }
        }
        
        @Override
        public Builder clear() {
            super.clear();
            this.bitField0_ = 0;
            this.name_ = "";
            if (this.fieldsBuilder_ == null) {
                this.fields_ = Collections.emptyList();
            }
            else {
                this.fields_ = null;
                this.fieldsBuilder_.clear();
            }
            this.bitField0_ &= 0xFFFFFFFD;
            this.oneofs_ = LazyStringArrayList.emptyList();
            if (this.optionsBuilder_ == null) {
                this.options_ = Collections.emptyList();
            }
            else {
                this.options_ = null;
                this.optionsBuilder_.clear();
            }
            this.bitField0_ &= 0xFFFFFFF7;
            this.sourceContext_ = null;
            if (this.sourceContextBuilder_ != null) {
                this.sourceContextBuilder_.dispose();
                this.sourceContextBuilder_ = null;
            }
            this.syntax_ = 0;
            this.edition_ = "";
            return this;
        }
        
        @Override
        public Descriptors.Descriptor getDescriptorForType() {
            return TypeProto.internal_static_google_protobuf_Type_descriptor;
        }
        
        @Override
        public Type getDefaultInstanceForType() {
            return Type.getDefaultInstance();
        }
        
        @Override
        public Type build() {
            final Type result = this.buildPartial();
            if (!result.isInitialized()) {
                throw AbstractMessage.Builder.newUninitializedMessageException(result);
            }
            return result;
        }
        
        @Override
        public Type buildPartial() {
            final Type result = new Type(this, null);
            this.buildPartialRepeatedFields(result);
            if (this.bitField0_ != 0) {
                this.buildPartial0(result);
            }
            this.onBuilt();
            return result;
        }
        
        private void buildPartialRepeatedFields(final Type result) {
            if (this.fieldsBuilder_ == null) {
                if ((this.bitField0_ & 0x2) != 0x0) {
                    this.fields_ = Collections.unmodifiableList((List<? extends Field>)this.fields_);
                    this.bitField0_ &= 0xFFFFFFFD;
                }
                result.fields_ = this.fields_;
            }
            else {
                result.fields_ = this.fieldsBuilder_.build();
            }
            if (this.optionsBuilder_ == null) {
                if ((this.bitField0_ & 0x8) != 0x0) {
                    this.options_ = Collections.unmodifiableList((List<? extends Option>)this.options_);
                    this.bitField0_ &= 0xFFFFFFF7;
                }
                result.options_ = this.options_;
            }
            else {
                result.options_ = this.optionsBuilder_.build();
            }
        }
        
        private void buildPartial0(final Type result) {
            final int from_bitField0_ = this.bitField0_;
            if ((from_bitField0_ & 0x1) != 0x0) {
                result.name_ = this.name_;
            }
            if ((from_bitField0_ & 0x4) != 0x0) {
                this.oneofs_.makeImmutable();
                result.oneofs_ = this.oneofs_;
            }
            int to_bitField0_ = 0;
            if ((from_bitField0_ & 0x10) != 0x0) {
                result.sourceContext_ = ((this.sourceContextBuilder_ == null) ? this.sourceContext_ : this.sourceContextBuilder_.build());
                to_bitField0_ |= 0x1;
            }
            if ((from_bitField0_ & 0x20) != 0x0) {
                result.syntax_ = this.syntax_;
            }
            if ((from_bitField0_ & 0x40) != 0x0) {
                result.edition_ = this.edition_;
            }
            result.bitField0_ |= to_bitField0_;
        }
        
        @Override
        public Builder mergeFrom(final Message other) {
            if (other instanceof Type) {
                return this.mergeFrom((Type)other);
            }
            super.mergeFrom(other);
            return this;
        }
        
        public Builder mergeFrom(final Type other) {
            if (other == Type.getDefaultInstance()) {
                return this;
            }
            if (!other.getName().isEmpty()) {
                this.name_ = other.name_;
                this.bitField0_ |= 0x1;
                this.onChanged();
            }
            if (this.fieldsBuilder_ == null) {
                if (!other.fields_.isEmpty()) {
                    if (this.fields_.isEmpty()) {
                        this.fields_ = other.fields_;
                        this.bitField0_ &= 0xFFFFFFFD;
                    }
                    else {
                        this.ensureFieldsIsMutable();
                        this.fields_.addAll(other.fields_);
                    }
                    this.onChanged();
                }
            }
            else if (!other.fields_.isEmpty()) {
                if (this.fieldsBuilder_.isEmpty()) {
                    this.fieldsBuilder_.dispose();
                    this.fieldsBuilder_ = null;
                    this.fields_ = other.fields_;
                    this.bitField0_ &= 0xFFFFFFFD;
                    this.fieldsBuilder_ = (GeneratedMessage.alwaysUseFieldBuilders ? this.internalGetFieldsFieldBuilder() : null);
                }
                else {
                    this.fieldsBuilder_.addAllMessages(other.fields_);
                }
            }
            if (!other.oneofs_.isEmpty()) {
                if (this.oneofs_.isEmpty()) {
                    this.oneofs_ = other.oneofs_;
                    this.bitField0_ |= 0x4;
                }
                else {
                    this.ensureOneofsIsMutable();
                    this.oneofs_.addAll(other.oneofs_);
                }
                this.onChanged();
            }
            if (this.optionsBuilder_ == null) {
                if (!other.options_.isEmpty()) {
                    if (this.options_.isEmpty()) {
                        this.options_ = other.options_;
                        this.bitField0_ &= 0xFFFFFFF7;
                    }
                    else {
                        this.ensureOptionsIsMutable();
                        this.options_.addAll(other.options_);
                    }
                    this.onChanged();
                }
            }
            else if (!other.options_.isEmpty()) {
                if (this.optionsBuilder_.isEmpty()) {
                    this.optionsBuilder_.dispose();
                    this.optionsBuilder_ = null;
                    this.options_ = other.options_;
                    this.bitField0_ &= 0xFFFFFFF7;
                    this.optionsBuilder_ = (GeneratedMessage.alwaysUseFieldBuilders ? this.internalGetOptionsFieldBuilder() : null);
                }
                else {
                    this.optionsBuilder_.addAllMessages(other.options_);
                }
            }
            if (other.hasSourceContext()) {
                this.mergeSourceContext(other.getSourceContext());
            }
            if (other.syntax_ != 0) {
                this.setSyntaxValue(other.getSyntaxValue());
            }
            if (!other.getEdition().isEmpty()) {
                this.edition_ = other.edition_;
                this.bitField0_ |= 0x40;
                this.onChanged();
            }
            this.mergeUnknownFields(other.getUnknownFields());
            this.onChanged();
            return this;
        }
        
        @Override
        public final boolean isInitialized() {
            return true;
        }
        
        @Override
        public Builder mergeFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            if (extensionRegistry == null) {
                throw new NullPointerException();
            }
            try {
                boolean done = false;
                while (!done) {
                    final int tag = input.readTag();
                    switch (tag) {
                        case 0: {
                            done = true;
                            continue;
                        }
                        case 10: {
                            this.name_ = input.readStringRequireUtf8();
                            this.bitField0_ |= 0x1;
                            continue;
                        }
                        case 18: {
                            final Field m = input.readMessage(Field.parser(), extensionRegistry);
                            if (this.fieldsBuilder_ == null) {
                                this.ensureFieldsIsMutable();
                                this.fields_.add(m);
                                continue;
                            }
                            this.fieldsBuilder_.addMessage(m);
                            continue;
                        }
                        case 26: {
                            final String s = input.readStringRequireUtf8();
                            this.ensureOneofsIsMutable();
                            this.oneofs_.add(s);
                            continue;
                        }
                        case 34: {
                            final Option i = input.readMessage(Option.parser(), extensionRegistry);
                            if (this.optionsBuilder_ == null) {
                                this.ensureOptionsIsMutable();
                                this.options_.add(i);
                                continue;
                            }
                            this.optionsBuilder_.addMessage(i);
                            continue;
                        }
                        case 42: {
                            input.readMessage(this.internalGetSourceContextFieldBuilder().getBuilder(), extensionRegistry);
                            this.bitField0_ |= 0x10;
                            continue;
                        }
                        case 48: {
                            this.syntax_ = input.readEnum();
                            this.bitField0_ |= 0x20;
                            continue;
                        }
                        case 58: {
                            this.edition_ = input.readStringRequireUtf8();
                            this.bitField0_ |= 0x40;
                            continue;
                        }
                        default: {
                            if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                                done = true;
                                continue;
                            }
                            continue;
                        }
                    }
                }
            }
            catch (final InvalidProtocolBufferException e) {
                throw e.unwrapIOException();
            }
            finally {
                this.onChanged();
            }
            return this;
        }
        
        @Override
        public String getName() {
            final Object ref = this.name_;
            if (!(ref instanceof String)) {
                final ByteString bs = (ByteString)ref;
                final String s = bs.toStringUtf8();
                return (String)(this.name_ = s);
            }
            return (String)ref;
        }
        
        @Override
        public ByteString getNameBytes() {
            final Object ref = this.name_;
            if (ref instanceof String) {
                final ByteString b = ByteString.copyFromUtf8((String)ref);
                return (ByteString)(this.name_ = b);
            }
            return (ByteString)ref;
        }
        
        public Builder setName(final String value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.name_ = value;
            this.bitField0_ |= 0x1;
            this.onChanged();
            return this;
        }
        
        public Builder clearName() {
            this.name_ = Type.getDefaultInstance().getName();
            this.bitField0_ &= 0xFFFFFFFE;
            this.onChanged();
            return this;
        }
        
        public Builder setNameBytes(final ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            AbstractMessageLite.checkByteStringIsUtf8(value);
            this.name_ = value;
            this.bitField0_ |= 0x1;
            this.onChanged();
            return this;
        }
        
        private void ensureFieldsIsMutable() {
            if ((this.bitField0_ & 0x2) == 0x0) {
                this.fields_ = new ArrayList<Field>(this.fields_);
                this.bitField0_ |= 0x2;
            }
        }
        
        @Override
        public List<Field> getFieldsList() {
            if (this.fieldsBuilder_ == null) {
                return Collections.unmodifiableList((List<? extends Field>)this.fields_);
            }
            return this.fieldsBuilder_.getMessageList();
        }
        
        @Override
        public int getFieldsCount() {
            if (this.fieldsBuilder_ == null) {
                return this.fields_.size();
            }
            return this.fieldsBuilder_.getCount();
        }
        
        @Override
        public Field getFields(final int index) {
            if (this.fieldsBuilder_ == null) {
                return this.fields_.get(index);
            }
            return this.fieldsBuilder_.getMessage(index);
        }
        
        public Builder setFields(final int index, final Field value) {
            if (this.fieldsBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.ensureFieldsIsMutable();
                this.fields_.set(index, value);
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.setMessage(index, value);
            }
            return this;
        }
        
        public Builder setFields(final int index, final Field.Builder builderForValue) {
            if (this.fieldsBuilder_ == null) {
                this.ensureFieldsIsMutable();
                this.fields_.set(index, builderForValue.build());
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.setMessage(index, builderForValue.build());
            }
            return this;
        }
        
        public Builder addFields(final Field value) {
            if (this.fieldsBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.ensureFieldsIsMutable();
                this.fields_.add(value);
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.addMessage(value);
            }
            return this;
        }
        
        public Builder addFields(final int index, final Field value) {
            if (this.fieldsBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.ensureFieldsIsMutable();
                this.fields_.add(index, value);
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.addMessage(index, value);
            }
            return this;
        }
        
        public Builder addFields(final Field.Builder builderForValue) {
            if (this.fieldsBuilder_ == null) {
                this.ensureFieldsIsMutable();
                this.fields_.add(builderForValue.build());
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.addMessage(builderForValue.build());
            }
            return this;
        }
        
        public Builder addFields(final int index, final Field.Builder builderForValue) {
            if (this.fieldsBuilder_ == null) {
                this.ensureFieldsIsMutable();
                this.fields_.add(index, builderForValue.build());
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.addMessage(index, builderForValue.build());
            }
            return this;
        }
        
        public Builder addAllFields(final Iterable<? extends Field> values) {
            if (this.fieldsBuilder_ == null) {
                this.ensureFieldsIsMutable();
                AbstractMessageLite.Builder.addAll(values, this.fields_);
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.addAllMessages(values);
            }
            return this;
        }
        
        public Builder clearFields() {
            if (this.fieldsBuilder_ == null) {
                this.fields_ = Collections.emptyList();
                this.bitField0_ &= 0xFFFFFFFD;
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.clear();
            }
            return this;
        }
        
        public Builder removeFields(final int index) {
            if (this.fieldsBuilder_ == null) {
                this.ensureFieldsIsMutable();
                this.fields_.remove(index);
                this.onChanged();
            }
            else {
                this.fieldsBuilder_.remove(index);
            }
            return this;
        }
        
        public Field.Builder getFieldsBuilder(final int index) {
            return this.internalGetFieldsFieldBuilder().getBuilder(index);
        }
        
        @Override
        public FieldOrBuilder getFieldsOrBuilder(final int index) {
            if (this.fieldsBuilder_ == null) {
                return this.fields_.get(index);
            }
            return this.fieldsBuilder_.getMessageOrBuilder(index);
        }
        
        @Override
        public List<? extends FieldOrBuilder> getFieldsOrBuilderList() {
            if (this.fieldsBuilder_ != null) {
                return this.fieldsBuilder_.getMessageOrBuilderList();
            }
            return Collections.unmodifiableList((List<? extends FieldOrBuilder>)this.fields_);
        }
        
        public Field.Builder addFieldsBuilder() {
            return this.internalGetFieldsFieldBuilder().addBuilder(Field.getDefaultInstance());
        }
        
        public Field.Builder addFieldsBuilder(final int index) {
            return this.internalGetFieldsFieldBuilder().addBuilder(index, Field.getDefaultInstance());
        }
        
        public List<Field.Builder> getFieldsBuilderList() {
            return this.internalGetFieldsFieldBuilder().getBuilderList();
        }
        
        private RepeatedFieldBuilder<Field, Field.Builder, FieldOrBuilder> internalGetFieldsFieldBuilder() {
            if (this.fieldsBuilder_ == null) {
                this.fieldsBuilder_ = new RepeatedFieldBuilder<Field, Field.Builder, FieldOrBuilder>(this.fields_, (this.bitField0_ & 0x2) != 0x0, this.getParentForChildren(), this.isClean());
                this.fields_ = null;
            }
            return this.fieldsBuilder_;
        }
        
        private void ensureOneofsIsMutable() {
            if (!this.oneofs_.isModifiable()) {
                this.oneofs_ = new LazyStringArrayList(this.oneofs_);
            }
            this.bitField0_ |= 0x4;
        }
        
        @Override
        public ProtocolStringList getOneofsList() {
            this.oneofs_.makeImmutable();
            return this.oneofs_;
        }
        
        @Override
        public int getOneofsCount() {
            return this.oneofs_.size();
        }
        
        @Override
        public String getOneofs(final int index) {
            return this.oneofs_.get(index);
        }
        
        @Override
        public ByteString getOneofsBytes(final int index) {
            return this.oneofs_.getByteString(index);
        }
        
        public Builder setOneofs(final int index, final String value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.ensureOneofsIsMutable();
            this.oneofs_.set(index, value);
            this.bitField0_ |= 0x4;
            this.onChanged();
            return this;
        }
        
        public Builder addOneofs(final String value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.ensureOneofsIsMutable();
            this.oneofs_.add(value);
            this.bitField0_ |= 0x4;
            this.onChanged();
            return this;
        }
        
        public Builder addAllOneofs(final Iterable<String> values) {
            this.ensureOneofsIsMutable();
            AbstractMessageLite.Builder.addAll(values, this.oneofs_);
            this.bitField0_ |= 0x4;
            this.onChanged();
            return this;
        }
        
        public Builder clearOneofs() {
            this.oneofs_ = LazyStringArrayList.emptyList();
            this.bitField0_ &= 0xFFFFFFFB;
            this.onChanged();
            return this;
        }
        
        public Builder addOneofsBytes(final ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            AbstractMessageLite.checkByteStringIsUtf8(value);
            this.ensureOneofsIsMutable();
            this.oneofs_.add(value);
            this.bitField0_ |= 0x4;
            this.onChanged();
            return this;
        }
        
        private void ensureOptionsIsMutable() {
            if ((this.bitField0_ & 0x8) == 0x0) {
                this.options_ = new ArrayList<Option>(this.options_);
                this.bitField0_ |= 0x8;
            }
        }
        
        @Override
        public List<Option> getOptionsList() {
            if (this.optionsBuilder_ == null) {
                return Collections.unmodifiableList((List<? extends Option>)this.options_);
            }
            return this.optionsBuilder_.getMessageList();
        }
        
        @Override
        public int getOptionsCount() {
            if (this.optionsBuilder_ == null) {
                return this.options_.size();
            }
            return this.optionsBuilder_.getCount();
        }
        
        @Override
        public Option getOptions(final int index) {
            if (this.optionsBuilder_ == null) {
                return this.options_.get(index);
            }
            return this.optionsBuilder_.getMessage(index);
        }
        
        public Builder setOptions(final int index, final Option value) {
            if (this.optionsBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.ensureOptionsIsMutable();
                this.options_.set(index, value);
                this.onChanged();
            }
            else {
                this.optionsBuilder_.setMessage(index, value);
            }
            return this;
        }
        
        public Builder setOptions(final int index, final Option.Builder builderForValue) {
            if (this.optionsBuilder_ == null) {
                this.ensureOptionsIsMutable();
                this.options_.set(index, builderForValue.build());
                this.onChanged();
            }
            else {
                this.optionsBuilder_.setMessage(index, builderForValue.build());
            }
            return this;
        }
        
        public Builder addOptions(final Option value) {
            if (this.optionsBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.ensureOptionsIsMutable();
                this.options_.add(value);
                this.onChanged();
            }
            else {
                this.optionsBuilder_.addMessage(value);
            }
            return this;
        }
        
        public Builder addOptions(final int index, final Option value) {
            if (this.optionsBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.ensureOptionsIsMutable();
                this.options_.add(index, value);
                this.onChanged();
            }
            else {
                this.optionsBuilder_.addMessage(index, value);
            }
            return this;
        }
        
        public Builder addOptions(final Option.Builder builderForValue) {
            if (this.optionsBuilder_ == null) {
                this.ensureOptionsIsMutable();
                this.options_.add(builderForValue.build());
                this.onChanged();
            }
            else {
                this.optionsBuilder_.addMessage(builderForValue.build());
            }
            return this;
        }
        
        public Builder addOptions(final int index, final Option.Builder builderForValue) {
            if (this.optionsBuilder_ == null) {
                this.ensureOptionsIsMutable();
                this.options_.add(index, builderForValue.build());
                this.onChanged();
            }
            else {
                this.optionsBuilder_.addMessage(index, builderForValue.build());
            }
            return this;
        }
        
        public Builder addAllOptions(final Iterable<? extends Option> values) {
            if (this.optionsBuilder_ == null) {
                this.ensureOptionsIsMutable();
                AbstractMessageLite.Builder.addAll(values, this.options_);
                this.onChanged();
            }
            else {
                this.optionsBuilder_.addAllMessages(values);
            }
            return this;
        }
        
        public Builder clearOptions() {
            if (this.optionsBuilder_ == null) {
                this.options_ = Collections.emptyList();
                this.bitField0_ &= 0xFFFFFFF7;
                this.onChanged();
            }
            else {
                this.optionsBuilder_.clear();
            }
            return this;
        }
        
        public Builder removeOptions(final int index) {
            if (this.optionsBuilder_ == null) {
                this.ensureOptionsIsMutable();
                this.options_.remove(index);
                this.onChanged();
            }
            else {
                this.optionsBuilder_.remove(index);
            }
            return this;
        }
        
        public Option.Builder getOptionsBuilder(final int index) {
            return this.internalGetOptionsFieldBuilder().getBuilder(index);
        }
        
        @Override
        public OptionOrBuilder getOptionsOrBuilder(final int index) {
            if (this.optionsBuilder_ == null) {
                return this.options_.get(index);
            }
            return this.optionsBuilder_.getMessageOrBuilder(index);
        }
        
        @Override
        public List<? extends OptionOrBuilder> getOptionsOrBuilderList() {
            if (this.optionsBuilder_ != null) {
                return this.optionsBuilder_.getMessageOrBuilderList();
            }
            return Collections.unmodifiableList((List<? extends OptionOrBuilder>)this.options_);
        }
        
        public Option.Builder addOptionsBuilder() {
            return this.internalGetOptionsFieldBuilder().addBuilder(Option.getDefaultInstance());
        }
        
        public Option.Builder addOptionsBuilder(final int index) {
            return this.internalGetOptionsFieldBuilder().addBuilder(index, Option.getDefaultInstance());
        }
        
        public List<Option.Builder> getOptionsBuilderList() {
            return this.internalGetOptionsFieldBuilder().getBuilderList();
        }
        
        private RepeatedFieldBuilder<Option, Option.Builder, OptionOrBuilder> internalGetOptionsFieldBuilder() {
            if (this.optionsBuilder_ == null) {
                this.optionsBuilder_ = new RepeatedFieldBuilder<Option, Option.Builder, OptionOrBuilder>(this.options_, (this.bitField0_ & 0x8) != 0x0, this.getParentForChildren(), this.isClean());
                this.options_ = null;
            }
            return this.optionsBuilder_;
        }
        
        @Override
        public boolean hasSourceContext() {
            return (this.bitField0_ & 0x10) != 0x0;
        }
        
        @Override
        public SourceContext getSourceContext() {
            if (this.sourceContextBuilder_ == null) {
                return (this.sourceContext_ == null) ? SourceContext.getDefaultInstance() : this.sourceContext_;
            }
            return this.sourceContextBuilder_.getMessage();
        }
        
        public Builder setSourceContext(final SourceContext value) {
            if (this.sourceContextBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                this.sourceContext_ = value;
            }
            else {
                this.sourceContextBuilder_.setMessage(value);
            }
            this.bitField0_ |= 0x10;
            this.onChanged();
            return this;
        }
        
        public Builder setSourceContext(final SourceContext.Builder builderForValue) {
            if (this.sourceContextBuilder_ == null) {
                this.sourceContext_ = builderForValue.build();
            }
            else {
                this.sourceContextBuilder_.setMessage(builderForValue.build());
            }
            this.bitField0_ |= 0x10;
            this.onChanged();
            return this;
        }
        
        public Builder mergeSourceContext(final SourceContext value) {
            if (this.sourceContextBuilder_ == null) {
                if ((this.bitField0_ & 0x10) != 0x0 && this.sourceContext_ != null && this.sourceContext_ != SourceContext.getDefaultInstance()) {
                    this.getSourceContextBuilder().mergeFrom(value);
                }
                else {
                    this.sourceContext_ = value;
                }
            }
            else {
                this.sourceContextBuilder_.mergeFrom(value);
            }
            if (this.sourceContext_ != null) {
                this.bitField0_ |= 0x10;
                this.onChanged();
            }
            return this;
        }
        
        public Builder clearSourceContext() {
            this.bitField0_ &= 0xFFFFFFEF;
            this.sourceContext_ = null;
            if (this.sourceContextBuilder_ != null) {
                this.sourceContextBuilder_.dispose();
                this.sourceContextBuilder_ = null;
            }
            this.onChanged();
            return this;
        }
        
        public SourceContext.Builder getSourceContextBuilder() {
            this.bitField0_ |= 0x10;
            this.onChanged();
            return this.internalGetSourceContextFieldBuilder().getBuilder();
        }
        
        @Override
        public SourceContextOrBuilder getSourceContextOrBuilder() {
            if (this.sourceContextBuilder_ != null) {
                return this.sourceContextBuilder_.getMessageOrBuilder();
            }
            return (this.sourceContext_ == null) ? SourceContext.getDefaultInstance() : this.sourceContext_;
        }
        
        private SingleFieldBuilder<SourceContext, SourceContext.Builder, SourceContextOrBuilder> internalGetSourceContextFieldBuilder() {
            if (this.sourceContextBuilder_ == null) {
                this.sourceContextBuilder_ = new SingleFieldBuilder<SourceContext, SourceContext.Builder, SourceContextOrBuilder>(this.getSourceContext(), this.getParentForChildren(), this.isClean());
                this.sourceContext_ = null;
            }
            return this.sourceContextBuilder_;
        }
        
        @Override
        public int getSyntaxValue() {
            return this.syntax_;
        }
        
        public Builder setSyntaxValue(final int value) {
            this.syntax_ = value;
            this.bitField0_ |= 0x20;
            this.onChanged();
            return this;
        }
        
        @Override
        public Syntax getSyntax() {
            final Syntax result = Syntax.forNumber(this.syntax_);
            return (result == null) ? Syntax.UNRECOGNIZED : result;
        }
        
        public Builder setSyntax(final Syntax value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.bitField0_ |= 0x20;
            this.syntax_ = value.getNumber();
            this.onChanged();
            return this;
        }
        
        public Builder clearSyntax() {
            this.bitField0_ &= 0xFFFFFFDF;
            this.syntax_ = 0;
            this.onChanged();
            return this;
        }
        
        @Override
        public String getEdition() {
            final Object ref = this.edition_;
            if (!(ref instanceof String)) {
                final ByteString bs = (ByteString)ref;
                final String s = bs.toStringUtf8();
                return (String)(this.edition_ = s);
            }
            return (String)ref;
        }
        
        @Override
        public ByteString getEditionBytes() {
            final Object ref = this.edition_;
            if (ref instanceof String) {
                final ByteString b = ByteString.copyFromUtf8((String)ref);
                return (ByteString)(this.edition_ = b);
            }
            return (ByteString)ref;
        }
        
        public Builder setEdition(final String value) {
            if (value == null) {
                throw new NullPointerException();
            }
            this.edition_ = value;
            this.bitField0_ |= 0x40;
            this.onChanged();
            return this;
        }
        
        public Builder clearEdition() {
            this.edition_ = Type.getDefaultInstance().getEdition();
            this.bitField0_ &= 0xFFFFFFBF;
            this.onChanged();
            return this;
        }
        
        public Builder setEditionBytes(final ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            AbstractMessageLite.checkByteStringIsUtf8(value);
            this.edition_ = value;
            this.bitField0_ |= 0x40;
            this.onChanged();
            return this;
        }
    }
}
