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

package com.google.protobuf;

import java.util.Collection;
import java.util.ArrayList;
import java.util.Objects;
import java.util.List;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.Collections;
import java.util.Map;
import java.util.TreeMap;

public final class UnknownFieldSet implements MessageLite
{
    private final TreeMap<Integer, Field> fields;
    private static final UnknownFieldSet defaultInstance;
    private static final Parser PARSER;
    
    private UnknownFieldSet(final TreeMap<Integer, Field> fields) {
        this.fields = fields;
    }
    
    public static Builder newBuilder() {
        return create();
    }
    
    public static Builder newBuilder(final UnknownFieldSet copyFrom) {
        return newBuilder().mergeFrom(copyFrom);
    }
    
    public static UnknownFieldSet getDefaultInstance() {
        return UnknownFieldSet.defaultInstance;
    }
    
    @Override
    public UnknownFieldSet getDefaultInstanceForType() {
        return UnknownFieldSet.defaultInstance;
    }
    
    @Override
    public boolean equals(final Object other) {
        return this == other || (other instanceof UnknownFieldSet && this.fields.equals(((UnknownFieldSet)other).fields));
    }
    
    @Override
    public int hashCode() {
        if (this.fields.isEmpty()) {
            return 0;
        }
        return this.fields.hashCode();
    }
    
    public boolean isEmpty() {
        return this.fields.isEmpty();
    }
    
    public Map<Integer, Field> asMap() {
        if (this.fields.isEmpty()) {
            return Collections.emptyMap();
        }
        return (Map)this.fields.clone();
    }
    
    public boolean hasField(final int number) {
        return this.fields.containsKey(number);
    }
    
    public Field getField(final int number) {
        final Field result = this.fields.get(number);
        return (result == null) ? Field.getDefaultInstance() : result;
    }
    
    @Override
    public void writeTo(final CodedOutputStream output) throws IOException {
        if (this.fields.isEmpty()) {
            return;
        }
        for (final Map.Entry<Integer, Field> entry : this.fields.entrySet()) {
            final Field field = entry.getValue();
            field.writeTo(entry.getKey(), output);
        }
    }
    
    @Override
    public String toString() {
        return TextFormat.printer().printToString(this);
    }
    
    @Override
    public ByteString toByteString() {
        try {
            final ByteString.CodedBuilder out = ByteString.newCodedBuilder(this.getSerializedSize());
            this.writeTo(out.getCodedOutput());
            return out.build();
        }
        catch (final IOException e) {
            throw new RuntimeException("Serializing to a ByteString threw an IOException (should never happen).", e);
        }
    }
    
    @Override
    public byte[] toByteArray() {
        try {
            final byte[] result = new byte[this.getSerializedSize()];
            final CodedOutputStream output = CodedOutputStream.newInstance(result);
            this.writeTo(output);
            output.checkNoSpaceLeft();
            return result;
        }
        catch (final IOException e) {
            throw new RuntimeException("Serializing to a byte array threw an IOException (should never happen).", e);
        }
    }
    
    @Override
    public void writeTo(final OutputStream output) throws IOException {
        final CodedOutputStream codedOutput = CodedOutputStream.newInstance(output);
        this.writeTo(codedOutput);
        codedOutput.flush();
    }
    
    @Override
    public void writeDelimitedTo(final OutputStream output) throws IOException {
        final CodedOutputStream codedOutput = CodedOutputStream.newInstance(output);
        codedOutput.writeUInt32NoTag(this.getSerializedSize());
        this.writeTo(codedOutput);
        codedOutput.flush();
    }
    
    @Override
    public int getSerializedSize() {
        int result = 0;
        if (this.fields.isEmpty()) {
            return result;
        }
        for (final Map.Entry<Integer, Field> entry : this.fields.entrySet()) {
            result += entry.getValue().getSerializedSize(entry.getKey());
        }
        return result;
    }
    
    public void writeAsMessageSetTo(final CodedOutputStream output) throws IOException {
        if (this.fields.isEmpty()) {
            return;
        }
        for (final Map.Entry<Integer, Field> entry : this.fields.entrySet()) {
            entry.getValue().writeAsMessageSetExtensionTo(entry.getKey(), output);
        }
    }
    
    void writeTo(final Writer writer) throws IOException {
        if (this.fields.isEmpty()) {
            return;
        }
        if (writer.fieldOrder() == Writer.FieldOrder.DESCENDING) {
            for (final Map.Entry<Integer, Field> entry : this.fields.descendingMap().entrySet()) {
                entry.getValue().writeTo(entry.getKey(), writer);
            }
        }
        else {
            for (final Map.Entry<Integer, Field> entry : this.fields.entrySet()) {
                entry.getValue().writeTo(entry.getKey(), writer);
            }
        }
    }
    
    void writeAsMessageSetTo(final Writer writer) throws IOException {
        if (this.fields.isEmpty()) {
            return;
        }
        if (writer.fieldOrder() == Writer.FieldOrder.DESCENDING) {
            for (final Map.Entry<Integer, Field> entry : this.fields.descendingMap().entrySet()) {
                entry.getValue().writeAsMessageSetExtensionTo(entry.getKey(), writer);
            }
        }
        else {
            for (final Map.Entry<Integer, Field> entry : this.fields.entrySet()) {
                entry.getValue().writeAsMessageSetExtensionTo(entry.getKey(), writer);
            }
        }
    }
    
    public int getSerializedSizeAsMessageSet() {
        int result = 0;
        if (this.fields.isEmpty()) {
            return result;
        }
        for (final Map.Entry<Integer, Field> entry : this.fields.entrySet()) {
            result += entry.getValue().getSerializedSizeAsMessageSetExtension(entry.getKey());
        }
        return result;
    }
    
    @Override
    public boolean isInitialized() {
        return true;
    }
    
    public static UnknownFieldSet parseFrom(final CodedInputStream input) throws IOException {
        return newBuilder().mergeFrom(input).build();
    }
    
    public static UnknownFieldSet parseFrom(final ByteString data) throws InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).build();
    }
    
    public static UnknownFieldSet parseFrom(final byte[] data) throws InvalidProtocolBufferException {
        return newBuilder().mergeFrom(data).build();
    }
    
    public static UnknownFieldSet parseFrom(final InputStream input) throws IOException {
        return newBuilder().mergeFrom(input).build();
    }
    
    @Override
    public Builder newBuilderForType() {
        return newBuilder();
    }
    
    @Override
    public Builder toBuilder() {
        return newBuilder().mergeFrom(this);
    }
    
    @Override
    public final Parser getParserForType() {
        return UnknownFieldSet.PARSER;
    }
    
    static {
        defaultInstance = new UnknownFieldSet(new TreeMap<Integer, Field>());
        PARSER = new Parser();
    }
    
    public static final class Builder implements MessageLite.Builder
    {
        private TreeMap<Integer, Field.Builder> fieldBuilders;
        
        private Builder() {
            this.fieldBuilders = new TreeMap<Integer, Field.Builder>();
        }
        
        private static Builder create() {
            return new Builder();
        }
        
        private Field.Builder getFieldBuilder(final int number) {
            if (number == 0) {
                return null;
            }
            Field.Builder builder = this.fieldBuilders.get(number);
            if (builder == null) {
                builder = Field.newBuilder();
                this.fieldBuilders.put(number, builder);
            }
            return builder;
        }
        
        @Override
        public UnknownFieldSet build() {
            UnknownFieldSet result;
            if (this.fieldBuilders.isEmpty()) {
                result = UnknownFieldSet.getDefaultInstance();
            }
            else {
                final TreeMap<Integer, Field> fields = new TreeMap<Integer, Field>();
                for (final Map.Entry<Integer, Field.Builder> entry : this.fieldBuilders.entrySet()) {
                    fields.put(entry.getKey(), entry.getValue().build());
                }
                result = new UnknownFieldSet(fields, null);
            }
            return result;
        }
        
        @Override
        public UnknownFieldSet buildPartial() {
            return this.build();
        }
        
        @Override
        public Builder clone() {
            final Builder clone = UnknownFieldSet.newBuilder();
            for (final Map.Entry<Integer, Field.Builder> entry : this.fieldBuilders.entrySet()) {
                final Integer key = entry.getKey();
                final Field.Builder value = entry.getValue();
                clone.fieldBuilders.put(key, value.clone());
            }
            return clone;
        }
        
        @Override
        public UnknownFieldSet getDefaultInstanceForType() {
            return UnknownFieldSet.getDefaultInstance();
        }
        
        @Override
        public Builder clear() {
            this.fieldBuilders = new TreeMap<Integer, Field.Builder>();
            return this;
        }
        
        public Builder clearField(final int number) {
            if (number <= 0) {
                throw new IllegalArgumentException(number + " is not a valid field number.");
            }
            if (this.fieldBuilders.containsKey(number)) {
                this.fieldBuilders.remove(number);
            }
            return this;
        }
        
        public Builder mergeFrom(final UnknownFieldSet other) {
            if (other != UnknownFieldSet.getDefaultInstance()) {
                for (final Map.Entry<Integer, Field> entry : other.fields.entrySet()) {
                    this.mergeField(entry.getKey(), entry.getValue());
                }
            }
            return this;
        }
        
        public Builder mergeField(final int number, final Field field) {
            if (number <= 0) {
                throw new IllegalArgumentException(number + " is not a valid field number.");
            }
            if (this.hasField(number)) {
                this.getFieldBuilder(number).mergeFrom(field);
            }
            else {
                this.addField(number, field);
            }
            return this;
        }
        
        public Builder mergeVarintField(final int number, final int value) {
            if (number <= 0) {
                throw new IllegalArgumentException(number + " is not a valid field number.");
            }
            this.getFieldBuilder(number).addVarint(value);
            return this;
        }
        
        public Builder mergeLengthDelimitedField(final int number, final ByteString value) {
            if (number <= 0) {
                throw new IllegalArgumentException(number + " is not a valid field number.");
            }
            this.getFieldBuilder(number).addLengthDelimited(value);
            return this;
        }
        
        public boolean hasField(final int number) {
            return this.fieldBuilders.containsKey(number);
        }
        
        public Builder addField(final int number, final Field field) {
            if (number <= 0) {
                throw new IllegalArgumentException(number + " is not a valid field number.");
            }
            this.fieldBuilders.put(number, Field.newBuilder(field));
            return this;
        }
        
        public Map<Integer, Field> asMap() {
            if (this.fieldBuilders.isEmpty()) {
                return Collections.emptyMap();
            }
            final TreeMap<Integer, Field> fields = new TreeMap<Integer, Field>();
            for (final Map.Entry<Integer, Field.Builder> entry : this.fieldBuilders.entrySet()) {
                fields.put(entry.getKey(), entry.getValue().build());
            }
            return Collections.unmodifiableMap((Map<? extends Integer, ? extends Field>)fields);
        }
        
        @Override
        public Builder mergeFrom(final CodedInputStream input) throws IOException {
            int tag;
            do {
                tag = input.readTag();
            } while (tag != 0 && this.mergeFieldFrom(tag, input));
            return this;
        }
        
        public boolean mergeFieldFrom(final int tag, final CodedInputStream input) throws IOException {
            final int number = WireFormat.getTagFieldNumber(tag);
            switch (WireFormat.getTagWireType(tag)) {
                case 0: {
                    this.getFieldBuilder(number).addVarint(input.readInt64());
                    return true;
                }
                case 1: {
                    this.getFieldBuilder(number).addFixed64(input.readFixed64());
                    return true;
                }
                case 2: {
                    this.getFieldBuilder(number).addLengthDelimited(input.readBytes());
                    return true;
                }
                case 3: {
                    final Builder subBuilder = UnknownFieldSet.newBuilder();
                    input.readGroup(number, subBuilder, ExtensionRegistry.getEmptyRegistry());
                    this.getFieldBuilder(number).addGroup(subBuilder.build());
                    return true;
                }
                case 4: {
                    input.checkValidEndTag();
                    return false;
                }
                case 5: {
                    this.getFieldBuilder(number).addFixed32(input.readFixed32());
                    return true;
                }
                default: {
                    throw InvalidProtocolBufferException.invalidWireType();
                }
            }
        }
        
        @Override
        public Builder mergeFrom(final ByteString data) throws InvalidProtocolBufferException {
            try {
                final CodedInputStream input = data.newCodedInput();
                this.mergeFrom(input);
                input.checkLastTagWas(0);
                return this;
            }
            catch (final InvalidProtocolBufferException e) {
                throw e;
            }
            catch (final IOException e2) {
                throw new RuntimeException("Reading from a ByteString threw an IOException (should never happen).", e2);
            }
        }
        
        @Override
        public Builder mergeFrom(final byte[] data) throws InvalidProtocolBufferException {
            try {
                final CodedInputStream input = CodedInputStream.newInstance(data);
                this.mergeFrom(input);
                input.checkLastTagWas(0);
                return this;
            }
            catch (final InvalidProtocolBufferException e) {
                throw e;
            }
            catch (final IOException e2) {
                throw new RuntimeException("Reading from a byte array threw an IOException (should never happen).", e2);
            }
        }
        
        @Override
        public Builder mergeFrom(final InputStream input) throws IOException {
            final CodedInputStream codedInput = CodedInputStream.newInstance(input);
            this.mergeFrom(codedInput);
            codedInput.checkLastTagWas(0);
            return this;
        }
        
        @Override
        public boolean mergeDelimitedFrom(final InputStream input) throws IOException {
            final int firstByte = input.read();
            if (firstByte == -1) {
                return false;
            }
            final int size = CodedInputStream.readRawVarint32(firstByte, input);
            final InputStream limitedInput = new AbstractMessageLite.Builder.LimitedInputStream(input, size);
            this.mergeFrom(limitedInput);
            return true;
        }
        
        @Override
        public boolean mergeDelimitedFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            return this.mergeDelimitedFrom(input);
        }
        
        @Override
        public Builder mergeFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            return this.mergeFrom(input);
        }
        
        @Override
        public Builder mergeFrom(final ByteString data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            return this.mergeFrom(data);
        }
        
        @Override
        public Builder mergeFrom(final byte[] data, final int off, final int len) throws InvalidProtocolBufferException {
            try {
                final CodedInputStream input = CodedInputStream.newInstance(data, off, len);
                this.mergeFrom(input);
                input.checkLastTagWas(0);
                return this;
            }
            catch (final InvalidProtocolBufferException e) {
                throw e;
            }
            catch (final IOException e2) {
                throw new RuntimeException("Reading from a byte array threw an IOException (should never happen).", e2);
            }
        }
        
        @Override
        public Builder mergeFrom(final byte[] data, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            return this.mergeFrom(data);
        }
        
        @Override
        public Builder mergeFrom(final byte[] data, final int off, final int len, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            return this.mergeFrom(data, off, len);
        }
        
        @Override
        public Builder mergeFrom(final InputStream input, final ExtensionRegistryLite extensionRegistry) throws IOException {
            return this.mergeFrom(input);
        }
        
        @Override
        public Builder mergeFrom(final MessageLite m) {
            if (m instanceof UnknownFieldSet) {
                return this.mergeFrom((UnknownFieldSet)m);
            }
            throw new IllegalArgumentException("mergeFrom(MessageLite) can only merge messages of the same type.");
        }
        
        @Override
        public boolean isInitialized() {
            return true;
        }
    }
    
    public static final class Field
    {
        private static final Field fieldDefaultInstance;
        private LongArrayList varint;
        private IntArrayList fixed32;
        private LongArrayList fixed64;
        private List<ByteString> lengthDelimited;
        private List<UnknownFieldSet> group;
        
        private Field() {
        }
        
        public static Builder newBuilder() {
            return create();
        }
        
        public static Builder newBuilder(final Field copyFrom) {
            return newBuilder().mergeFrom(copyFrom);
        }
        
        public static Field getDefaultInstance() {
            return Field.fieldDefaultInstance;
        }
        
        public List<Long> getVarintList() {
            return this.varint;
        }
        
        public List<Integer> getFixed32List() {
            return this.fixed32;
        }
        
        public List<Long> getFixed64List() {
            return this.fixed64;
        }
        
        public List<ByteString> getLengthDelimitedList() {
            return this.lengthDelimited;
        }
        
        public List<UnknownFieldSet> getGroupList() {
            return this.group;
        }
        
        @Override
        public boolean equals(final Object other) {
            if (this == other) {
                return true;
            }
            if (!(other instanceof Field)) {
                return false;
            }
            final Field that = (Field)other;
            return Objects.equals(this.varint, that.varint) && Objects.equals(this.fixed32, that.fixed32) && Objects.equals(this.fixed64, that.fixed64) && Objects.equals(this.lengthDelimited, that.lengthDelimited) && Objects.equals(this.group, that.group);
        }
        
        @Override
        public int hashCode() {
            int result = 1;
            result = 31 * result + Objects.hashCode(this.varint);
            result = 31 * result + Objects.hashCode(this.fixed32);
            result = 31 * result + Objects.hashCode(this.fixed64);
            result = 31 * result + Objects.hashCode(this.lengthDelimited);
            result = 31 * result + Objects.hashCode(this.group);
            return result;
        }
        
        public ByteString toByteString(final int fieldNumber) {
            try {
                final ByteString.CodedBuilder out = ByteString.newCodedBuilder(this.getSerializedSize(fieldNumber));
                this.writeTo(fieldNumber, out.getCodedOutput());
                return out.build();
            }
            catch (final IOException e) {
                throw new RuntimeException("Serializing to a ByteString should never fail with an IOException", e);
            }
        }
        
        public void writeTo(final int fieldNumber, final CodedOutputStream output) throws IOException {
            for (int i = 0; i < this.varint.size(); ++i) {
                final long value = this.varint.getLong(i);
                output.writeUInt64(fieldNumber, value);
            }
            for (int i = 0; i < this.fixed32.size(); ++i) {
                final int value2 = this.fixed32.getInt(i);
                output.writeFixed32(fieldNumber, value2);
            }
            for (int i = 0; i < this.fixed64.size(); ++i) {
                final long value = this.fixed64.getLong(i);
                output.writeFixed64(fieldNumber, value);
            }
            for (int i = 0; i < this.lengthDelimited.size(); ++i) {
                final ByteString value3 = this.lengthDelimited.get(i);
                output.writeBytes(fieldNumber, value3);
            }
            for (int i = 0; i < this.group.size(); ++i) {
                final UnknownFieldSet value4 = this.group.get(i);
                output.writeGroup(fieldNumber, value4);
            }
        }
        
        public int getSerializedSize(final int fieldNumber) {
            int result = 0;
            for (int i = 0; i < this.varint.size(); ++i) {
                final long value = this.varint.getLong(i);
                result += CodedOutputStream.computeUInt64Size(fieldNumber, value);
            }
            for (int i = 0; i < this.fixed32.size(); ++i) {
                final int value2 = this.fixed32.getInt(i);
                result += CodedOutputStream.computeFixed32Size(fieldNumber, value2);
            }
            for (int i = 0; i < this.fixed64.size(); ++i) {
                final long value = this.fixed64.getLong(i);
                result += CodedOutputStream.computeFixed64Size(fieldNumber, value);
            }
            for (int i = 0; i < this.lengthDelimited.size(); ++i) {
                final ByteString value3 = this.lengthDelimited.get(i);
                result += CodedOutputStream.computeBytesSize(fieldNumber, value3);
            }
            for (int i = 0; i < this.group.size(); ++i) {
                final UnknownFieldSet value4 = this.group.get(i);
                result += CodedOutputStream.computeGroupSize(fieldNumber, value4);
            }
            return result;
        }
        
        public void writeAsMessageSetExtensionTo(final int fieldNumber, final CodedOutputStream output) throws IOException {
            for (int i = 0; i < this.lengthDelimited.size(); ++i) {
                final ByteString value = this.lengthDelimited.get(i);
                output.writeRawMessageSetExtension(fieldNumber, value);
            }
        }
        
        void writeTo(final int fieldNumber, final Writer writer) throws IOException {
            writer.writeInt64List(fieldNumber, this.varint, false);
            writer.writeFixed32List(fieldNumber, this.fixed32, false);
            writer.writeFixed64List(fieldNumber, this.fixed64, false);
            writer.writeBytesList(fieldNumber, this.lengthDelimited);
            if (writer.fieldOrder() == Writer.FieldOrder.ASCENDING) {
                for (int i = 0; i < this.group.size(); ++i) {
                    writer.writeStartGroup(fieldNumber);
                    this.group.get(i).writeTo(writer);
                    writer.writeEndGroup(fieldNumber);
                }
            }
            else {
                for (int i = this.group.size() - 1; i >= 0; --i) {
                    writer.writeEndGroup(fieldNumber);
                    this.group.get(i).writeTo(writer);
                    writer.writeStartGroup(fieldNumber);
                }
            }
        }
        
        private void writeAsMessageSetExtensionTo(final int fieldNumber, final Writer writer) throws IOException {
            if (writer.fieldOrder() == Writer.FieldOrder.DESCENDING) {
                for (int i = this.lengthDelimited.size() - 1; i >= 0; --i) {
                    final ByteString value = this.lengthDelimited.get(i);
                    writer.writeMessageSetItem(fieldNumber, value);
                }
            }
            else {
                for (int i = 0; i < this.lengthDelimited.size(); ++i) {
                    final ByteString value = this.lengthDelimited.get(i);
                    writer.writeMessageSetItem(fieldNumber, value);
                }
            }
        }
        
        public int getSerializedSizeAsMessageSetExtension(final int fieldNumber) {
            int result = 0;
            for (int i = 0; i < this.lengthDelimited.size(); ++i) {
                final ByteString value = this.lengthDelimited.get(i);
                result += CodedOutputStream.computeRawMessageSetExtensionSize(fieldNumber, value);
            }
            return result;
        }
        
        static {
            fieldDefaultInstance = newBuilder().build();
        }
        
        public static final class Builder
        {
            private Field result;
            
            private Builder() {
                this.result = new Field();
            }
            
            private static Builder create() {
                final Builder builder = new Builder();
                return builder;
            }
            
            public Builder clone() {
                final Field copy = new Field();
                if (this.result.varint == null) {
                    copy.varint = null;
                }
                else {
                    copy.varint = new LongArrayList(this.result.varint, true);
                }
                if (this.result.fixed32 == null) {
                    copy.fixed32 = null;
                }
                else {
                    copy.fixed32 = new IntArrayList(this.result.fixed32, true);
                }
                if (this.result.fixed64 == null) {
                    copy.fixed64 = null;
                }
                else {
                    copy.fixed64 = new LongArrayList(this.result.fixed64, true);
                }
                if (this.result.lengthDelimited == null) {
                    copy.lengthDelimited = null;
                }
                else {
                    copy.lengthDelimited = (List<ByteString>)new ArrayList(this.result.lengthDelimited);
                }
                if (this.result.group == null) {
                    copy.group = null;
                }
                else {
                    copy.group = (List<UnknownFieldSet>)new ArrayList(this.result.group);
                }
                final Builder clone = new Builder();
                clone.result = copy;
                return clone;
            }
            
            public Field build() {
                final Field built = new Field();
                if (this.result.varint == null) {
                    built.varint = LongArrayList.emptyList();
                }
                else {
                    built.varint = new LongArrayList(this.result.varint, false);
                }
                if (this.result.fixed32 == null) {
                    built.fixed32 = IntArrayList.emptyList();
                }
                else {
                    built.fixed32 = new IntArrayList(this.result.fixed32, false);
                }
                if (this.result.fixed64 == null) {
                    built.fixed64 = LongArrayList.emptyList();
                }
                else {
                    built.fixed64 = new LongArrayList(this.result.fixed64, false);
                }
                if (this.result.lengthDelimited == null) {
                    built.lengthDelimited = (List<ByteString>)Collections.emptyList();
                }
                else {
                    built.lengthDelimited = (List<ByteString>)Collections.unmodifiableList((List<?>)new ArrayList<Object>(this.result.lengthDelimited));
                }
                if (this.result.group == null) {
                    built.group = (List<UnknownFieldSet>)Collections.emptyList();
                }
                else {
                    built.group = (List<UnknownFieldSet>)Collections.unmodifiableList((List<?>)new ArrayList<Object>(this.result.group));
                }
                return built;
            }
            
            public Builder clear() {
                this.result = new Field();
                return this;
            }
            
            public Builder mergeFrom(final Field other) {
                if (!other.varint.isEmpty()) {
                    if (this.result.varint == null) {
                        this.result.varint = new LongArrayList();
                    }
                    this.result.varint.addAll(other.varint);
                }
                if (!other.fixed32.isEmpty()) {
                    if (this.result.fixed32 == null) {
                        this.result.fixed32 = new IntArrayList();
                    }
                    this.result.fixed32.addAll(other.fixed32);
                }
                if (!other.fixed64.isEmpty()) {
                    if (this.result.fixed64 == null) {
                        this.result.fixed64 = new LongArrayList();
                    }
                    this.result.fixed64.addAll(other.fixed64);
                }
                if (!other.lengthDelimited.isEmpty()) {
                    if (this.result.lengthDelimited == null) {
                        this.result.lengthDelimited = (List<ByteString>)new ArrayList();
                    }
                    this.result.lengthDelimited.addAll(other.lengthDelimited);
                }
                if (!other.group.isEmpty()) {
                    if (this.result.group == null) {
                        this.result.group = (List<UnknownFieldSet>)new ArrayList();
                    }
                    this.result.group.addAll(other.group);
                }
                return this;
            }
            
            public Builder addVarint(final long value) {
                if (this.result.varint == null) {
                    this.result.varint = new LongArrayList();
                }
                this.result.varint.addLong(value);
                return this;
            }
            
            public Builder addFixed32(final int value) {
                if (this.result.fixed32 == null) {
                    this.result.fixed32 = new IntArrayList();
                }
                this.result.fixed32.addInt(value);
                return this;
            }
            
            public Builder addFixed64(final long value) {
                if (this.result.fixed64 == null) {
                    this.result.fixed64 = new LongArrayList();
                }
                this.result.fixed64.addLong(value);
                return this;
            }
            
            public Builder addLengthDelimited(final ByteString value) {
                if (this.result.lengthDelimited == null) {
                    this.result.lengthDelimited = (List<ByteString>)new ArrayList();
                }
                this.result.lengthDelimited.add(value);
                return this;
            }
            
            public Builder addGroup(final UnknownFieldSet value) {
                if (this.result.group == null) {
                    this.result.group = (List<UnknownFieldSet>)new ArrayList();
                }
                this.result.group.add(value);
                return this;
            }
        }
    }
    
    public static final class Parser extends AbstractParser<UnknownFieldSet>
    {
        @Override
        public UnknownFieldSet parsePartialFrom(final CodedInputStream input, final ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException {
            final Builder builder = UnknownFieldSet.newBuilder();
            try {
                builder.mergeFrom(input);
            }
            catch (final InvalidProtocolBufferException e) {
                throw e.setUnfinishedMessage(builder.buildPartial());
            }
            catch (final IOException e2) {
                throw new InvalidProtocolBufferException(e2).setUnfinishedMessage(builder.buildPartial());
            }
            return builder.buildPartial();
        }
    }
}
