// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: integration-tests/testsuite/src/test/resources/serdes/testmessage.proto

package io.apicurio.tests.protobuf;

/**
 * Protobuf type {@code io.apicurio.tests.protobuf.Header}
 */
public final class Header extends com.google.protobuf.GeneratedMessageV3 implements
        // @@protoc_insertion_point(message_implements:io.apicurio.tests.protobuf.Header)
        HeaderOrBuilder {
    private static final long serialVersionUID = 0L;

    // Use Header.newBuilder() to construct.
    private Header(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
        super(builder);
    }

    private Header() {
        source_ = "";
        destination_ = "";
        uuid_ = "";
        sourceUuids_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        messageTypeId_ = "";
        rawMessage_ = "";
    }

    @Override
    @SuppressWarnings({ "unused" })
    protected Object newInstance(UnusedPrivateParameter unused) {
        return new Header();
    }

    @Override
    public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
        return this.unknownFields;
    }

    private Header(com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
        this();
        if (extensionRegistry == null) {
            throw new NullPointerException();
        }
        int mutable_bitField0_ = 0;
        com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet
                .newBuilder();
        try {
            boolean done = false;
            while (!done) {
                int tag = input.readTag();
                switch (tag) {
                    case 0:
                        done = true;
                        break;
                    case 10: {
                        com.google.protobuf.Timestamp.Builder subBuilder = null;
                        if (time_ != null) {
                            subBuilder = time_.toBuilder();
                        }
                        time_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry);
                        if (subBuilder != null) {
                            subBuilder.mergeFrom(time_);
                            time_ = subBuilder.buildPartial();
                        }

                        break;
                    }
                    case 18: {
                        String s = input.readStringRequireUtf8();

                        source_ = s;
                        break;
                    }
                    case 26: {
                        String s = input.readStringRequireUtf8();

                        destination_ = s;
                        break;
                    }
                    case 34: {
                        String s = input.readStringRequireUtf8();

                        uuid_ = s;
                        break;
                    }
                    case 42: {
                        String s = input.readStringRequireUtf8();
                        if (!((mutable_bitField0_ & 0x00000001) != 0)) {
                            sourceUuids_ = new com.google.protobuf.LazyStringArrayList();
                            mutable_bitField0_ |= 0x00000001;
                        }
                        sourceUuids_.add(s);
                        break;
                    }
                    case 50: {
                        String s = input.readStringRequireUtf8();

                        messageTypeId_ = s;
                        break;
                    }
                    case 58: {
                        String s = input.readStringRequireUtf8();

                        rawMessage_ = s;
                        break;
                    }
                    default: {
                        if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
                            done = true;
                        }
                        break;
                    }
                }
            }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e) {
            throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
        } finally {
            if (((mutable_bitField0_ & 0x00000001) != 0)) {
                sourceUuids_ = sourceUuids_.getUnmodifiableView();
            }
            this.unknownFields = unknownFields.build();
            makeExtensionsImmutable();
        }
    }

    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
        return Testmessage.internal_static_io_apicurio_tests_protobuf_Header_descriptor;
    }

    @Override
    protected FieldAccessorTable internalGetFieldAccessorTable() {
        return Testmessage.internal_static_io_apicurio_tests_protobuf_Header_fieldAccessorTable
                .ensureFieldAccessorsInitialized(Header.class, Builder.class);
    }

    public static final int TIME_FIELD_NUMBER = 1;
    private com.google.protobuf.Timestamp time_;

    /**
     * <code>.google.protobuf.Timestamp time = 1;</code>
     * 
     * @return Whether the time field is set.
     */
    @Override
    public boolean hasTime() {
        return time_ != null;
    }

    /**
     * <code>.google.protobuf.Timestamp time = 1;</code>
     * 
     * @return The time.
     */
    @Override
    public com.google.protobuf.Timestamp getTime() {
        return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
    }

    /**
     * <code>.google.protobuf.Timestamp time = 1;</code>
     */
    @Override
    public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
        return getTime();
    }

    public static final int SOURCE_FIELD_NUMBER = 2;
    private volatile Object source_;

    /**
     * <code>string source = 2;</code>
     * 
     * @return The source.
     */
    @Override
    public String getSource() {
        Object ref = source_;
        if (ref instanceof String) {
            return (String) ref;
        } else {
            com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            source_ = s;
            return s;
        }
    }

    /**
     * <code>string source = 2;</code>
     * 
     * @return The bytes for source.
     */
    @Override
    public com.google.protobuf.ByteString getSourceBytes() {
        Object ref = source_;
        if (ref instanceof String) {
            com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
            source_ = b;
            return b;
        } else {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    public static final int DESTINATION_FIELD_NUMBER = 3;
    private volatile Object destination_;

    /**
     * <code>string destination = 3;</code>
     * 
     * @return The destination.
     */
    @Override
    public String getDestination() {
        Object ref = destination_;
        if (ref instanceof String) {
            return (String) ref;
        } else {
            com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            destination_ = s;
            return s;
        }
    }

    /**
     * <code>string destination = 3;</code>
     * 
     * @return The bytes for destination.
     */
    @Override
    public com.google.protobuf.ByteString getDestinationBytes() {
        Object ref = destination_;
        if (ref instanceof String) {
            com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
            destination_ = b;
            return b;
        } else {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    public static final int UUID_FIELD_NUMBER = 4;
    private volatile Object uuid_;

    /**
     * <code>string uuid = 4;</code>
     * 
     * @return The uuid.
     */
    @Override
    public String getUuid() {
        Object ref = uuid_;
        if (ref instanceof String) {
            return (String) ref;
        } else {
            com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            uuid_ = s;
            return s;
        }
    }

    /**
     * <code>string uuid = 4;</code>
     * 
     * @return The bytes for uuid.
     */
    @Override
    public com.google.protobuf.ByteString getUuidBytes() {
        Object ref = uuid_;
        if (ref instanceof String) {
            com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
            uuid_ = b;
            return b;
        } else {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    public static final int SOURCE_UUIDS_FIELD_NUMBER = 5;
    private com.google.protobuf.LazyStringList sourceUuids_;

    /**
     * <code>repeated string source_uuids = 5;</code>
     * 
     * @return A list containing the sourceUuids.
     */
    public com.google.protobuf.ProtocolStringList getSourceUuidsList() {
        return sourceUuids_;
    }

    /**
     * <code>repeated string source_uuids = 5;</code>
     * 
     * @return The count of sourceUuids.
     */
    public int getSourceUuidsCount() {
        return sourceUuids_.size();
    }

    /**
     * <code>repeated string source_uuids = 5;</code>
     * 
     * @param index The index of the element to return.
     * @return The sourceUuids at the given index.
     */
    public String getSourceUuids(int index) {
        return sourceUuids_.get(index);
    }

    /**
     * <code>repeated string source_uuids = 5;</code>
     * 
     * @param index The index of the value to return.
     * @return The bytes of the sourceUuids at the given index.
     */
    public com.google.protobuf.ByteString getSourceUuidsBytes(int index) {
        return sourceUuids_.getByteString(index);
    }

    public static final int MESSAGE_TYPE_ID_FIELD_NUMBER = 6;
    private volatile Object messageTypeId_;

    /**
     * <code>string message_type_id = 6;</code>
     * 
     * @return The messageTypeId.
     */
    @Override
    public String getMessageTypeId() {
        Object ref = messageTypeId_;
        if (ref instanceof String) {
            return (String) ref;
        } else {
            com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            messageTypeId_ = s;
            return s;
        }
    }

    /**
     * <code>string message_type_id = 6;</code>
     * 
     * @return The bytes for messageTypeId.
     */
    @Override
    public com.google.protobuf.ByteString getMessageTypeIdBytes() {
        Object ref = messageTypeId_;
        if (ref instanceof String) {
            com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
            messageTypeId_ = b;
            return b;
        } else {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    public static final int RAW_MESSAGE_FIELD_NUMBER = 7;
    private volatile Object rawMessage_;

    /**
     * <code>string raw_message = 7;</code>
     * 
     * @return The rawMessage.
     */
    @Override
    public String getRawMessage() {
        Object ref = rawMessage_;
        if (ref instanceof String) {
            return (String) ref;
        } else {
            com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
            String s = bs.toStringUtf8();
            rawMessage_ = s;
            return s;
        }
    }

    /**
     * <code>string raw_message = 7;</code>
     * 
     * @return The bytes for rawMessage.
     */
    @Override
    public com.google.protobuf.ByteString getRawMessageBytes() {
        Object ref = rawMessage_;
        if (ref instanceof String) {
            com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
            rawMessage_ = b;
            return b;
        } else {
            return (com.google.protobuf.ByteString) ref;
        }
    }

    private byte memoizedIsInitialized = -1;

    @Override
    public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized == 1)
            return true;
        if (isInitialized == 0)
            return false;

        memoizedIsInitialized = 1;
        return true;
    }

    @Override
    public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
        if (time_ != null) {
            output.writeMessage(1, getTime());
        }
        if (!getSourceBytes().isEmpty()) {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 2, source_);
        }
        if (!getDestinationBytes().isEmpty()) {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 3, destination_);
        }
        if (!getUuidBytes().isEmpty()) {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 4, uuid_);
        }
        for (int i = 0; i < sourceUuids_.size(); i++) {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 5, sourceUuids_.getRaw(i));
        }
        if (!getMessageTypeIdBytes().isEmpty()) {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 6, messageTypeId_);
        }
        if (!getRawMessageBytes().isEmpty()) {
            com.google.protobuf.GeneratedMessageV3.writeString(output, 7, rawMessage_);
        }
        unknownFields.writeTo(output);
    }

    @Override
    public int getSerializedSize() {
        int size = memoizedSize;
        if (size != -1)
            return size;

        size = 0;
        if (time_ != null) {
            size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTime());
        }
        if (!getSourceBytes().isEmpty()) {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, source_);
        }
        if (!getDestinationBytes().isEmpty()) {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, destination_);
        }
        if (!getUuidBytes().isEmpty()) {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, uuid_);
        }
        {
            int dataSize = 0;
            for (int i = 0; i < sourceUuids_.size(); i++) {
                dataSize += computeStringSizeNoTag(sourceUuids_.getRaw(i));
            }
            size += dataSize;
            size += 1 * getSourceUuidsList().size();
        }
        if (!getMessageTypeIdBytes().isEmpty()) {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, messageTypeId_);
        }
        if (!getRawMessageBytes().isEmpty()) {
            size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, rawMessage_);
        }
        size += unknownFields.getSerializedSize();
        memoizedSize = size;
        return size;
    }

    @Override
    public boolean equals(final Object obj) {
        if (obj == this) {
            return true;
        }
        if (!(obj instanceof Header)) {
            return super.equals(obj);
        }
        Header other = (Header) obj;

        if (hasTime() != other.hasTime())
            return false;
        if (hasTime()) {
            if (!getTime().equals(other.getTime()))
                return false;
        }
        if (!getSource().equals(other.getSource()))
            return false;
        if (!getDestination().equals(other.getDestination()))
            return false;
        if (!getUuid().equals(other.getUuid()))
            return false;
        if (!getSourceUuidsList().equals(other.getSourceUuidsList()))
            return false;
        if (!getMessageTypeId().equals(other.getMessageTypeId()))
            return false;
        if (!getRawMessage().equals(other.getRawMessage()))
            return false;
        if (!unknownFields.equals(other.unknownFields))
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        if (memoizedHashCode != 0) {
            return memoizedHashCode;
        }
        int hash = 41;
        hash = (19 * hash) + getDescriptor().hashCode();
        if (hasTime()) {
            hash = (37 * hash) + TIME_FIELD_NUMBER;
            hash = (53 * hash) + getTime().hashCode();
        }
        hash = (37 * hash) + SOURCE_FIELD_NUMBER;
        hash = (53 * hash) + getSource().hashCode();
        hash = (37 * hash) + DESTINATION_FIELD_NUMBER;
        hash = (53 * hash) + getDestination().hashCode();
        hash = (37 * hash) + UUID_FIELD_NUMBER;
        hash = (53 * hash) + getUuid().hashCode();
        if (getSourceUuidsCount() > 0) {
            hash = (37 * hash) + SOURCE_UUIDS_FIELD_NUMBER;
            hash = (53 * hash) + getSourceUuidsList().hashCode();
        }
        hash = (37 * hash) + MESSAGE_TYPE_ID_FIELD_NUMBER;
        hash = (53 * hash) + getMessageTypeId().hashCode();
        hash = (37 * hash) + RAW_MESSAGE_FIELD_NUMBER;
        hash = (53 * hash) + getRawMessage().hashCode();
        hash = (29 * hash) + unknownFields.hashCode();
        memoizedHashCode = hash;
        return hash;
    }

    public static Header parseFrom(java.nio.ByteBuffer data)
            throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
    }

    public static Header parseFrom(java.nio.ByteBuffer data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static Header parseFrom(com.google.protobuf.ByteString data)
            throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
    }

    public static Header parseFrom(com.google.protobuf.ByteString data,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static Header parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
    }

    public static Header parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
    }

    public static Header parseFrom(java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static Header parseFrom(java.io.InputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
    }

    public static Header parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
    }

    public static Header parseDelimitedFrom(java.io.InputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input,
                extensionRegistry);
    }

    public static Header parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
    }

    public static Header parseFrom(com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
        return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry);
    }

    @Override
    public Builder newBuilderForType() {
        return newBuilder();
    }

    public static Builder newBuilder() {
        return DEFAULT_INSTANCE.toBuilder();
    }

    public static Builder newBuilder(Header prototype) {
        return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
    }

    @Override
    public Builder toBuilder() {
        return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
    }

    @Override
    protected Builder newBuilderForType(BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
    }

    /**
     * Protobuf type {@code io.apicurio.tests.protobuf.Header}
     */
    public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
            implements
            // @@protoc_insertion_point(builder_implements:io.apicurio.tests.protobuf.Header)
            HeaderOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
            return Testmessage.internal_static_io_apicurio_tests_protobuf_Header_descriptor;
        }

        @Override
        protected FieldAccessorTable internalGetFieldAccessorTable() {
            return Testmessage.internal_static_io_apicurio_tests_protobuf_Header_fieldAccessorTable
                    .ensureFieldAccessorsInitialized(Header.class, Builder.class);
        }

        // Construct using io.apicurio.tests.protobuf.Header.newBuilder()
        private Builder() {
            maybeForceBuilderInitialization();
        }

        private Builder(BuilderParent parent) {
            super(parent);
            maybeForceBuilderInitialization();
        }

        private void maybeForceBuilderInitialization() {
            if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
            }
        }

        @Override
        public Builder clear() {
            super.clear();
            if (timeBuilder_ == null) {
                time_ = null;
            } else {
                time_ = null;
                timeBuilder_ = null;
            }
            source_ = "";

            destination_ = "";

            uuid_ = "";

            sourceUuids_ = com.google.protobuf.LazyStringArrayList.EMPTY;
            bitField0_ = (bitField0_ & ~0x00000001);
            messageTypeId_ = "";

            rawMessage_ = "";

            return this;
        }

        @Override
        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
            return Testmessage.internal_static_io_apicurio_tests_protobuf_Header_descriptor;
        }

        @Override
        public Header getDefaultInstanceForType() {
            return Header.getDefaultInstance();
        }

        @Override
        public Header build() {
            Header result = buildPartial();
            if (!result.isInitialized()) {
                throw newUninitializedMessageException(result);
            }
            return result;
        }

        @Override
        public Header buildPartial() {
            Header result = new Header(this);
            int from_bitField0_ = bitField0_;
            if (timeBuilder_ == null) {
                result.time_ = time_;
            } else {
                result.time_ = timeBuilder_.build();
            }
            result.source_ = source_;
            result.destination_ = destination_;
            result.uuid_ = uuid_;
            if (((bitField0_ & 0x00000001) != 0)) {
                sourceUuids_ = sourceUuids_.getUnmodifiableView();
                bitField0_ = (bitField0_ & ~0x00000001);
            }
            result.sourceUuids_ = sourceUuids_;
            result.messageTypeId_ = messageTypeId_;
            result.rawMessage_ = rawMessage_;
            onBuilt();
            return result;
        }

        @Override
        public Builder clone() {
            return super.clone();
        }

        @Override
        public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
            return super.setField(field, value);
        }

        @Override
        public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
            return super.clearField(field);
        }

        @Override
        public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
            return super.clearOneof(oneof);
        }

        @Override
        public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index,
                Object value) {
            return super.setRepeatedField(field, index, value);
        }

        @Override
        public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, Object value) {
            return super.addRepeatedField(field, value);
        }

        @Override
        public Builder mergeFrom(com.google.protobuf.Message other) {
            if (other instanceof Header) {
                return mergeFrom((Header) other);
            } else {
                super.mergeFrom(other);
                return this;
            }
        }

        public Builder mergeFrom(Header other) {
            if (other == Header.getDefaultInstance())
                return this;
            if (other.hasTime()) {
                mergeTime(other.getTime());
            }
            if (!other.getSource().isEmpty()) {
                source_ = other.source_;
                onChanged();
            }
            if (!other.getDestination().isEmpty()) {
                destination_ = other.destination_;
                onChanged();
            }
            if (!other.getUuid().isEmpty()) {
                uuid_ = other.uuid_;
                onChanged();
            }
            if (!other.sourceUuids_.isEmpty()) {
                if (sourceUuids_.isEmpty()) {
                    sourceUuids_ = other.sourceUuids_;
                    bitField0_ = (bitField0_ & ~0x00000001);
                } else {
                    ensureSourceUuidsIsMutable();
                    sourceUuids_.addAll(other.sourceUuids_);
                }
                onChanged();
            }
            if (!other.getMessageTypeId().isEmpty()) {
                messageTypeId_ = other.messageTypeId_;
                onChanged();
            }
            if (!other.getRawMessage().isEmpty()) {
                rawMessage_ = other.rawMessage_;
                onChanged();
            }
            this.mergeUnknownFields(other.unknownFields);
            onChanged();
            return this;
        }

        @Override
        public final boolean isInitialized() {
            return true;
        }

        @Override
        public Builder mergeFrom(com.google.protobuf.CodedInputStream input,
                com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException {
            Header parsedMessage = null;
            try {
                parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
            } catch (com.google.protobuf.InvalidProtocolBufferException e) {
                parsedMessage = (Header) e.getUnfinishedMessage();
                throw e.unwrapIOException();
            } finally {
                if (parsedMessage != null) {
                    mergeFrom(parsedMessage);
                }
            }
            return this;
        }

        private int bitField0_;

        private com.google.protobuf.Timestamp time_;
        private com.google.protobuf.SingleFieldBuilderV3<com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timeBuilder_;

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         * 
         * @return Whether the time field is set.
         */
        public boolean hasTime() {
            return timeBuilder_ != null || time_ != null;
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         * 
         * @return The time.
         */
        public com.google.protobuf.Timestamp getTime() {
            if (timeBuilder_ == null) {
                return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
            } else {
                return timeBuilder_.getMessage();
            }
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         */
        public Builder setTime(com.google.protobuf.Timestamp value) {
            if (timeBuilder_ == null) {
                if (value == null) {
                    throw new NullPointerException();
                }
                time_ = value;
                onChanged();
            } else {
                timeBuilder_.setMessage(value);
            }

            return this;
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         */
        public Builder setTime(com.google.protobuf.Timestamp.Builder builderForValue) {
            if (timeBuilder_ == null) {
                time_ = builderForValue.build();
                onChanged();
            } else {
                timeBuilder_.setMessage(builderForValue.build());
            }

            return this;
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         */
        public Builder mergeTime(com.google.protobuf.Timestamp value) {
            if (timeBuilder_ == null) {
                if (time_ != null) {
                    time_ = com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial();
                } else {
                    time_ = value;
                }
                onChanged();
            } else {
                timeBuilder_.mergeFrom(value);
            }

            return this;
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         */
        public Builder clearTime() {
            if (timeBuilder_ == null) {
                time_ = null;
                onChanged();
            } else {
                time_ = null;
                timeBuilder_ = null;
            }

            return this;
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         */
        public com.google.protobuf.Timestamp.Builder getTimeBuilder() {

            onChanged();
            return getTimeFieldBuilder().getBuilder();
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         */
        public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() {
            if (timeBuilder_ != null) {
                return timeBuilder_.getMessageOrBuilder();
            } else {
                return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_;
            }
        }

        /**
         * <code>.google.protobuf.Timestamp time = 1;</code>
         */
        private com.google.protobuf.SingleFieldBuilderV3<com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> getTimeFieldBuilder() {
            if (timeBuilder_ == null) {
                timeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>(
                        getTime(), getParentForChildren(), isClean());
                time_ = null;
            }
            return timeBuilder_;
        }

        private Object source_ = "";

        /**
         * <code>string source = 2;</code>
         * 
         * @return The source.
         */
        public String getSource() {
            Object ref = source_;
            if (!(ref instanceof String)) {
                com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                source_ = s;
                return s;
            } else {
                return (String) ref;
            }
        }

        /**
         * <code>string source = 2;</code>
         * 
         * @return The bytes for source.
         */
        public com.google.protobuf.ByteString getSourceBytes() {
            Object ref = source_;
            if (ref instanceof String) {
                com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                source_ = b;
                return b;
            } else {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <code>string source = 2;</code>
         * 
         * @param value The source to set.
         * @return This builder for chaining.
         */
        public Builder setSource(String value) {
            if (value == null) {
                throw new NullPointerException();
            }

            source_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>string source = 2;</code>
         * 
         * @return This builder for chaining.
         */
        public Builder clearSource() {

            source_ = getDefaultInstance().getSource();
            onChanged();
            return this;
        }

        /**
         * <code>string source = 2;</code>
         * 
         * @param value The bytes for source to set.
         * @return This builder for chaining.
         */
        public Builder setSourceBytes(com.google.protobuf.ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            source_ = value;
            onChanged();
            return this;
        }

        private Object destination_ = "";

        /**
         * <code>string destination = 3;</code>
         * 
         * @return The destination.
         */
        public String getDestination() {
            Object ref = destination_;
            if (!(ref instanceof String)) {
                com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                destination_ = s;
                return s;
            } else {
                return (String) ref;
            }
        }

        /**
         * <code>string destination = 3;</code>
         * 
         * @return The bytes for destination.
         */
        public com.google.protobuf.ByteString getDestinationBytes() {
            Object ref = destination_;
            if (ref instanceof String) {
                com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                destination_ = b;
                return b;
            } else {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <code>string destination = 3;</code>
         * 
         * @param value The destination to set.
         * @return This builder for chaining.
         */
        public Builder setDestination(String value) {
            if (value == null) {
                throw new NullPointerException();
            }

            destination_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>string destination = 3;</code>
         * 
         * @return This builder for chaining.
         */
        public Builder clearDestination() {

            destination_ = getDefaultInstance().getDestination();
            onChanged();
            return this;
        }

        /**
         * <code>string destination = 3;</code>
         * 
         * @param value The bytes for destination to set.
         * @return This builder for chaining.
         */
        public Builder setDestinationBytes(com.google.protobuf.ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            destination_ = value;
            onChanged();
            return this;
        }

        private Object uuid_ = "";

        /**
         * <code>string uuid = 4;</code>
         * 
         * @return The uuid.
         */
        public String getUuid() {
            Object ref = uuid_;
            if (!(ref instanceof String)) {
                com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                uuid_ = s;
                return s;
            } else {
                return (String) ref;
            }
        }

        /**
         * <code>string uuid = 4;</code>
         * 
         * @return The bytes for uuid.
         */
        public com.google.protobuf.ByteString getUuidBytes() {
            Object ref = uuid_;
            if (ref instanceof String) {
                com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                uuid_ = b;
                return b;
            } else {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <code>string uuid = 4;</code>
         * 
         * @param value The uuid to set.
         * @return This builder for chaining.
         */
        public Builder setUuid(String value) {
            if (value == null) {
                throw new NullPointerException();
            }

            uuid_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>string uuid = 4;</code>
         * 
         * @return This builder for chaining.
         */
        public Builder clearUuid() {

            uuid_ = getDefaultInstance().getUuid();
            onChanged();
            return this;
        }

        /**
         * <code>string uuid = 4;</code>
         * 
         * @param value The bytes for uuid to set.
         * @return This builder for chaining.
         */
        public Builder setUuidBytes(com.google.protobuf.ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            uuid_ = value;
            onChanged();
            return this;
        }

        private com.google.protobuf.LazyStringList sourceUuids_ = com.google.protobuf.LazyStringArrayList.EMPTY;

        private void ensureSourceUuidsIsMutable() {
            if (!((bitField0_ & 0x00000001) != 0)) {
                sourceUuids_ = new com.google.protobuf.LazyStringArrayList(sourceUuids_);
                bitField0_ |= 0x00000001;
            }
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @return A list containing the sourceUuids.
         */
        public com.google.protobuf.ProtocolStringList getSourceUuidsList() {
            return sourceUuids_.getUnmodifiableView();
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @return The count of sourceUuids.
         */
        public int getSourceUuidsCount() {
            return sourceUuids_.size();
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @param index The index of the element to return.
         * @return The sourceUuids at the given index.
         */
        public String getSourceUuids(int index) {
            return sourceUuids_.get(index);
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @param index The index of the value to return.
         * @return The bytes of the sourceUuids at the given index.
         */
        public com.google.protobuf.ByteString getSourceUuidsBytes(int index) {
            return sourceUuids_.getByteString(index);
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @param index The index to set the value at.
         * @param value The sourceUuids to set.
         * @return This builder for chaining.
         */
        public Builder setSourceUuids(int index, String value) {
            if (value == null) {
                throw new NullPointerException();
            }
            ensureSourceUuidsIsMutable();
            sourceUuids_.set(index, value);
            onChanged();
            return this;
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @param value The sourceUuids to add.
         * @return This builder for chaining.
         */
        public Builder addSourceUuids(String value) {
            if (value == null) {
                throw new NullPointerException();
            }
            ensureSourceUuidsIsMutable();
            sourceUuids_.add(value);
            onChanged();
            return this;
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @param values The sourceUuids to add.
         * @return This builder for chaining.
         */
        public Builder addAllSourceUuids(Iterable<String> values) {
            ensureSourceUuidsIsMutable();
            com.google.protobuf.AbstractMessageLite.Builder.addAll(values, sourceUuids_);
            onChanged();
            return this;
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @return This builder for chaining.
         */
        public Builder clearSourceUuids() {
            sourceUuids_ = com.google.protobuf.LazyStringArrayList.EMPTY;
            bitField0_ = (bitField0_ & ~0x00000001);
            onChanged();
            return this;
        }

        /**
         * <code>repeated string source_uuids = 5;</code>
         * 
         * @param value The bytes of the sourceUuids to add.
         * @return This builder for chaining.
         */
        public Builder addSourceUuidsBytes(com.google.protobuf.ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);
            ensureSourceUuidsIsMutable();
            sourceUuids_.add(value);
            onChanged();
            return this;
        }

        private Object messageTypeId_ = "";

        /**
         * <code>string message_type_id = 6;</code>
         * 
         * @return The messageTypeId.
         */
        public String getMessageTypeId() {
            Object ref = messageTypeId_;
            if (!(ref instanceof String)) {
                com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                messageTypeId_ = s;
                return s;
            } else {
                return (String) ref;
            }
        }

        /**
         * <code>string message_type_id = 6;</code>
         * 
         * @return The bytes for messageTypeId.
         */
        public com.google.protobuf.ByteString getMessageTypeIdBytes() {
            Object ref = messageTypeId_;
            if (ref instanceof String) {
                com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                messageTypeId_ = b;
                return b;
            } else {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <code>string message_type_id = 6;</code>
         * 
         * @param value The messageTypeId to set.
         * @return This builder for chaining.
         */
        public Builder setMessageTypeId(String value) {
            if (value == null) {
                throw new NullPointerException();
            }

            messageTypeId_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>string message_type_id = 6;</code>
         * 
         * @return This builder for chaining.
         */
        public Builder clearMessageTypeId() {

            messageTypeId_ = getDefaultInstance().getMessageTypeId();
            onChanged();
            return this;
        }

        /**
         * <code>string message_type_id = 6;</code>
         * 
         * @param value The bytes for messageTypeId to set.
         * @return This builder for chaining.
         */
        public Builder setMessageTypeIdBytes(com.google.protobuf.ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            messageTypeId_ = value;
            onChanged();
            return this;
        }

        private Object rawMessage_ = "";

        /**
         * <code>string raw_message = 7;</code>
         * 
         * @return The rawMessage.
         */
        public String getRawMessage() {
            Object ref = rawMessage_;
            if (!(ref instanceof String)) {
                com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
                String s = bs.toStringUtf8();
                rawMessage_ = s;
                return s;
            } else {
                return (String) ref;
            }
        }

        /**
         * <code>string raw_message = 7;</code>
         * 
         * @return The bytes for rawMessage.
         */
        public com.google.protobuf.ByteString getRawMessageBytes() {
            Object ref = rawMessage_;
            if (ref instanceof String) {
                com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref);
                rawMessage_ = b;
                return b;
            } else {
                return (com.google.protobuf.ByteString) ref;
            }
        }

        /**
         * <code>string raw_message = 7;</code>
         * 
         * @param value The rawMessage to set.
         * @return This builder for chaining.
         */
        public Builder setRawMessage(String value) {
            if (value == null) {
                throw new NullPointerException();
            }

            rawMessage_ = value;
            onChanged();
            return this;
        }

        /**
         * <code>string raw_message = 7;</code>
         * 
         * @return This builder for chaining.
         */
        public Builder clearRawMessage() {

            rawMessage_ = getDefaultInstance().getRawMessage();
            onChanged();
            return this;
        }

        /**
         * <code>string raw_message = 7;</code>
         * 
         * @param value The bytes for rawMessage to set.
         * @return This builder for chaining.
         */
        public Builder setRawMessageBytes(com.google.protobuf.ByteString value) {
            if (value == null) {
                throw new NullPointerException();
            }
            checkByteStringIsUtf8(value);

            rawMessage_ = value;
            onChanged();
            return this;
        }

        @Override
        public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
            return super.setUnknownFields(unknownFields);
        }

        @Override
        public final Builder mergeUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
            return super.mergeUnknownFields(unknownFields);
        }

        // @@protoc_insertion_point(builder_scope:io.apicurio.tests.protobuf.Header)
    }

    // @@protoc_insertion_point(class_scope:io.apicurio.tests.protobuf.Header)
    private static final Header DEFAULT_INSTANCE;
    static {
        DEFAULT_INSTANCE = new Header();
    }

    public static Header getDefaultInstance() {
        return DEFAULT_INSTANCE;
    }

    private static final com.google.protobuf.Parser<Header> PARSER = new com.google.protobuf.AbstractParser<Header>() {
        @Override
        public Header parsePartialFrom(com.google.protobuf.CodedInputStream input,
                com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                throws com.google.protobuf.InvalidProtocolBufferException {
            return new Header(input, extensionRegistry);
        }
    };

    public static com.google.protobuf.Parser<Header> parser() {
        return PARSER;
    }

    @Override
    public com.google.protobuf.Parser<Header> getParserForType() {
        return PARSER;
    }

    @Override
    public Header getDefaultInstanceForType() {
        return DEFAULT_INSTANCE;
    }

}
