// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: bw2.proto

package pl.edu.icm.coansys.models;

public final class DocumentProtos {
  private DocumentProtos() {}
  public static void registerAllExtensions(
      com.google.protobuf.ExtensionRegistry registry) {
  }
  public interface ProvenanceInfoOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;
    /**
     * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
     */
    boolean hasCurrentProvenance();
    /**
     * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo getCurrentProvenance();
    /**
     * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder getCurrentProvenanceOrBuilder();

    // repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo> 
        getPreviousProvenancesList();
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo getPreviousProvenances(int index);
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    int getPreviousProvenancesCount();
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder> 
        getPreviousProvenancesOrBuilderList();
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder getPreviousProvenancesOrBuilder(
        int index);
  }
  /**
   * Protobuf type {@code ProvenanceInfo}
   */
  public static final class ProvenanceInfo extends
      com.google.protobuf.GeneratedMessage
      implements ProvenanceInfoOrBuilder {
    // Use ProvenanceInfo.newBuilder() to construct.
    private ProvenanceInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private ProvenanceInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final ProvenanceInfo defaultInstance;
    public static ProvenanceInfo getDefaultInstance() {
      return defaultInstance;
    }

    public ProvenanceInfo getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private ProvenanceInfo(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder subBuilder = null;
              if (((bitField0_ & 0x00000001) == 0x00000001)) {
                subBuilder = currentProvenance_.toBuilder();
              }
              currentProvenance_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(currentProvenance_);
                currentProvenance_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000001;
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                previousProvenances_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo>();
                mutable_bitField0_ |= 0x00000002;
              }
              previousProvenances_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.PARSER, extensionRegistry));
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
          previousProvenances_ = java.util.Collections.unmodifiableList(previousProvenances_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.class, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder.class);
    }

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

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

    public interface SingleProvenanceInfoOrBuilder
        extends com.google.protobuf.MessageOrBuilder {

      // required string lastModificationMarkerId = 1;
      /**
       * <code>required string lastModificationMarkerId = 1;</code>
       */
      boolean hasLastModificationMarkerId();
      /**
       * <code>required string lastModificationMarkerId = 1;</code>
       */
      java.lang.String getLastModificationMarkerId();
      /**
       * <code>required string lastModificationMarkerId = 1;</code>
       */
      com.google.protobuf.ByteString
          getLastModificationMarkerIdBytes();

      // required int64 lastModificationDate = 2;
      /**
       * <code>required int64 lastModificationDate = 2;</code>
       */
      boolean hasLastModificationDate();
      /**
       * <code>required int64 lastModificationDate = 2;</code>
       */
      long getLastModificationDate();
    }
    /**
     * Protobuf type {@code ProvenanceInfo.SingleProvenanceInfo}
     */
    public static final class SingleProvenanceInfo extends
        com.google.protobuf.GeneratedMessage
        implements SingleProvenanceInfoOrBuilder {
      // Use SingleProvenanceInfo.newBuilder() to construct.
      private SingleProvenanceInfo(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
        super(builder);
        this.unknownFields = builder.getUnknownFields();
      }
      private SingleProvenanceInfo(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

      private static final SingleProvenanceInfo defaultInstance;
      public static SingleProvenanceInfo getDefaultInstance() {
        return defaultInstance;
      }

      public SingleProvenanceInfo getDefaultInstanceForType() {
        return defaultInstance;
      }

      private final com.google.protobuf.UnknownFieldSet unknownFields;
      @java.lang.Override
      public final com.google.protobuf.UnknownFieldSet
          getUnknownFields() {
        return this.unknownFields;
      }
      private SingleProvenanceInfo(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        initFields();
        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;
              default: {
                if (!parseUnknownField(input, unknownFields,
                                       extensionRegistry, tag)) {
                  done = true;
                }
                break;
              }
              case 10: {
                bitField0_ |= 0x00000001;
                lastModificationMarkerId_ = input.readBytes();
                break;
              }
              case 16: {
                bitField0_ |= 0x00000002;
                lastModificationDate_ = input.readInt64();
                break;
              }
            }
          }
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          throw e.setUnfinishedMessage(this);
        } catch (java.io.IOException e) {
          throw new com.google.protobuf.InvalidProtocolBufferException(
              e.getMessage()).setUnfinishedMessage(this);
        } finally {
          this.unknownFields = unknownFields.build();
          makeExtensionsImmutable();
        }
      }
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_SingleProvenanceInfo_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_SingleProvenanceInfo_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.class, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder.class);
      }

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

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

      private int bitField0_;
      // required string lastModificationMarkerId = 1;
      public static final int LASTMODIFICATIONMARKERID_FIELD_NUMBER = 1;
      private java.lang.Object lastModificationMarkerId_;
      /**
       * <code>required string lastModificationMarkerId = 1;</code>
       */
      public boolean hasLastModificationMarkerId() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string lastModificationMarkerId = 1;</code>
       */
      public java.lang.String getLastModificationMarkerId() {
        java.lang.Object ref = lastModificationMarkerId_;
        if (ref instanceof java.lang.String) {
          return (java.lang.String) ref;
        } else {
          com.google.protobuf.ByteString bs = 
              (com.google.protobuf.ByteString) ref;
          java.lang.String s = bs.toStringUtf8();
          if (bs.isValidUtf8()) {
            lastModificationMarkerId_ = s;
          }
          return s;
        }
      }
      /**
       * <code>required string lastModificationMarkerId = 1;</code>
       */
      public com.google.protobuf.ByteString
          getLastModificationMarkerIdBytes() {
        java.lang.Object ref = lastModificationMarkerId_;
        if (ref instanceof java.lang.String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          lastModificationMarkerId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }

      // required int64 lastModificationDate = 2;
      public static final int LASTMODIFICATIONDATE_FIELD_NUMBER = 2;
      private long lastModificationDate_;
      /**
       * <code>required int64 lastModificationDate = 2;</code>
       */
      public boolean hasLastModificationDate() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required int64 lastModificationDate = 2;</code>
       */
      public long getLastModificationDate() {
        return lastModificationDate_;
      }

      private void initFields() {
        lastModificationMarkerId_ = "";
        lastModificationDate_ = 0L;
      }
      private byte memoizedIsInitialized = -1;
      public final boolean isInitialized() {
        byte isInitialized = memoizedIsInitialized;
        if (isInitialized != -1) return isInitialized == 1;

        if (!hasLastModificationMarkerId()) {
          memoizedIsInitialized = 0;
          return false;
        }
        if (!hasLastModificationDate()) {
          memoizedIsInitialized = 0;
          return false;
        }
        memoizedIsInitialized = 1;
        return true;
      }

      public void writeTo(com.google.protobuf.CodedOutputStream output)
                          throws java.io.IOException {
        getSerializedSize();
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          output.writeBytes(1, getLastModificationMarkerIdBytes());
        }
        if (((bitField0_ & 0x00000002) == 0x00000002)) {
          output.writeInt64(2, lastModificationDate_);
        }
        getUnknownFields().writeTo(output);
      }

      private int memoizedSerializedSize = -1;
      public int getSerializedSize() {
        int size = memoizedSerializedSize;
        if (size != -1) return size;

        size = 0;
        if (((bitField0_ & 0x00000001) == 0x00000001)) {
          size += com.google.protobuf.CodedOutputStream
            .computeBytesSize(1, getLastModificationMarkerIdBytes());
        }
        if (((bitField0_ & 0x00000002) == 0x00000002)) {
          size += com.google.protobuf.CodedOutputStream
            .computeInt64Size(2, lastModificationDate_);
        }
        size += getUnknownFields().getSerializedSize();
        memoizedSerializedSize = size;
        return size;
      }

      private static final long serialVersionUID = 0L;
      @java.lang.Override
      protected java.lang.Object writeReplace()
          throws java.io.ObjectStreamException {
        return super.writeReplace();
      }

      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(
          com.google.protobuf.ByteString data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(
          com.google.protobuf.ByteString data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(byte[] data)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(
          byte[] data,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws com.google.protobuf.InvalidProtocolBufferException {
        return PARSER.parseFrom(data, extensionRegistry);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(java.io.InputStream input)
          throws java.io.IOException {
        return PARSER.parseFrom(input);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return PARSER.parseFrom(input, extensionRegistry);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseDelimitedFrom(java.io.InputStream input)
          throws java.io.IOException {
        return PARSER.parseDelimitedFrom(input);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseDelimitedFrom(
          java.io.InputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return PARSER.parseDelimitedFrom(input, extensionRegistry);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(
          com.google.protobuf.CodedInputStream input)
          throws java.io.IOException {
        return PARSER.parseFrom(input);
      }
      public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parseFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        return PARSER.parseFrom(input, extensionRegistry);
      }

      public static Builder newBuilder() { return Builder.create(); }
      public Builder newBuilderForType() { return newBuilder(); }
      public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo prototype) {
        return newBuilder().mergeFrom(prototype);
      }
      public Builder toBuilder() { return newBuilder(this); }

      @java.lang.Override
      protected Builder newBuilderForType(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        Builder builder = new Builder(parent);
        return builder;
      }
      /**
       * Protobuf type {@code ProvenanceInfo.SingleProvenanceInfo}
       */
      public static final class Builder extends
          com.google.protobuf.GeneratedMessage.Builder<Builder>
         implements pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder {
        public static final com.google.protobuf.Descriptors.Descriptor
            getDescriptor() {
          return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_SingleProvenanceInfo_descriptor;
        }

        protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
            internalGetFieldAccessorTable() {
          return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_SingleProvenanceInfo_fieldAccessorTable
              .ensureFieldAccessorsInitialized(
                  pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.class, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder.class);
        }

        // Construct using pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.newBuilder()
        private Builder() {
          maybeForceBuilderInitialization();
        }

        private Builder(
            com.google.protobuf.GeneratedMessage.BuilderParent parent) {
          super(parent);
          maybeForceBuilderInitialization();
        }
        private void maybeForceBuilderInitialization() {
          if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          }
        }
        private static Builder create() {
          return new Builder();
        }

        public Builder clear() {
          super.clear();
          lastModificationMarkerId_ = "";
          bitField0_ = (bitField0_ & ~0x00000001);
          lastModificationDate_ = 0L;
          bitField0_ = (bitField0_ & ~0x00000002);
          return this;
        }

        public Builder clone() {
          return create().mergeFrom(buildPartial());
        }

        public com.google.protobuf.Descriptors.Descriptor
            getDescriptorForType() {
          return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_SingleProvenanceInfo_descriptor;
        }

        public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo getDefaultInstanceForType() {
          return pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance();
        }

        public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo build() {
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo result = buildPartial();
          if (!result.isInitialized()) {
            throw newUninitializedMessageException(result);
          }
          return result;
        }

        public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo buildPartial() {
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo result = new pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo(this);
          int from_bitField0_ = bitField0_;
          int to_bitField0_ = 0;
          if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
            to_bitField0_ |= 0x00000001;
          }
          result.lastModificationMarkerId_ = lastModificationMarkerId_;
          if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
            to_bitField0_ |= 0x00000002;
          }
          result.lastModificationDate_ = lastModificationDate_;
          result.bitField0_ = to_bitField0_;
          onBuilt();
          return result;
        }

        public Builder mergeFrom(com.google.protobuf.Message other) {
          if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo) {
            return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo)other);
          } else {
            super.mergeFrom(other);
            return this;
          }
        }

        public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo other) {
          if (other == pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance()) return this;
          if (other.hasLastModificationMarkerId()) {
            bitField0_ |= 0x00000001;
            lastModificationMarkerId_ = other.lastModificationMarkerId_;
            onChanged();
          }
          if (other.hasLastModificationDate()) {
            setLastModificationDate(other.getLastModificationDate());
          }
          this.mergeUnknownFields(other.getUnknownFields());
          return this;
        }

        public final boolean isInitialized() {
          if (!hasLastModificationMarkerId()) {
            
            return false;
          }
          if (!hasLastModificationDate()) {
            
            return false;
          }
          return true;
        }

        public Builder mergeFrom(
            com.google.protobuf.CodedInputStream input,
            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
            throws java.io.IOException {
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo parsedMessage = null;
          try {
            parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
          } catch (com.google.protobuf.InvalidProtocolBufferException e) {
            parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo) e.getUnfinishedMessage();
            throw e;
          } finally {
            if (parsedMessage != null) {
              mergeFrom(parsedMessage);
            }
          }
          return this;
        }
        private int bitField0_;

        // required string lastModificationMarkerId = 1;
        private java.lang.Object lastModificationMarkerId_ = "";
        /**
         * <code>required string lastModificationMarkerId = 1;</code>
         */
        public boolean hasLastModificationMarkerId() {
          return ((bitField0_ & 0x00000001) == 0x00000001);
        }
        /**
         * <code>required string lastModificationMarkerId = 1;</code>
         */
        public java.lang.String getLastModificationMarkerId() {
          java.lang.Object ref = lastModificationMarkerId_;
          if (!(ref instanceof java.lang.String)) {
            java.lang.String s = ((com.google.protobuf.ByteString) ref)
                .toStringUtf8();
            lastModificationMarkerId_ = s;
            return s;
          } else {
            return (java.lang.String) ref;
          }
        }
        /**
         * <code>required string lastModificationMarkerId = 1;</code>
         */
        public com.google.protobuf.ByteString
            getLastModificationMarkerIdBytes() {
          java.lang.Object ref = lastModificationMarkerId_;
          if (ref instanceof String) {
            com.google.protobuf.ByteString b = 
                com.google.protobuf.ByteString.copyFromUtf8(
                    (java.lang.String) ref);
            lastModificationMarkerId_ = b;
            return b;
          } else {
            return (com.google.protobuf.ByteString) ref;
          }
        }
        /**
         * <code>required string lastModificationMarkerId = 1;</code>
         */
        public Builder setLastModificationMarkerId(
            java.lang.String value) {
          if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
          lastModificationMarkerId_ = value;
          onChanged();
          return this;
        }
        /**
         * <code>required string lastModificationMarkerId = 1;</code>
         */
        public Builder clearLastModificationMarkerId() {
          bitField0_ = (bitField0_ & ~0x00000001);
          lastModificationMarkerId_ = getDefaultInstance().getLastModificationMarkerId();
          onChanged();
          return this;
        }
        /**
         * <code>required string lastModificationMarkerId = 1;</code>
         */
        public Builder setLastModificationMarkerIdBytes(
            com.google.protobuf.ByteString value) {
          if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
          lastModificationMarkerId_ = value;
          onChanged();
          return this;
        }

        // required int64 lastModificationDate = 2;
        private long lastModificationDate_ ;
        /**
         * <code>required int64 lastModificationDate = 2;</code>
         */
        public boolean hasLastModificationDate() {
          return ((bitField0_ & 0x00000002) == 0x00000002);
        }
        /**
         * <code>required int64 lastModificationDate = 2;</code>
         */
        public long getLastModificationDate() {
          return lastModificationDate_;
        }
        /**
         * <code>required int64 lastModificationDate = 2;</code>
         */
        public Builder setLastModificationDate(long value) {
          bitField0_ |= 0x00000002;
          lastModificationDate_ = value;
          onChanged();
          return this;
        }
        /**
         * <code>required int64 lastModificationDate = 2;</code>
         */
        public Builder clearLastModificationDate() {
          bitField0_ = (bitField0_ & ~0x00000002);
          lastModificationDate_ = 0L;
          onChanged();
          return this;
        }

        // @@protoc_insertion_point(builder_scope:ProvenanceInfo.SingleProvenanceInfo)
      }

      static {
        defaultInstance = new SingleProvenanceInfo(true);
        defaultInstance.initFields();
      }

      // @@protoc_insertion_point(class_scope:ProvenanceInfo.SingleProvenanceInfo)
    }

    private int bitField0_;
    // required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;
    public static final int CURRENTPROVENANCE_FIELD_NUMBER = 1;
    private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo currentProvenance_;
    /**
     * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
     */
    public boolean hasCurrentProvenance() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo getCurrentProvenance() {
      return currentProvenance_;
    }
    /**
     * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder getCurrentProvenanceOrBuilder() {
      return currentProvenance_;
    }

    // repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;
    public static final int PREVIOUSPROVENANCES_FIELD_NUMBER = 2;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo> previousProvenances_;
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo> getPreviousProvenancesList() {
      return previousProvenances_;
    }
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder> 
        getPreviousProvenancesOrBuilderList() {
      return previousProvenances_;
    }
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    public int getPreviousProvenancesCount() {
      return previousProvenances_.size();
    }
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo getPreviousProvenances(int index) {
      return previousProvenances_.get(index);
    }
    /**
     * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder getPreviousProvenancesOrBuilder(
        int index) {
      return previousProvenances_.get(index);
    }

    private void initFields() {
      currentProvenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance();
      previousProvenances_ = java.util.Collections.emptyList();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasCurrentProvenance()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!getCurrentProvenance().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      for (int i = 0; i < getPreviousProvenancesCount(); i++) {
        if (!getPreviousProvenances(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeMessage(1, currentProvenance_);
      }
      for (int i = 0; i < previousProvenances_.size(); i++) {
        output.writeMessage(2, previousProvenances_.get(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, currentProvenance_);
      }
      for (int i = 0; i < previousProvenances_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, previousProvenances_.get(i));
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code ProvenanceInfo}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.class, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getCurrentProvenanceFieldBuilder();
          getPreviousProvenancesFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        if (currentProvenanceBuilder_ == null) {
          currentProvenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance();
        } else {
          currentProvenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000001);
        if (previousProvenancesBuilder_ == null) {
          previousProvenances_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          previousProvenancesBuilder_.clear();
        }
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ProvenanceInfo_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo build() {
        pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo result = new pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        if (currentProvenanceBuilder_ == null) {
          result.currentProvenance_ = currentProvenance_;
        } else {
          result.currentProvenance_ = currentProvenanceBuilder_.build();
        }
        if (previousProvenancesBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002)) {
            previousProvenances_ = java.util.Collections.unmodifiableList(previousProvenances_);
            bitField0_ = (bitField0_ & ~0x00000002);
          }
          result.previousProvenances_ = previousProvenances_;
        } else {
          result.previousProvenances_ = previousProvenancesBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance()) return this;
        if (other.hasCurrentProvenance()) {
          mergeCurrentProvenance(other.getCurrentProvenance());
        }
        if (previousProvenancesBuilder_ == null) {
          if (!other.previousProvenances_.isEmpty()) {
            if (previousProvenances_.isEmpty()) {
              previousProvenances_ = other.previousProvenances_;
              bitField0_ = (bitField0_ & ~0x00000002);
            } else {
              ensurePreviousProvenancesIsMutable();
              previousProvenances_.addAll(other.previousProvenances_);
            }
            onChanged();
          }
        } else {
          if (!other.previousProvenances_.isEmpty()) {
            if (previousProvenancesBuilder_.isEmpty()) {
              previousProvenancesBuilder_.dispose();
              previousProvenancesBuilder_ = null;
              previousProvenances_ = other.previousProvenances_;
              bitField0_ = (bitField0_ & ~0x00000002);
              previousProvenancesBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getPreviousProvenancesFieldBuilder() : null;
            } else {
              previousProvenancesBuilder_.addAllMessages(other.previousProvenances_);
            }
          }
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasCurrentProvenance()) {
          
          return false;
        }
        if (!getCurrentProvenance().isInitialized()) {
          
          return false;
        }
        for (int i = 0; i < getPreviousProvenancesCount(); i++) {
          if (!getPreviousProvenances(i).isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;
      private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo currentProvenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder> currentProvenanceBuilder_;
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public boolean hasCurrentProvenance() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo getCurrentProvenance() {
        if (currentProvenanceBuilder_ == null) {
          return currentProvenance_;
        } else {
          return currentProvenanceBuilder_.getMessage();
        }
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public Builder setCurrentProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo value) {
        if (currentProvenanceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          currentProvenance_ = value;
          onChanged();
        } else {
          currentProvenanceBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public Builder setCurrentProvenance(
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder builderForValue) {
        if (currentProvenanceBuilder_ == null) {
          currentProvenance_ = builderForValue.build();
          onChanged();
        } else {
          currentProvenanceBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public Builder mergeCurrentProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo value) {
        if (currentProvenanceBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001) &&
              currentProvenance_ != pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance()) {
            currentProvenance_ =
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.newBuilder(currentProvenance_).mergeFrom(value).buildPartial();
          } else {
            currentProvenance_ = value;
          }
          onChanged();
        } else {
          currentProvenanceBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public Builder clearCurrentProvenance() {
        if (currentProvenanceBuilder_ == null) {
          currentProvenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance();
          onChanged();
        } else {
          currentProvenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000001);
        return this;
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder getCurrentProvenanceBuilder() {
        bitField0_ |= 0x00000001;
        onChanged();
        return getCurrentProvenanceFieldBuilder().getBuilder();
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder getCurrentProvenanceOrBuilder() {
        if (currentProvenanceBuilder_ != null) {
          return currentProvenanceBuilder_.getMessageOrBuilder();
        } else {
          return currentProvenance_;
        }
      }
      /**
       * <code>required .ProvenanceInfo.SingleProvenanceInfo currentProvenance = 1;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder> 
          getCurrentProvenanceFieldBuilder() {
        if (currentProvenanceBuilder_ == null) {
          currentProvenanceBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder>(
                  currentProvenance_,
                  getParentForChildren(),
                  isClean());
          currentProvenance_ = null;
        }
        return currentProvenanceBuilder_;
      }

      // repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo> previousProvenances_ =
        java.util.Collections.emptyList();
      private void ensurePreviousProvenancesIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          previousProvenances_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo>(previousProvenances_);
          bitField0_ |= 0x00000002;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder> previousProvenancesBuilder_;

      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo> getPreviousProvenancesList() {
        if (previousProvenancesBuilder_ == null) {
          return java.util.Collections.unmodifiableList(previousProvenances_);
        } else {
          return previousProvenancesBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public int getPreviousProvenancesCount() {
        if (previousProvenancesBuilder_ == null) {
          return previousProvenances_.size();
        } else {
          return previousProvenancesBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo getPreviousProvenances(int index) {
        if (previousProvenancesBuilder_ == null) {
          return previousProvenances_.get(index);
        } else {
          return previousProvenancesBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder setPreviousProvenances(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo value) {
        if (previousProvenancesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensurePreviousProvenancesIsMutable();
          previousProvenances_.set(index, value);
          onChanged();
        } else {
          previousProvenancesBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder setPreviousProvenances(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder builderForValue) {
        if (previousProvenancesBuilder_ == null) {
          ensurePreviousProvenancesIsMutable();
          previousProvenances_.set(index, builderForValue.build());
          onChanged();
        } else {
          previousProvenancesBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder addPreviousProvenances(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo value) {
        if (previousProvenancesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensurePreviousProvenancesIsMutable();
          previousProvenances_.add(value);
          onChanged();
        } else {
          previousProvenancesBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder addPreviousProvenances(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo value) {
        if (previousProvenancesBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensurePreviousProvenancesIsMutable();
          previousProvenances_.add(index, value);
          onChanged();
        } else {
          previousProvenancesBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder addPreviousProvenances(
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder builderForValue) {
        if (previousProvenancesBuilder_ == null) {
          ensurePreviousProvenancesIsMutable();
          previousProvenances_.add(builderForValue.build());
          onChanged();
        } else {
          previousProvenancesBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder addPreviousProvenances(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder builderForValue) {
        if (previousProvenancesBuilder_ == null) {
          ensurePreviousProvenancesIsMutable();
          previousProvenances_.add(index, builderForValue.build());
          onChanged();
        } else {
          previousProvenancesBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder addAllPreviousProvenances(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo> values) {
        if (previousProvenancesBuilder_ == null) {
          ensurePreviousProvenancesIsMutable();
          super.addAll(values, previousProvenances_);
          onChanged();
        } else {
          previousProvenancesBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder clearPreviousProvenances() {
        if (previousProvenancesBuilder_ == null) {
          previousProvenances_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
          onChanged();
        } else {
          previousProvenancesBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public Builder removePreviousProvenances(int index) {
        if (previousProvenancesBuilder_ == null) {
          ensurePreviousProvenancesIsMutable();
          previousProvenances_.remove(index);
          onChanged();
        } else {
          previousProvenancesBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder getPreviousProvenancesBuilder(
          int index) {
        return getPreviousProvenancesFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder getPreviousProvenancesOrBuilder(
          int index) {
        if (previousProvenancesBuilder_ == null) {
          return previousProvenances_.get(index);  } else {
          return previousProvenancesBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder> 
           getPreviousProvenancesOrBuilderList() {
        if (previousProvenancesBuilder_ != null) {
          return previousProvenancesBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(previousProvenances_);
        }
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder addPreviousProvenancesBuilder() {
        return getPreviousProvenancesFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance());
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder addPreviousProvenancesBuilder(
          int index) {
        return getPreviousProvenancesFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.getDefaultInstance());
      }
      /**
       * <code>repeated .ProvenanceInfo.SingleProvenanceInfo previousProvenances = 2;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder> 
           getPreviousProvenancesBuilderList() {
        return getPreviousProvenancesFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder> 
          getPreviousProvenancesFieldBuilder() {
        if (previousProvenancesBuilder_ == null) {
          previousProvenancesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.SingleProvenanceInfoOrBuilder>(
                  previousProvenances_,
                  ((bitField0_ & 0x00000002) == 0x00000002),
                  getParentForChildren(),
                  isClean());
          previousProvenances_ = null;
        }
        return previousProvenancesBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:ProvenanceInfo)
    }

    static {
      defaultInstance = new ProvenanceInfo(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:ProvenanceInfo)
  }

  public interface KeyValueOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string key = 1;
    /**
     * <code>required string key = 1;</code>
     */
    boolean hasKey();
    /**
     * <code>required string key = 1;</code>
     */
    java.lang.String getKey();
    /**
     * <code>required string key = 1;</code>
     */
    com.google.protobuf.ByteString
        getKeyBytes();

    // required string value = 2;
    /**
     * <code>required string value = 2;</code>
     */
    boolean hasValue();
    /**
     * <code>required string value = 2;</code>
     */
    java.lang.String getValue();
    /**
     * <code>required string value = 2;</code>
     */
    com.google.protobuf.ByteString
        getValueBytes();

    // optional string comment = 3;
    /**
     * <code>optional string comment = 3;</code>
     */
    boolean hasComment();
    /**
     * <code>optional string comment = 3;</code>
     */
    java.lang.String getComment();
    /**
     * <code>optional string comment = 3;</code>
     */
    com.google.protobuf.ByteString
        getCommentBytes();

    // optional .ProvenanceInfo provenance = 4;
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    boolean hasProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder();
  }
  /**
   * Protobuf type {@code KeyValue}
   */
  public static final class KeyValue extends
      com.google.protobuf.GeneratedMessage
      implements KeyValueOrBuilder {
    // Use KeyValue.newBuilder() to construct.
    private KeyValue(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private KeyValue(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final KeyValue defaultInstance;
    public static KeyValue getDefaultInstance() {
      return defaultInstance;
    }

    public KeyValue getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private KeyValue(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              key_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              value_ = input.readBytes();
              break;
            }
            case 26: {
              bitField0_ |= 0x00000004;
              comment_ = input.readBytes();
              break;
            }
            case 34: {
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder subBuilder = null;
              if (((bitField0_ & 0x00000008) == 0x00000008)) {
                subBuilder = provenance_.toBuilder();
              }
              provenance_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(provenance_);
                provenance_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000008;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeyValue_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeyValue_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.KeyValue.class, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder.class);
    }

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

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

    private int bitField0_;
    // required string key = 1;
    public static final int KEY_FIELD_NUMBER = 1;
    private java.lang.Object key_;
    /**
     * <code>required string key = 1;</code>
     */
    public boolean hasKey() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string key = 1;</code>
     */
    public java.lang.String getKey() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          key_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string key = 1;</code>
     */
    public com.google.protobuf.ByteString
        getKeyBytes() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        key_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required string value = 2;
    public static final int VALUE_FIELD_NUMBER = 2;
    private java.lang.Object value_;
    /**
     * <code>required string value = 2;</code>
     */
    public boolean hasValue() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required string value = 2;</code>
     */
    public java.lang.String getValue() {
      java.lang.Object ref = value_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          value_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string value = 2;</code>
     */
    public com.google.protobuf.ByteString
        getValueBytes() {
      java.lang.Object ref = value_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        value_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string comment = 3;
    public static final int COMMENT_FIELD_NUMBER = 3;
    private java.lang.Object comment_;
    /**
     * <code>optional string comment = 3;</code>
     */
    public boolean hasComment() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional string comment = 3;</code>
     */
    public java.lang.String getComment() {
      java.lang.Object ref = comment_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          comment_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string comment = 3;</code>
     */
    public com.google.protobuf.ByteString
        getCommentBytes() {
      java.lang.Object ref = comment_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        comment_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional .ProvenanceInfo provenance = 4;
    public static final int PROVENANCE_FIELD_NUMBER = 4;
    private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_;
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    public boolean hasProvenance() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
      return provenance_;
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
      return provenance_;
    }

    private void initFields() {
      key_ = "";
      value_ = "";
      comment_ = "";
      provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasKey()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasValue()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (hasProvenance()) {
        if (!getProvenance().isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getValueBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, getCommentBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeMessage(4, provenance_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getValueBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, getCommentBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, provenance_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeyValue parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.KeyValue prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code KeyValue}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeyValue_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeyValue_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.KeyValue.class, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.KeyValue.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getProvenanceFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        key_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        value_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        comment_ = "";
        bitField0_ = (bitField0_ & ~0x00000004);
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeyValue_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue build() {
        pl.edu.icm.coansys.models.DocumentProtos.KeyValue result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.KeyValue result = new pl.edu.icm.coansys.models.DocumentProtos.KeyValue(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.key_ = key_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.value_ = value_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.comment_ = comment_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        if (provenanceBuilder_ == null) {
          result.provenance_ = provenance_;
        } else {
          result.provenance_ = provenanceBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.KeyValue) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.KeyValue)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.KeyValue other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance()) return this;
        if (other.hasKey()) {
          bitField0_ |= 0x00000001;
          key_ = other.key_;
          onChanged();
        }
        if (other.hasValue()) {
          bitField0_ |= 0x00000002;
          value_ = other.value_;
          onChanged();
        }
        if (other.hasComment()) {
          bitField0_ |= 0x00000004;
          comment_ = other.comment_;
          onChanged();
        }
        if (other.hasProvenance()) {
          mergeProvenance(other.getProvenance());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasKey()) {
          
          return false;
        }
        if (!hasValue()) {
          
          return false;
        }
        if (hasProvenance()) {
          if (!getProvenance().isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.KeyValue parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.KeyValue) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string key = 1;
      private java.lang.Object key_ = "";
      /**
       * <code>required string key = 1;</code>
       */
      public boolean hasKey() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string key = 1;</code>
       */
      public java.lang.String getKey() {
        java.lang.Object ref = key_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          key_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public com.google.protobuf.ByteString
          getKeyBytes() {
        java.lang.Object ref = key_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          key_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKey(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder clearKey() {
        bitField0_ = (bitField0_ & ~0x00000001);
        key_ = getDefaultInstance().getKey();
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKeyBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }

      // required string value = 2;
      private java.lang.Object value_ = "";
      /**
       * <code>required string value = 2;</code>
       */
      public boolean hasValue() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required string value = 2;</code>
       */
      public java.lang.String getValue() {
        java.lang.Object ref = value_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          value_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string value = 2;</code>
       */
      public com.google.protobuf.ByteString
          getValueBytes() {
        java.lang.Object ref = value_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          value_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string value = 2;</code>
       */
      public Builder setValue(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        value_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string value = 2;</code>
       */
      public Builder clearValue() {
        bitField0_ = (bitField0_ & ~0x00000002);
        value_ = getDefaultInstance().getValue();
        onChanged();
        return this;
      }
      /**
       * <code>required string value = 2;</code>
       */
      public Builder setValueBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        value_ = value;
        onChanged();
        return this;
      }

      // optional string comment = 3;
      private java.lang.Object comment_ = "";
      /**
       * <code>optional string comment = 3;</code>
       */
      public boolean hasComment() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public java.lang.String getComment() {
        java.lang.Object ref = comment_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          comment_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public com.google.protobuf.ByteString
          getCommentBytes() {
        java.lang.Object ref = comment_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          comment_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public Builder setComment(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        comment_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public Builder clearComment() {
        bitField0_ = (bitField0_ & ~0x00000004);
        comment_ = getDefaultInstance().getComment();
        onChanged();
        return this;
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public Builder setCommentBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        comment_ = value;
        onChanged();
        return this;
      }

      // optional .ProvenanceInfo provenance = 4;
      private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> provenanceBuilder_;
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public boolean hasProvenance() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
        if (provenanceBuilder_ == null) {
          return provenance_;
        } else {
          return provenanceBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder setProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          provenance_ = value;
          onChanged();
        } else {
          provenanceBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder setProvenance(
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder builderForValue) {
        if (provenanceBuilder_ == null) {
          provenance_ = builderForValue.build();
          onChanged();
        } else {
          provenanceBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder mergeProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (((bitField0_ & 0x00000008) == 0x00000008) &&
              provenance_ != pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance()) {
            provenance_ =
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.newBuilder(provenance_).mergeFrom(value).buildPartial();
          } else {
            provenance_ = value;
          }
          onChanged();
        } else {
          provenanceBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder clearProvenance() {
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
          onChanged();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder getProvenanceBuilder() {
        bitField0_ |= 0x00000008;
        onChanged();
        return getProvenanceFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
        if (provenanceBuilder_ != null) {
          return provenanceBuilder_.getMessageOrBuilder();
        } else {
          return provenance_;
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> 
          getProvenanceFieldBuilder() {
        if (provenanceBuilder_ == null) {
          provenanceBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder>(
                  provenance_,
                  getParentForChildren(),
                  isClean());
          provenance_ = null;
        }
        return provenanceBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:KeyValue)
    }

    static {
      defaultInstance = new KeyValue(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:KeyValue)
  }

  public interface TextWithLanguageOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string text = 1;
    /**
     * <code>required string text = 1;</code>
     */
    boolean hasText();
    /**
     * <code>required string text = 1;</code>
     */
    java.lang.String getText();
    /**
     * <code>required string text = 1;</code>
     */
    com.google.protobuf.ByteString
        getTextBytes();

    // optional string language = 2;
    /**
     * <code>optional string language = 2;</code>
     */
    boolean hasLanguage();
    /**
     * <code>optional string language = 2;</code>
     */
    java.lang.String getLanguage();
    /**
     * <code>optional string language = 2;</code>
     */
    com.google.protobuf.ByteString
        getLanguageBytes();

    // optional string comment = 3;
    /**
     * <code>optional string comment = 3;</code>
     */
    boolean hasComment();
    /**
     * <code>optional string comment = 3;</code>
     */
    java.lang.String getComment();
    /**
     * <code>optional string comment = 3;</code>
     */
    com.google.protobuf.ByteString
        getCommentBytes();
  }
  /**
   * Protobuf type {@code TextWithLanguage}
   */
  public static final class TextWithLanguage extends
      com.google.protobuf.GeneratedMessage
      implements TextWithLanguageOrBuilder {
    // Use TextWithLanguage.newBuilder() to construct.
    private TextWithLanguage(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private TextWithLanguage(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final TextWithLanguage defaultInstance;
    public static TextWithLanguage getDefaultInstance() {
      return defaultInstance;
    }

    public TextWithLanguage getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private TextWithLanguage(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              text_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              language_ = input.readBytes();
              break;
            }
            case 26: {
              bitField0_ |= 0x00000004;
              comment_ = input.readBytes();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_TextWithLanguage_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_TextWithLanguage_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.class, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder.class);
    }

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

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

    private int bitField0_;
    // required string text = 1;
    public static final int TEXT_FIELD_NUMBER = 1;
    private java.lang.Object text_;
    /**
     * <code>required string text = 1;</code>
     */
    public boolean hasText() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string text = 1;</code>
     */
    public java.lang.String getText() {
      java.lang.Object ref = text_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          text_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string text = 1;</code>
     */
    public com.google.protobuf.ByteString
        getTextBytes() {
      java.lang.Object ref = text_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        text_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string language = 2;
    public static final int LANGUAGE_FIELD_NUMBER = 2;
    private java.lang.Object language_;
    /**
     * <code>optional string language = 2;</code>
     */
    public boolean hasLanguage() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional string language = 2;</code>
     */
    public java.lang.String getLanguage() {
      java.lang.Object ref = language_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          language_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string language = 2;</code>
     */
    public com.google.protobuf.ByteString
        getLanguageBytes() {
      java.lang.Object ref = language_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        language_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string comment = 3;
    public static final int COMMENT_FIELD_NUMBER = 3;
    private java.lang.Object comment_;
    /**
     * <code>optional string comment = 3;</code>
     */
    public boolean hasComment() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional string comment = 3;</code>
     */
    public java.lang.String getComment() {
      java.lang.Object ref = comment_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          comment_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string comment = 3;</code>
     */
    public com.google.protobuf.ByteString
        getCommentBytes() {
      java.lang.Object ref = comment_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        comment_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private void initFields() {
      text_ = "";
      language_ = "";
      comment_ = "";
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasText()) {
        memoizedIsInitialized = 0;
        return false;
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getTextBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getLanguageBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, getCommentBytes());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getTextBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getLanguageBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, getCommentBytes());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code TextWithLanguage}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_TextWithLanguage_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_TextWithLanguage_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.class, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        text_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        language_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        comment_ = "";
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_TextWithLanguage_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage build() {
        pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage result = new pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.text_ = text_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.language_ = language_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.comment_ = comment_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.getDefaultInstance()) return this;
        if (other.hasText()) {
          bitField0_ |= 0x00000001;
          text_ = other.text_;
          onChanged();
        }
        if (other.hasLanguage()) {
          bitField0_ |= 0x00000002;
          language_ = other.language_;
          onChanged();
        }
        if (other.hasComment()) {
          bitField0_ |= 0x00000004;
          comment_ = other.comment_;
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasText()) {
          
          return false;
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string text = 1;
      private java.lang.Object text_ = "";
      /**
       * <code>required string text = 1;</code>
       */
      public boolean hasText() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string text = 1;</code>
       */
      public java.lang.String getText() {
        java.lang.Object ref = text_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          text_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string text = 1;</code>
       */
      public com.google.protobuf.ByteString
          getTextBytes() {
        java.lang.Object ref = text_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          text_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string text = 1;</code>
       */
      public Builder setText(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        text_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string text = 1;</code>
       */
      public Builder clearText() {
        bitField0_ = (bitField0_ & ~0x00000001);
        text_ = getDefaultInstance().getText();
        onChanged();
        return this;
      }
      /**
       * <code>required string text = 1;</code>
       */
      public Builder setTextBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        text_ = value;
        onChanged();
        return this;
      }

      // optional string language = 2;
      private java.lang.Object language_ = "";
      /**
       * <code>optional string language = 2;</code>
       */
      public boolean hasLanguage() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public java.lang.String getLanguage() {
        java.lang.Object ref = language_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          language_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public com.google.protobuf.ByteString
          getLanguageBytes() {
        java.lang.Object ref = language_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          language_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public Builder setLanguage(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        language_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public Builder clearLanguage() {
        bitField0_ = (bitField0_ & ~0x00000002);
        language_ = getDefaultInstance().getLanguage();
        onChanged();
        return this;
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public Builder setLanguageBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        language_ = value;
        onChanged();
        return this;
      }

      // optional string comment = 3;
      private java.lang.Object comment_ = "";
      /**
       * <code>optional string comment = 3;</code>
       */
      public boolean hasComment() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public java.lang.String getComment() {
        java.lang.Object ref = comment_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          comment_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public com.google.protobuf.ByteString
          getCommentBytes() {
        java.lang.Object ref = comment_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          comment_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public Builder setComment(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        comment_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public Builder clearComment() {
        bitField0_ = (bitField0_ & ~0x00000004);
        comment_ = getDefaultInstance().getComment();
        onChanged();
        return this;
      }
      /**
       * <code>optional string comment = 3;</code>
       */
      public Builder setCommentBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        comment_ = value;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:TextWithLanguage)
    }

    static {
      defaultInstance = new TextWithLanguage(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:TextWithLanguage)
  }

  public interface ClassifCodeOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string source = 1;
    /**
     * <code>required string source = 1;</code>
     */
    boolean hasSource();
    /**
     * <code>required string source = 1;</code>
     */
    java.lang.String getSource();
    /**
     * <code>required string source = 1;</code>
     */
    com.google.protobuf.ByteString
        getSourceBytes();

    // repeated string value = 2;
    /**
     * <code>repeated string value = 2;</code>
     */
    java.util.List<java.lang.String>
    getValueList();
    /**
     * <code>repeated string value = 2;</code>
     */
    int getValueCount();
    /**
     * <code>repeated string value = 2;</code>
     */
    java.lang.String getValue(int index);
    /**
     * <code>repeated string value = 2;</code>
     */
    com.google.protobuf.ByteString
        getValueBytes(int index);

    // optional .ProvenanceInfo provenance = 3;
    /**
     * <code>optional .ProvenanceInfo provenance = 3;</code>
     */
    boolean hasProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 3;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 3;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder();
  }
  /**
   * Protobuf type {@code ClassifCode}
   */
  public static final class ClassifCode extends
      com.google.protobuf.GeneratedMessage
      implements ClassifCodeOrBuilder {
    // Use ClassifCode.newBuilder() to construct.
    private ClassifCode(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private ClassifCode(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final ClassifCode defaultInstance;
    public static ClassifCode getDefaultInstance() {
      return defaultInstance;
    }

    public ClassifCode getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private ClassifCode(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              source_ = input.readBytes();
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                value_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000002;
              }
              value_.add(input.readBytes());
              break;
            }
            case 26: {
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder subBuilder = null;
              if (((bitField0_ & 0x00000002) == 0x00000002)) {
                subBuilder = provenance_.toBuilder();
              }
              provenance_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(provenance_);
                provenance_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000002;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
          value_ = new com.google.protobuf.UnmodifiableLazyStringList(value_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ClassifCode_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ClassifCode_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.class, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder.class);
    }

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

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

    private int bitField0_;
    // required string source = 1;
    public static final int SOURCE_FIELD_NUMBER = 1;
    private java.lang.Object source_;
    /**
     * <code>required string source = 1;</code>
     */
    public boolean hasSource() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string source = 1;</code>
     */
    public java.lang.String getSource() {
      java.lang.Object ref = source_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          source_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string source = 1;</code>
     */
    public com.google.protobuf.ByteString
        getSourceBytes() {
      java.lang.Object ref = source_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        source_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // repeated string value = 2;
    public static final int VALUE_FIELD_NUMBER = 2;
    private com.google.protobuf.LazyStringList value_;
    /**
     * <code>repeated string value = 2;</code>
     */
    public java.util.List<java.lang.String>
        getValueList() {
      return value_;
    }
    /**
     * <code>repeated string value = 2;</code>
     */
    public int getValueCount() {
      return value_.size();
    }
    /**
     * <code>repeated string value = 2;</code>
     */
    public java.lang.String getValue(int index) {
      return value_.get(index);
    }
    /**
     * <code>repeated string value = 2;</code>
     */
    public com.google.protobuf.ByteString
        getValueBytes(int index) {
      return value_.getByteString(index);
    }

    // optional .ProvenanceInfo provenance = 3;
    public static final int PROVENANCE_FIELD_NUMBER = 3;
    private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_;
    /**
     * <code>optional .ProvenanceInfo provenance = 3;</code>
     */
    public boolean hasProvenance() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 3;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
      return provenance_;
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 3;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
      return provenance_;
    }

    private void initFields() {
      source_ = "";
      value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasSource()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (hasProvenance()) {
        if (!getProvenance().isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getSourceBytes());
      }
      for (int i = 0; i < value_.size(); i++) {
        output.writeBytes(2, value_.getByteString(i));
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeMessage(3, provenance_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getSourceBytes());
      }
      {
        int dataSize = 0;
        for (int i = 0; i < value_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(value_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getValueList().size();
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, provenance_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.ClassifCode prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code ClassifCode}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ClassifCode_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ClassifCode_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.class, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getProvenanceFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        source_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000002);
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ClassifCode_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode build() {
        pl.edu.icm.coansys.models.DocumentProtos.ClassifCode result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.ClassifCode result = new pl.edu.icm.coansys.models.DocumentProtos.ClassifCode(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.source_ = source_;
        if (((bitField0_ & 0x00000002) == 0x00000002)) {
          value_ = new com.google.protobuf.UnmodifiableLazyStringList(
              value_);
          bitField0_ = (bitField0_ & ~0x00000002);
        }
        result.value_ = value_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000002;
        }
        if (provenanceBuilder_ == null) {
          result.provenance_ = provenance_;
        } else {
          result.provenance_ = provenanceBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.ClassifCode) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.ClassifCode)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.ClassifCode other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.getDefaultInstance()) return this;
        if (other.hasSource()) {
          bitField0_ |= 0x00000001;
          source_ = other.source_;
          onChanged();
        }
        if (!other.value_.isEmpty()) {
          if (value_.isEmpty()) {
            value_ = other.value_;
            bitField0_ = (bitField0_ & ~0x00000002);
          } else {
            ensureValueIsMutable();
            value_.addAll(other.value_);
          }
          onChanged();
        }
        if (other.hasProvenance()) {
          mergeProvenance(other.getProvenance());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasSource()) {
          
          return false;
        }
        if (hasProvenance()) {
          if (!getProvenance().isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.ClassifCode parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.ClassifCode) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string source = 1;
      private java.lang.Object source_ = "";
      /**
       * <code>required string source = 1;</code>
       */
      public boolean hasSource() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string source = 1;</code>
       */
      public java.lang.String getSource() {
        java.lang.Object ref = source_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          source_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string source = 1;</code>
       */
      public com.google.protobuf.ByteString
          getSourceBytes() {
        java.lang.Object ref = source_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          source_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string source = 1;</code>
       */
      public Builder setSource(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        source_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string source = 1;</code>
       */
      public Builder clearSource() {
        bitField0_ = (bitField0_ & ~0x00000001);
        source_ = getDefaultInstance().getSource();
        onChanged();
        return this;
      }
      /**
       * <code>required string source = 1;</code>
       */
      public Builder setSourceBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        source_ = value;
        onChanged();
        return this;
      }

      // repeated string value = 2;
      private com.google.protobuf.LazyStringList value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureValueIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          value_ = new com.google.protobuf.LazyStringArrayList(value_);
          bitField0_ |= 0x00000002;
         }
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public java.util.List<java.lang.String>
          getValueList() {
        return java.util.Collections.unmodifiableList(value_);
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public int getValueCount() {
        return value_.size();
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public java.lang.String getValue(int index) {
        return value_.get(index);
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public com.google.protobuf.ByteString
          getValueBytes(int index) {
        return value_.getByteString(index);
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public Builder setValue(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureValueIsMutable();
        value_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public Builder addValue(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureValueIsMutable();
        value_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public Builder addAllValue(
          java.lang.Iterable<java.lang.String> values) {
        ensureValueIsMutable();
        super.addAll(values, value_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public Builder clearValue() {
        value_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000002);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string value = 2;</code>
       */
      public Builder addValueBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureValueIsMutable();
        value_.add(value);
        onChanged();
        return this;
      }

      // optional .ProvenanceInfo provenance = 3;
      private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> provenanceBuilder_;
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public boolean hasProvenance() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
        if (provenanceBuilder_ == null) {
          return provenance_;
        } else {
          return provenanceBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public Builder setProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          provenance_ = value;
          onChanged();
        } else {
          provenanceBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public Builder setProvenance(
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder builderForValue) {
        if (provenanceBuilder_ == null) {
          provenance_ = builderForValue.build();
          onChanged();
        } else {
          provenanceBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public Builder mergeProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (((bitField0_ & 0x00000004) == 0x00000004) &&
              provenance_ != pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance()) {
            provenance_ =
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.newBuilder(provenance_).mergeFrom(value).buildPartial();
          } else {
            provenance_ = value;
          }
          onChanged();
        } else {
          provenanceBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public Builder clearProvenance() {
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
          onChanged();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder getProvenanceBuilder() {
        bitField0_ |= 0x00000004;
        onChanged();
        return getProvenanceFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
        if (provenanceBuilder_ != null) {
          return provenanceBuilder_.getMessageOrBuilder();
        } else {
          return provenance_;
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 3;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> 
          getProvenanceFieldBuilder() {
        if (provenanceBuilder_ == null) {
          provenanceBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder>(
                  provenance_,
                  getParentForChildren(),
                  isClean());
          provenance_ = null;
        }
        return provenanceBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:ClassifCode)
    }

    static {
      defaultInstance = new ClassifCode(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:ClassifCode)
  }

  public interface AffiliationOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string key = 1;
    /**
     * <code>required string key = 1;</code>
     */
    boolean hasKey();
    /**
     * <code>required string key = 1;</code>
     */
    java.lang.String getKey();
    /**
     * <code>required string key = 1;</code>
     */
    com.google.protobuf.ByteString
        getKeyBytes();

    // required string affiliationId = 2;
    /**
     * <code>required string affiliationId = 2;</code>
     */
    boolean hasAffiliationId();
    /**
     * <code>required string affiliationId = 2;</code>
     */
    java.lang.String getAffiliationId();
    /**
     * <code>required string affiliationId = 2;</code>
     */
    com.google.protobuf.ByteString
        getAffiliationIdBytes();

    // required string text = 3;
    /**
     * <code>required string text = 3;</code>
     */
    boolean hasText();
    /**
     * <code>required string text = 3;</code>
     */
    java.lang.String getText();
    /**
     * <code>required string text = 3;</code>
     */
    com.google.protobuf.ByteString
        getTextBytes();

    // optional .ProvenanceInfo provenance = 4;
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    boolean hasProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder();

    // optional string organizationCurrentId = 5;
    /**
     * <code>optional string organizationCurrentId = 5;</code>
     */
    boolean hasOrganizationCurrentId();
    /**
     * <code>optional string organizationCurrentId = 5;</code>
     */
    java.lang.String getOrganizationCurrentId();
    /**
     * <code>optional string organizationCurrentId = 5;</code>
     */
    com.google.protobuf.ByteString
        getOrganizationCurrentIdBytes();
  }
  /**
   * Protobuf type {@code Affiliation}
   */
  public static final class Affiliation extends
      com.google.protobuf.GeneratedMessage
      implements AffiliationOrBuilder {
    // Use Affiliation.newBuilder() to construct.
    private Affiliation(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Affiliation(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Affiliation defaultInstance;
    public static Affiliation getDefaultInstance() {
      return defaultInstance;
    }

    public Affiliation getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Affiliation(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              key_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              affiliationId_ = input.readBytes();
              break;
            }
            case 26: {
              bitField0_ |= 0x00000004;
              text_ = input.readBytes();
              break;
            }
            case 34: {
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder subBuilder = null;
              if (((bitField0_ & 0x00000008) == 0x00000008)) {
                subBuilder = provenance_.toBuilder();
              }
              provenance_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(provenance_);
                provenance_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000008;
              break;
            }
            case 42: {
              bitField0_ |= 0x00000010;
              organizationCurrentId_ = input.readBytes();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Affiliation_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Affiliation_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.Affiliation.class, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder.class);
    }

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

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

    private int bitField0_;
    // required string key = 1;
    public static final int KEY_FIELD_NUMBER = 1;
    private java.lang.Object key_;
    /**
     * <code>required string key = 1;</code>
     */
    public boolean hasKey() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string key = 1;</code>
     */
    public java.lang.String getKey() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          key_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string key = 1;</code>
     */
    public com.google.protobuf.ByteString
        getKeyBytes() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        key_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required string affiliationId = 2;
    public static final int AFFILIATIONID_FIELD_NUMBER = 2;
    private java.lang.Object affiliationId_;
    /**
     * <code>required string affiliationId = 2;</code>
     */
    public boolean hasAffiliationId() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required string affiliationId = 2;</code>
     */
    public java.lang.String getAffiliationId() {
      java.lang.Object ref = affiliationId_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          affiliationId_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string affiliationId = 2;</code>
     */
    public com.google.protobuf.ByteString
        getAffiliationIdBytes() {
      java.lang.Object ref = affiliationId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        affiliationId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required string text = 3;
    public static final int TEXT_FIELD_NUMBER = 3;
    private java.lang.Object text_;
    /**
     * <code>required string text = 3;</code>
     */
    public boolean hasText() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>required string text = 3;</code>
     */
    public java.lang.String getText() {
      java.lang.Object ref = text_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          text_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string text = 3;</code>
     */
    public com.google.protobuf.ByteString
        getTextBytes() {
      java.lang.Object ref = text_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        text_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional .ProvenanceInfo provenance = 4;
    public static final int PROVENANCE_FIELD_NUMBER = 4;
    private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_;
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    public boolean hasProvenance() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
      return provenance_;
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 4;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
      return provenance_;
    }

    // optional string organizationCurrentId = 5;
    public static final int ORGANIZATIONCURRENTID_FIELD_NUMBER = 5;
    private java.lang.Object organizationCurrentId_;
    /**
     * <code>optional string organizationCurrentId = 5;</code>
     */
    public boolean hasOrganizationCurrentId() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional string organizationCurrentId = 5;</code>
     */
    public java.lang.String getOrganizationCurrentId() {
      java.lang.Object ref = organizationCurrentId_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          organizationCurrentId_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string organizationCurrentId = 5;</code>
     */
    public com.google.protobuf.ByteString
        getOrganizationCurrentIdBytes() {
      java.lang.Object ref = organizationCurrentId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        organizationCurrentId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private void initFields() {
      key_ = "";
      affiliationId_ = "";
      text_ = "";
      provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
      organizationCurrentId_ = "";
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasKey()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasAffiliationId()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasText()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (hasProvenance()) {
        if (!getProvenance().isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getAffiliationIdBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, getTextBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeMessage(4, provenance_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeBytes(5, getOrganizationCurrentIdBytes());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getAffiliationIdBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, getTextBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(4, provenance_);
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(5, getOrganizationCurrentIdBytes());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Affiliation parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.Affiliation prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code Affiliation}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Affiliation_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Affiliation_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.Affiliation.class, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.Affiliation.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getProvenanceFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        key_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        affiliationId_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        text_ = "";
        bitField0_ = (bitField0_ & ~0x00000004);
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        organizationCurrentId_ = "";
        bitField0_ = (bitField0_ & ~0x00000010);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Affiliation_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Affiliation getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.Affiliation.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Affiliation build() {
        pl.edu.icm.coansys.models.DocumentProtos.Affiliation result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Affiliation buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.Affiliation result = new pl.edu.icm.coansys.models.DocumentProtos.Affiliation(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.key_ = key_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.affiliationId_ = affiliationId_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.text_ = text_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        if (provenanceBuilder_ == null) {
          result.provenance_ = provenance_;
        } else {
          result.provenance_ = provenanceBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        result.organizationCurrentId_ = organizationCurrentId_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.Affiliation) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.Affiliation)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.Affiliation other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.Affiliation.getDefaultInstance()) return this;
        if (other.hasKey()) {
          bitField0_ |= 0x00000001;
          key_ = other.key_;
          onChanged();
        }
        if (other.hasAffiliationId()) {
          bitField0_ |= 0x00000002;
          affiliationId_ = other.affiliationId_;
          onChanged();
        }
        if (other.hasText()) {
          bitField0_ |= 0x00000004;
          text_ = other.text_;
          onChanged();
        }
        if (other.hasProvenance()) {
          mergeProvenance(other.getProvenance());
        }
        if (other.hasOrganizationCurrentId()) {
          bitField0_ |= 0x00000010;
          organizationCurrentId_ = other.organizationCurrentId_;
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasKey()) {
          
          return false;
        }
        if (!hasAffiliationId()) {
          
          return false;
        }
        if (!hasText()) {
          
          return false;
        }
        if (hasProvenance()) {
          if (!getProvenance().isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.Affiliation parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.Affiliation) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string key = 1;
      private java.lang.Object key_ = "";
      /**
       * <code>required string key = 1;</code>
       */
      public boolean hasKey() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string key = 1;</code>
       */
      public java.lang.String getKey() {
        java.lang.Object ref = key_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          key_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public com.google.protobuf.ByteString
          getKeyBytes() {
        java.lang.Object ref = key_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          key_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKey(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder clearKey() {
        bitField0_ = (bitField0_ & ~0x00000001);
        key_ = getDefaultInstance().getKey();
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKeyBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }

      // required string affiliationId = 2;
      private java.lang.Object affiliationId_ = "";
      /**
       * <code>required string affiliationId = 2;</code>
       */
      public boolean hasAffiliationId() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required string affiliationId = 2;</code>
       */
      public java.lang.String getAffiliationId() {
        java.lang.Object ref = affiliationId_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          affiliationId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string affiliationId = 2;</code>
       */
      public com.google.protobuf.ByteString
          getAffiliationIdBytes() {
        java.lang.Object ref = affiliationId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          affiliationId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string affiliationId = 2;</code>
       */
      public Builder setAffiliationId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        affiliationId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string affiliationId = 2;</code>
       */
      public Builder clearAffiliationId() {
        bitField0_ = (bitField0_ & ~0x00000002);
        affiliationId_ = getDefaultInstance().getAffiliationId();
        onChanged();
        return this;
      }
      /**
       * <code>required string affiliationId = 2;</code>
       */
      public Builder setAffiliationIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        affiliationId_ = value;
        onChanged();
        return this;
      }

      // required string text = 3;
      private java.lang.Object text_ = "";
      /**
       * <code>required string text = 3;</code>
       */
      public boolean hasText() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>required string text = 3;</code>
       */
      public java.lang.String getText() {
        java.lang.Object ref = text_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          text_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string text = 3;</code>
       */
      public com.google.protobuf.ByteString
          getTextBytes() {
        java.lang.Object ref = text_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          text_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string text = 3;</code>
       */
      public Builder setText(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        text_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string text = 3;</code>
       */
      public Builder clearText() {
        bitField0_ = (bitField0_ & ~0x00000004);
        text_ = getDefaultInstance().getText();
        onChanged();
        return this;
      }
      /**
       * <code>required string text = 3;</code>
       */
      public Builder setTextBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        text_ = value;
        onChanged();
        return this;
      }

      // optional .ProvenanceInfo provenance = 4;
      private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> provenanceBuilder_;
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public boolean hasProvenance() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
        if (provenanceBuilder_ == null) {
          return provenance_;
        } else {
          return provenanceBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder setProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          provenance_ = value;
          onChanged();
        } else {
          provenanceBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder setProvenance(
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder builderForValue) {
        if (provenanceBuilder_ == null) {
          provenance_ = builderForValue.build();
          onChanged();
        } else {
          provenanceBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder mergeProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (((bitField0_ & 0x00000008) == 0x00000008) &&
              provenance_ != pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance()) {
            provenance_ =
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.newBuilder(provenance_).mergeFrom(value).buildPartial();
          } else {
            provenance_ = value;
          }
          onChanged();
        } else {
          provenanceBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000008;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public Builder clearProvenance() {
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
          onChanged();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000008);
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder getProvenanceBuilder() {
        bitField0_ |= 0x00000008;
        onChanged();
        return getProvenanceFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
        if (provenanceBuilder_ != null) {
          return provenanceBuilder_.getMessageOrBuilder();
        } else {
          return provenance_;
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 4;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> 
          getProvenanceFieldBuilder() {
        if (provenanceBuilder_ == null) {
          provenanceBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder>(
                  provenance_,
                  getParentForChildren(),
                  isClean());
          provenance_ = null;
        }
        return provenanceBuilder_;
      }

      // optional string organizationCurrentId = 5;
      private java.lang.Object organizationCurrentId_ = "";
      /**
       * <code>optional string organizationCurrentId = 5;</code>
       */
      public boolean hasOrganizationCurrentId() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional string organizationCurrentId = 5;</code>
       */
      public java.lang.String getOrganizationCurrentId() {
        java.lang.Object ref = organizationCurrentId_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          organizationCurrentId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string organizationCurrentId = 5;</code>
       */
      public com.google.protobuf.ByteString
          getOrganizationCurrentIdBytes() {
        java.lang.Object ref = organizationCurrentId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          organizationCurrentId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string organizationCurrentId = 5;</code>
       */
      public Builder setOrganizationCurrentId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        organizationCurrentId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string organizationCurrentId = 5;</code>
       */
      public Builder clearOrganizationCurrentId() {
        bitField0_ = (bitField0_ & ~0x00000010);
        organizationCurrentId_ = getDefaultInstance().getOrganizationCurrentId();
        onChanged();
        return this;
      }
      /**
       * <code>optional string organizationCurrentId = 5;</code>
       */
      public Builder setOrganizationCurrentIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        organizationCurrentId_ = value;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:Affiliation)
    }

    static {
      defaultInstance = new Affiliation(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:Affiliation)
  }

  public interface AuthorOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string key = 1;
    /**
     * <code>required string key = 1;</code>
     */
    boolean hasKey();
    /**
     * <code>required string key = 1;</code>
     */
    java.lang.String getKey();
    /**
     * <code>required string key = 1;</code>
     */
    com.google.protobuf.ByteString
        getKeyBytes();

    // optional string forenames = 2;
    /**
     * <code>optional string forenames = 2;</code>
     */
    boolean hasForenames();
    /**
     * <code>optional string forenames = 2;</code>
     */
    java.lang.String getForenames();
    /**
     * <code>optional string forenames = 2;</code>
     */
    com.google.protobuf.ByteString
        getForenamesBytes();

    // optional string surname = 3;
    /**
     * <code>optional string surname = 3;</code>
     */
    boolean hasSurname();
    /**
     * <code>optional string surname = 3;</code>
     */
    java.lang.String getSurname();
    /**
     * <code>optional string surname = 3;</code>
     */
    com.google.protobuf.ByteString
        getSurnameBytes();

    // optional string name = 4;
    /**
     * <code>optional string name = 4;</code>
     */
    boolean hasName();
    /**
     * <code>optional string name = 4;</code>
     */
    java.lang.String getName();
    /**
     * <code>optional string name = 4;</code>
     */
    com.google.protobuf.ByteString
        getNameBytes();

    // optional string email = 5;
    /**
     * <code>optional string email = 5;</code>
     */
    boolean hasEmail();
    /**
     * <code>optional string email = 5;</code>
     */
    java.lang.String getEmail();
    /**
     * <code>optional string email = 5;</code>
     */
    com.google.protobuf.ByteString
        getEmailBytes();

    // repeated .KeyValue affiliationRef = 6;
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> 
        getAffiliationRefList();
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAffiliationRef(int index);
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    int getAffiliationRefCount();
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getAffiliationRefOrBuilderList();
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAffiliationRefOrBuilder(
        int index);

    // optional string docId = 7;
    /**
     * <code>optional string docId = 7;</code>
     */
    boolean hasDocId();
    /**
     * <code>optional string docId = 7;</code>
     */
    java.lang.String getDocId();
    /**
     * <code>optional string docId = 7;</code>
     */
    com.google.protobuf.ByteString
        getDocIdBytes();

    // optional int32 positionNumber = 8;
    /**
     * <code>optional int32 positionNumber = 8;</code>
     */
    boolean hasPositionNumber();
    /**
     * <code>optional int32 positionNumber = 8;</code>
     */
    int getPositionNumber();

    // repeated .KeyValue extId = 9;
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> 
        getExtIdList();
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index);
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    int getExtIdCount();
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getExtIdOrBuilderList();
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
        int index);

    // repeated .KeyValue auxiliarInfo = 10;
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> 
        getAuxiliarInfoList();
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAuxiliarInfo(int index);
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    int getAuxiliarInfoCount();
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getAuxiliarInfoOrBuilderList();
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAuxiliarInfoOrBuilder(
        int index);

    // optional string currentPersonId = 11;
    /**
     * <code>optional string currentPersonId = 11;</code>
     */
    boolean hasCurrentPersonId();
    /**
     * <code>optional string currentPersonId = 11;</code>
     */
    java.lang.String getCurrentPersonId();
    /**
     * <code>optional string currentPersonId = 11;</code>
     */
    com.google.protobuf.ByteString
        getCurrentPersonIdBytes();
  }
  /**
   * Protobuf type {@code Author}
   *
   * <pre>
   * key -- docId + "#c" + positionNumber
   * positionNumber -- author's position in the document, starting by 1
   * </pre>
   */
  public static final class Author extends
      com.google.protobuf.GeneratedMessage
      implements AuthorOrBuilder {
    // Use Author.newBuilder() to construct.
    private Author(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Author(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Author defaultInstance;
    public static Author getDefaultInstance() {
      return defaultInstance;
    }

    public Author getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Author(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              key_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              forenames_ = input.readBytes();
              break;
            }
            case 26: {
              bitField0_ |= 0x00000004;
              surname_ = input.readBytes();
              break;
            }
            case 34: {
              bitField0_ |= 0x00000008;
              name_ = input.readBytes();
              break;
            }
            case 42: {
              bitField0_ |= 0x00000010;
              email_ = input.readBytes();
              break;
            }
            case 50: {
              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
                affiliationRef_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>();
                mutable_bitField0_ |= 0x00000020;
              }
              affiliationRef_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.KeyValue.PARSER, extensionRegistry));
              break;
            }
            case 58: {
              bitField0_ |= 0x00000020;
              docId_ = input.readBytes();
              break;
            }
            case 64: {
              bitField0_ |= 0x00000040;
              positionNumber_ = input.readInt32();
              break;
            }
            case 74: {
              if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
                extId_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>();
                mutable_bitField0_ |= 0x00000100;
              }
              extId_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.KeyValue.PARSER, extensionRegistry));
              break;
            }
            case 82: {
              if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) {
                auxiliarInfo_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>();
                mutable_bitField0_ |= 0x00000200;
              }
              auxiliarInfo_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.KeyValue.PARSER, extensionRegistry));
              break;
            }
            case 90: {
              bitField0_ |= 0x00000080;
              currentPersonId_ = input.readBytes();
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
          affiliationRef_ = java.util.Collections.unmodifiableList(affiliationRef_);
        }
        if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
          extId_ = java.util.Collections.unmodifiableList(extId_);
        }
        if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) {
          auxiliarInfo_ = java.util.Collections.unmodifiableList(auxiliarInfo_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Author_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Author_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.Author.class, pl.edu.icm.coansys.models.DocumentProtos.Author.Builder.class);
    }

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

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

    private int bitField0_;
    // required string key = 1;
    public static final int KEY_FIELD_NUMBER = 1;
    private java.lang.Object key_;
    /**
     * <code>required string key = 1;</code>
     */
    public boolean hasKey() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string key = 1;</code>
     */
    public java.lang.String getKey() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          key_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string key = 1;</code>
     */
    public com.google.protobuf.ByteString
        getKeyBytes() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        key_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string forenames = 2;
    public static final int FORENAMES_FIELD_NUMBER = 2;
    private java.lang.Object forenames_;
    /**
     * <code>optional string forenames = 2;</code>
     */
    public boolean hasForenames() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional string forenames = 2;</code>
     */
    public java.lang.String getForenames() {
      java.lang.Object ref = forenames_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          forenames_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string forenames = 2;</code>
     */
    public com.google.protobuf.ByteString
        getForenamesBytes() {
      java.lang.Object ref = forenames_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        forenames_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string surname = 3;
    public static final int SURNAME_FIELD_NUMBER = 3;
    private java.lang.Object surname_;
    /**
     * <code>optional string surname = 3;</code>
     */
    public boolean hasSurname() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional string surname = 3;</code>
     */
    public java.lang.String getSurname() {
      java.lang.Object ref = surname_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          surname_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string surname = 3;</code>
     */
    public com.google.protobuf.ByteString
        getSurnameBytes() {
      java.lang.Object ref = surname_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        surname_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string name = 4;
    public static final int NAME_FIELD_NUMBER = 4;
    private java.lang.Object name_;
    /**
     * <code>optional string name = 4;</code>
     */
    public boolean hasName() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional string name = 4;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          name_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string name = 4;</code>
     */
    public com.google.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string email = 5;
    public static final int EMAIL_FIELD_NUMBER = 5;
    private java.lang.Object email_;
    /**
     * <code>optional string email = 5;</code>
     */
    public boolean hasEmail() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional string email = 5;</code>
     */
    public java.lang.String getEmail() {
      java.lang.Object ref = email_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          email_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string email = 5;</code>
     */
    public com.google.protobuf.ByteString
        getEmailBytes() {
      java.lang.Object ref = email_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        email_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // repeated .KeyValue affiliationRef = 6;
    public static final int AFFILIATIONREF_FIELD_NUMBER = 6;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> affiliationRef_;
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getAffiliationRefList() {
      return affiliationRef_;
    }
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getAffiliationRefOrBuilderList() {
      return affiliationRef_;
    }
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    public int getAffiliationRefCount() {
      return affiliationRef_.size();
    }
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAffiliationRef(int index) {
      return affiliationRef_.get(index);
    }
    /**
     * <code>repeated .KeyValue affiliationRef = 6;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAffiliationRefOrBuilder(
        int index) {
      return affiliationRef_.get(index);
    }

    // optional string docId = 7;
    public static final int DOCID_FIELD_NUMBER = 7;
    private java.lang.Object docId_;
    /**
     * <code>optional string docId = 7;</code>
     */
    public boolean hasDocId() {
      return ((bitField0_ & 0x00000020) == 0x00000020);
    }
    /**
     * <code>optional string docId = 7;</code>
     */
    public java.lang.String getDocId() {
      java.lang.Object ref = docId_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          docId_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string docId = 7;</code>
     */
    public com.google.protobuf.ByteString
        getDocIdBytes() {
      java.lang.Object ref = docId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        docId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional int32 positionNumber = 8;
    public static final int POSITIONNUMBER_FIELD_NUMBER = 8;
    private int positionNumber_;
    /**
     * <code>optional int32 positionNumber = 8;</code>
     */
    public boolean hasPositionNumber() {
      return ((bitField0_ & 0x00000040) == 0x00000040);
    }
    /**
     * <code>optional int32 positionNumber = 8;</code>
     */
    public int getPositionNumber() {
      return positionNumber_;
    }

    // repeated .KeyValue extId = 9;
    public static final int EXTID_FIELD_NUMBER = 9;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> extId_;
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getExtIdList() {
      return extId_;
    }
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getExtIdOrBuilderList() {
      return extId_;
    }
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    public int getExtIdCount() {
      return extId_.size();
    }
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index) {
      return extId_.get(index);
    }
    /**
     * <code>repeated .KeyValue extId = 9;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
        int index) {
      return extId_.get(index);
    }

    // repeated .KeyValue auxiliarInfo = 10;
    public static final int AUXILIARINFO_FIELD_NUMBER = 10;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> auxiliarInfo_;
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getAuxiliarInfoList() {
      return auxiliarInfo_;
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getAuxiliarInfoOrBuilderList() {
      return auxiliarInfo_;
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    public int getAuxiliarInfoCount() {
      return auxiliarInfo_.size();
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAuxiliarInfo(int index) {
      return auxiliarInfo_.get(index);
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 10;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAuxiliarInfoOrBuilder(
        int index) {
      return auxiliarInfo_.get(index);
    }

    // optional string currentPersonId = 11;
    public static final int CURRENTPERSONID_FIELD_NUMBER = 11;
    private java.lang.Object currentPersonId_;
    /**
     * <code>optional string currentPersonId = 11;</code>
     */
    public boolean hasCurrentPersonId() {
      return ((bitField0_ & 0x00000080) == 0x00000080);
    }
    /**
     * <code>optional string currentPersonId = 11;</code>
     */
    public java.lang.String getCurrentPersonId() {
      java.lang.Object ref = currentPersonId_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          currentPersonId_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string currentPersonId = 11;</code>
     */
    public com.google.protobuf.ByteString
        getCurrentPersonIdBytes() {
      java.lang.Object ref = currentPersonId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        currentPersonId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    private void initFields() {
      key_ = "";
      forenames_ = "";
      surname_ = "";
      name_ = "";
      email_ = "";
      affiliationRef_ = java.util.Collections.emptyList();
      docId_ = "";
      positionNumber_ = 0;
      extId_ = java.util.Collections.emptyList();
      auxiliarInfo_ = java.util.Collections.emptyList();
      currentPersonId_ = "";
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasKey()) {
        memoizedIsInitialized = 0;
        return false;
      }
      for (int i = 0; i < getAffiliationRefCount(); i++) {
        if (!getAffiliationRef(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getExtIdCount(); i++) {
        if (!getExtId(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getAuxiliarInfoCount(); i++) {
        if (!getAuxiliarInfo(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getForenamesBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, getSurnameBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeBytes(4, getNameBytes());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeBytes(5, getEmailBytes());
      }
      for (int i = 0; i < affiliationRef_.size(); i++) {
        output.writeMessage(6, affiliationRef_.get(i));
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeBytes(7, getDocIdBytes());
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        output.writeInt32(8, positionNumber_);
      }
      for (int i = 0; i < extId_.size(); i++) {
        output.writeMessage(9, extId_.get(i));
      }
      for (int i = 0; i < auxiliarInfo_.size(); i++) {
        output.writeMessage(10, auxiliarInfo_.get(i));
      }
      if (((bitField0_ & 0x00000080) == 0x00000080)) {
        output.writeBytes(11, getCurrentPersonIdBytes());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getForenamesBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, getSurnameBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(4, getNameBytes());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(5, getEmailBytes());
      }
      for (int i = 0; i < affiliationRef_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(6, affiliationRef_.get(i));
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(7, getDocIdBytes());
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(8, positionNumber_);
      }
      for (int i = 0; i < extId_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(9, extId_.get(i));
      }
      for (int i = 0; i < auxiliarInfo_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(10, auxiliarInfo_.get(i));
      }
      if (((bitField0_ & 0x00000080) == 0x00000080)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(11, getCurrentPersonIdBytes());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Author parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.Author prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code Author}
     *
     * <pre>
     * key -- docId + "#c" + positionNumber
     * positionNumber -- author's position in the document, starting by 1
     * </pre>
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Author_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Author_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.Author.class, pl.edu.icm.coansys.models.DocumentProtos.Author.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.Author.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getAffiliationRefFieldBuilder();
          getExtIdFieldBuilder();
          getAuxiliarInfoFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        key_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        forenames_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        surname_ = "";
        bitField0_ = (bitField0_ & ~0x00000004);
        name_ = "";
        bitField0_ = (bitField0_ & ~0x00000008);
        email_ = "";
        bitField0_ = (bitField0_ & ~0x00000010);
        if (affiliationRefBuilder_ == null) {
          affiliationRef_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000020);
        } else {
          affiliationRefBuilder_.clear();
        }
        docId_ = "";
        bitField0_ = (bitField0_ & ~0x00000040);
        positionNumber_ = 0;
        bitField0_ = (bitField0_ & ~0x00000080);
        if (extIdBuilder_ == null) {
          extId_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000100);
        } else {
          extIdBuilder_.clear();
        }
        if (auxiliarInfoBuilder_ == null) {
          auxiliarInfo_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000200);
        } else {
          auxiliarInfoBuilder_.clear();
        }
        currentPersonId_ = "";
        bitField0_ = (bitField0_ & ~0x00000400);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Author_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Author getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.Author.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Author build() {
        pl.edu.icm.coansys.models.DocumentProtos.Author result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Author buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.Author result = new pl.edu.icm.coansys.models.DocumentProtos.Author(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.key_ = key_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.forenames_ = forenames_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.surname_ = surname_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.name_ = name_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        result.email_ = email_;
        if (affiliationRefBuilder_ == null) {
          if (((bitField0_ & 0x00000020) == 0x00000020)) {
            affiliationRef_ = java.util.Collections.unmodifiableList(affiliationRef_);
            bitField0_ = (bitField0_ & ~0x00000020);
          }
          result.affiliationRef_ = affiliationRef_;
        } else {
          result.affiliationRef_ = affiliationRefBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000020;
        }
        result.docId_ = docId_;
        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
          to_bitField0_ |= 0x00000040;
        }
        result.positionNumber_ = positionNumber_;
        if (extIdBuilder_ == null) {
          if (((bitField0_ & 0x00000100) == 0x00000100)) {
            extId_ = java.util.Collections.unmodifiableList(extId_);
            bitField0_ = (bitField0_ & ~0x00000100);
          }
          result.extId_ = extId_;
        } else {
          result.extId_ = extIdBuilder_.build();
        }
        if (auxiliarInfoBuilder_ == null) {
          if (((bitField0_ & 0x00000200) == 0x00000200)) {
            auxiliarInfo_ = java.util.Collections.unmodifiableList(auxiliarInfo_);
            bitField0_ = (bitField0_ & ~0x00000200);
          }
          result.auxiliarInfo_ = auxiliarInfo_;
        } else {
          result.auxiliarInfo_ = auxiliarInfoBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
          to_bitField0_ |= 0x00000080;
        }
        result.currentPersonId_ = currentPersonId_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.Author) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.Author)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.Author other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.Author.getDefaultInstance()) return this;
        if (other.hasKey()) {
          bitField0_ |= 0x00000001;
          key_ = other.key_;
          onChanged();
        }
        if (other.hasForenames()) {
          bitField0_ |= 0x00000002;
          forenames_ = other.forenames_;
          onChanged();
        }
        if (other.hasSurname()) {
          bitField0_ |= 0x00000004;
          surname_ = other.surname_;
          onChanged();
        }
        if (other.hasName()) {
          bitField0_ |= 0x00000008;
          name_ = other.name_;
          onChanged();
        }
        if (other.hasEmail()) {
          bitField0_ |= 0x00000010;
          email_ = other.email_;
          onChanged();
        }
        if (affiliationRefBuilder_ == null) {
          if (!other.affiliationRef_.isEmpty()) {
            if (affiliationRef_.isEmpty()) {
              affiliationRef_ = other.affiliationRef_;
              bitField0_ = (bitField0_ & ~0x00000020);
            } else {
              ensureAffiliationRefIsMutable();
              affiliationRef_.addAll(other.affiliationRef_);
            }
            onChanged();
          }
        } else {
          if (!other.affiliationRef_.isEmpty()) {
            if (affiliationRefBuilder_.isEmpty()) {
              affiliationRefBuilder_.dispose();
              affiliationRefBuilder_ = null;
              affiliationRef_ = other.affiliationRef_;
              bitField0_ = (bitField0_ & ~0x00000020);
              affiliationRefBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getAffiliationRefFieldBuilder() : null;
            } else {
              affiliationRefBuilder_.addAllMessages(other.affiliationRef_);
            }
          }
        }
        if (other.hasDocId()) {
          bitField0_ |= 0x00000040;
          docId_ = other.docId_;
          onChanged();
        }
        if (other.hasPositionNumber()) {
          setPositionNumber(other.getPositionNumber());
        }
        if (extIdBuilder_ == null) {
          if (!other.extId_.isEmpty()) {
            if (extId_.isEmpty()) {
              extId_ = other.extId_;
              bitField0_ = (bitField0_ & ~0x00000100);
            } else {
              ensureExtIdIsMutable();
              extId_.addAll(other.extId_);
            }
            onChanged();
          }
        } else {
          if (!other.extId_.isEmpty()) {
            if (extIdBuilder_.isEmpty()) {
              extIdBuilder_.dispose();
              extIdBuilder_ = null;
              extId_ = other.extId_;
              bitField0_ = (bitField0_ & ~0x00000100);
              extIdBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getExtIdFieldBuilder() : null;
            } else {
              extIdBuilder_.addAllMessages(other.extId_);
            }
          }
        }
        if (auxiliarInfoBuilder_ == null) {
          if (!other.auxiliarInfo_.isEmpty()) {
            if (auxiliarInfo_.isEmpty()) {
              auxiliarInfo_ = other.auxiliarInfo_;
              bitField0_ = (bitField0_ & ~0x00000200);
            } else {
              ensureAuxiliarInfoIsMutable();
              auxiliarInfo_.addAll(other.auxiliarInfo_);
            }
            onChanged();
          }
        } else {
          if (!other.auxiliarInfo_.isEmpty()) {
            if (auxiliarInfoBuilder_.isEmpty()) {
              auxiliarInfoBuilder_.dispose();
              auxiliarInfoBuilder_ = null;
              auxiliarInfo_ = other.auxiliarInfo_;
              bitField0_ = (bitField0_ & ~0x00000200);
              auxiliarInfoBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getAuxiliarInfoFieldBuilder() : null;
            } else {
              auxiliarInfoBuilder_.addAllMessages(other.auxiliarInfo_);
            }
          }
        }
        if (other.hasCurrentPersonId()) {
          bitField0_ |= 0x00000400;
          currentPersonId_ = other.currentPersonId_;
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasKey()) {
          
          return false;
        }
        for (int i = 0; i < getAffiliationRefCount(); i++) {
          if (!getAffiliationRef(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getExtIdCount(); i++) {
          if (!getExtId(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getAuxiliarInfoCount(); i++) {
          if (!getAuxiliarInfo(i).isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.Author parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.Author) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string key = 1;
      private java.lang.Object key_ = "";
      /**
       * <code>required string key = 1;</code>
       */
      public boolean hasKey() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string key = 1;</code>
       */
      public java.lang.String getKey() {
        java.lang.Object ref = key_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          key_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public com.google.protobuf.ByteString
          getKeyBytes() {
        java.lang.Object ref = key_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          key_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKey(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder clearKey() {
        bitField0_ = (bitField0_ & ~0x00000001);
        key_ = getDefaultInstance().getKey();
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKeyBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }

      // optional string forenames = 2;
      private java.lang.Object forenames_ = "";
      /**
       * <code>optional string forenames = 2;</code>
       */
      public boolean hasForenames() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional string forenames = 2;</code>
       */
      public java.lang.String getForenames() {
        java.lang.Object ref = forenames_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          forenames_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string forenames = 2;</code>
       */
      public com.google.protobuf.ByteString
          getForenamesBytes() {
        java.lang.Object ref = forenames_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          forenames_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string forenames = 2;</code>
       */
      public Builder setForenames(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        forenames_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string forenames = 2;</code>
       */
      public Builder clearForenames() {
        bitField0_ = (bitField0_ & ~0x00000002);
        forenames_ = getDefaultInstance().getForenames();
        onChanged();
        return this;
      }
      /**
       * <code>optional string forenames = 2;</code>
       */
      public Builder setForenamesBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        forenames_ = value;
        onChanged();
        return this;
      }

      // optional string surname = 3;
      private java.lang.Object surname_ = "";
      /**
       * <code>optional string surname = 3;</code>
       */
      public boolean hasSurname() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional string surname = 3;</code>
       */
      public java.lang.String getSurname() {
        java.lang.Object ref = surname_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          surname_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string surname = 3;</code>
       */
      public com.google.protobuf.ByteString
          getSurnameBytes() {
        java.lang.Object ref = surname_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          surname_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string surname = 3;</code>
       */
      public Builder setSurname(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        surname_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string surname = 3;</code>
       */
      public Builder clearSurname() {
        bitField0_ = (bitField0_ & ~0x00000004);
        surname_ = getDefaultInstance().getSurname();
        onChanged();
        return this;
      }
      /**
       * <code>optional string surname = 3;</code>
       */
      public Builder setSurnameBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        surname_ = value;
        onChanged();
        return this;
      }

      // optional string name = 4;
      private java.lang.Object name_ = "";
      /**
       * <code>optional string name = 4;</code>
       */
      public boolean hasName() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional string name = 4;</code>
       */
      public java.lang.String getName() {
        java.lang.Object ref = name_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          name_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string name = 4;</code>
       */
      public com.google.protobuf.ByteString
          getNameBytes() {
        java.lang.Object ref = name_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          name_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string name = 4;</code>
       */
      public Builder setName(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        name_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string name = 4;</code>
       */
      public Builder clearName() {
        bitField0_ = (bitField0_ & ~0x00000008);
        name_ = getDefaultInstance().getName();
        onChanged();
        return this;
      }
      /**
       * <code>optional string name = 4;</code>
       */
      public Builder setNameBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        name_ = value;
        onChanged();
        return this;
      }

      // optional string email = 5;
      private java.lang.Object email_ = "";
      /**
       * <code>optional string email = 5;</code>
       */
      public boolean hasEmail() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional string email = 5;</code>
       */
      public java.lang.String getEmail() {
        java.lang.Object ref = email_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          email_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string email = 5;</code>
       */
      public com.google.protobuf.ByteString
          getEmailBytes() {
        java.lang.Object ref = email_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          email_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string email = 5;</code>
       */
      public Builder setEmail(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        email_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string email = 5;</code>
       */
      public Builder clearEmail() {
        bitField0_ = (bitField0_ & ~0x00000010);
        email_ = getDefaultInstance().getEmail();
        onChanged();
        return this;
      }
      /**
       * <code>optional string email = 5;</code>
       */
      public Builder setEmailBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        email_ = value;
        onChanged();
        return this;
      }

      // repeated .KeyValue affiliationRef = 6;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> affiliationRef_ =
        java.util.Collections.emptyList();
      private void ensureAffiliationRefIsMutable() {
        if (!((bitField0_ & 0x00000020) == 0x00000020)) {
          affiliationRef_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>(affiliationRef_);
          bitField0_ |= 0x00000020;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> affiliationRefBuilder_;

      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getAffiliationRefList() {
        if (affiliationRefBuilder_ == null) {
          return java.util.Collections.unmodifiableList(affiliationRef_);
        } else {
          return affiliationRefBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public int getAffiliationRefCount() {
        if (affiliationRefBuilder_ == null) {
          return affiliationRef_.size();
        } else {
          return affiliationRefBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAffiliationRef(int index) {
        if (affiliationRefBuilder_ == null) {
          return affiliationRef_.get(index);
        } else {
          return affiliationRefBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder setAffiliationRef(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (affiliationRefBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAffiliationRefIsMutable();
          affiliationRef_.set(index, value);
          onChanged();
        } else {
          affiliationRefBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder setAffiliationRef(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (affiliationRefBuilder_ == null) {
          ensureAffiliationRefIsMutable();
          affiliationRef_.set(index, builderForValue.build());
          onChanged();
        } else {
          affiliationRefBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder addAffiliationRef(pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (affiliationRefBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAffiliationRefIsMutable();
          affiliationRef_.add(value);
          onChanged();
        } else {
          affiliationRefBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder addAffiliationRef(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (affiliationRefBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAffiliationRefIsMutable();
          affiliationRef_.add(index, value);
          onChanged();
        } else {
          affiliationRefBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder addAffiliationRef(
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (affiliationRefBuilder_ == null) {
          ensureAffiliationRefIsMutable();
          affiliationRef_.add(builderForValue.build());
          onChanged();
        } else {
          affiliationRefBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder addAffiliationRef(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (affiliationRefBuilder_ == null) {
          ensureAffiliationRefIsMutable();
          affiliationRef_.add(index, builderForValue.build());
          onChanged();
        } else {
          affiliationRefBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder addAllAffiliationRef(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValue> values) {
        if (affiliationRefBuilder_ == null) {
          ensureAffiliationRefIsMutable();
          super.addAll(values, affiliationRef_);
          onChanged();
        } else {
          affiliationRefBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder clearAffiliationRef() {
        if (affiliationRefBuilder_ == null) {
          affiliationRef_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000020);
          onChanged();
        } else {
          affiliationRefBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public Builder removeAffiliationRef(int index) {
        if (affiliationRefBuilder_ == null) {
          ensureAffiliationRefIsMutable();
          affiliationRef_.remove(index);
          onChanged();
        } else {
          affiliationRefBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder getAffiliationRefBuilder(
          int index) {
        return getAffiliationRefFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAffiliationRefOrBuilder(
          int index) {
        if (affiliationRefBuilder_ == null) {
          return affiliationRef_.get(index);  } else {
          return affiliationRefBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
           getAffiliationRefOrBuilderList() {
        if (affiliationRefBuilder_ != null) {
          return affiliationRefBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(affiliationRef_);
        }
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addAffiliationRefBuilder() {
        return getAffiliationRefFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addAffiliationRefBuilder(
          int index) {
        return getAffiliationRefFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue affiliationRef = 6;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder> 
           getAffiliationRefBuilderList() {
        return getAffiliationRefFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
          getAffiliationRefFieldBuilder() {
        if (affiliationRefBuilder_ == null) {
          affiliationRefBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder>(
                  affiliationRef_,
                  ((bitField0_ & 0x00000020) == 0x00000020),
                  getParentForChildren(),
                  isClean());
          affiliationRef_ = null;
        }
        return affiliationRefBuilder_;
      }

      // optional string docId = 7;
      private java.lang.Object docId_ = "";
      /**
       * <code>optional string docId = 7;</code>
       */
      public boolean hasDocId() {
        return ((bitField0_ & 0x00000040) == 0x00000040);
      }
      /**
       * <code>optional string docId = 7;</code>
       */
      public java.lang.String getDocId() {
        java.lang.Object ref = docId_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          docId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string docId = 7;</code>
       */
      public com.google.protobuf.ByteString
          getDocIdBytes() {
        java.lang.Object ref = docId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          docId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string docId = 7;</code>
       */
      public Builder setDocId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000040;
        docId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string docId = 7;</code>
       */
      public Builder clearDocId() {
        bitField0_ = (bitField0_ & ~0x00000040);
        docId_ = getDefaultInstance().getDocId();
        onChanged();
        return this;
      }
      /**
       * <code>optional string docId = 7;</code>
       */
      public Builder setDocIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000040;
        docId_ = value;
        onChanged();
        return this;
      }

      // optional int32 positionNumber = 8;
      private int positionNumber_ ;
      /**
       * <code>optional int32 positionNumber = 8;</code>
       */
      public boolean hasPositionNumber() {
        return ((bitField0_ & 0x00000080) == 0x00000080);
      }
      /**
       * <code>optional int32 positionNumber = 8;</code>
       */
      public int getPositionNumber() {
        return positionNumber_;
      }
      /**
       * <code>optional int32 positionNumber = 8;</code>
       */
      public Builder setPositionNumber(int value) {
        bitField0_ |= 0x00000080;
        positionNumber_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 positionNumber = 8;</code>
       */
      public Builder clearPositionNumber() {
        bitField0_ = (bitField0_ & ~0x00000080);
        positionNumber_ = 0;
        onChanged();
        return this;
      }

      // repeated .KeyValue extId = 9;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> extId_ =
        java.util.Collections.emptyList();
      private void ensureExtIdIsMutable() {
        if (!((bitField0_ & 0x00000100) == 0x00000100)) {
          extId_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>(extId_);
          bitField0_ |= 0x00000100;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> extIdBuilder_;

      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getExtIdList() {
        if (extIdBuilder_ == null) {
          return java.util.Collections.unmodifiableList(extId_);
        } else {
          return extIdBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public int getExtIdCount() {
        if (extIdBuilder_ == null) {
          return extId_.size();
        } else {
          return extIdBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index) {
        if (extIdBuilder_ == null) {
          return extId_.get(index);
        } else {
          return extIdBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder setExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.set(index, value);
          onChanged();
        } else {
          extIdBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder setExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.set(index, builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder addExtId(pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.add(value);
          onChanged();
        } else {
          extIdBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder addExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.add(index, value);
          onChanged();
        } else {
          extIdBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder addExtId(
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.add(builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder addExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.add(index, builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder addAllExtId(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValue> values) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          super.addAll(values, extId_);
          onChanged();
        } else {
          extIdBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder clearExtId() {
        if (extIdBuilder_ == null) {
          extId_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000100);
          onChanged();
        } else {
          extIdBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public Builder removeExtId(int index) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.remove(index);
          onChanged();
        } else {
          extIdBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder getExtIdBuilder(
          int index) {
        return getExtIdFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
          int index) {
        if (extIdBuilder_ == null) {
          return extId_.get(index);  } else {
          return extIdBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
           getExtIdOrBuilderList() {
        if (extIdBuilder_ != null) {
          return extIdBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(extId_);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addExtIdBuilder() {
        return getExtIdFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addExtIdBuilder(
          int index) {
        return getExtIdFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue extId = 9;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder> 
           getExtIdBuilderList() {
        return getExtIdFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
          getExtIdFieldBuilder() {
        if (extIdBuilder_ == null) {
          extIdBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder>(
                  extId_,
                  ((bitField0_ & 0x00000100) == 0x00000100),
                  getParentForChildren(),
                  isClean());
          extId_ = null;
        }
        return extIdBuilder_;
      }

      // repeated .KeyValue auxiliarInfo = 10;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> auxiliarInfo_ =
        java.util.Collections.emptyList();
      private void ensureAuxiliarInfoIsMutable() {
        if (!((bitField0_ & 0x00000200) == 0x00000200)) {
          auxiliarInfo_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>(auxiliarInfo_);
          bitField0_ |= 0x00000200;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> auxiliarInfoBuilder_;

      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getAuxiliarInfoList() {
        if (auxiliarInfoBuilder_ == null) {
          return java.util.Collections.unmodifiableList(auxiliarInfo_);
        } else {
          return auxiliarInfoBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public int getAuxiliarInfoCount() {
        if (auxiliarInfoBuilder_ == null) {
          return auxiliarInfo_.size();
        } else {
          return auxiliarInfoBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAuxiliarInfo(int index) {
        if (auxiliarInfoBuilder_ == null) {
          return auxiliarInfo_.get(index);
        } else {
          return auxiliarInfoBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder setAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (auxiliarInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.set(index, value);
          onChanged();
        } else {
          auxiliarInfoBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder setAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.set(index, builderForValue.build());
          onChanged();
        } else {
          auxiliarInfoBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder addAuxiliarInfo(pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (auxiliarInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(value);
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder addAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (auxiliarInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(index, value);
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder addAuxiliarInfo(
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(builderForValue.build());
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder addAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(index, builderForValue.build());
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder addAllAuxiliarInfo(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValue> values) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          super.addAll(values, auxiliarInfo_);
          onChanged();
        } else {
          auxiliarInfoBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder clearAuxiliarInfo() {
        if (auxiliarInfoBuilder_ == null) {
          auxiliarInfo_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000200);
          onChanged();
        } else {
          auxiliarInfoBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public Builder removeAuxiliarInfo(int index) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.remove(index);
          onChanged();
        } else {
          auxiliarInfoBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder getAuxiliarInfoBuilder(
          int index) {
        return getAuxiliarInfoFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAuxiliarInfoOrBuilder(
          int index) {
        if (auxiliarInfoBuilder_ == null) {
          return auxiliarInfo_.get(index);  } else {
          return auxiliarInfoBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
           getAuxiliarInfoOrBuilderList() {
        if (auxiliarInfoBuilder_ != null) {
          return auxiliarInfoBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(auxiliarInfo_);
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addAuxiliarInfoBuilder() {
        return getAuxiliarInfoFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addAuxiliarInfoBuilder(
          int index) {
        return getAuxiliarInfoFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 10;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder> 
           getAuxiliarInfoBuilderList() {
        return getAuxiliarInfoFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
          getAuxiliarInfoFieldBuilder() {
        if (auxiliarInfoBuilder_ == null) {
          auxiliarInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder>(
                  auxiliarInfo_,
                  ((bitField0_ & 0x00000200) == 0x00000200),
                  getParentForChildren(),
                  isClean());
          auxiliarInfo_ = null;
        }
        return auxiliarInfoBuilder_;
      }

      // optional string currentPersonId = 11;
      private java.lang.Object currentPersonId_ = "";
      /**
       * <code>optional string currentPersonId = 11;</code>
       */
      public boolean hasCurrentPersonId() {
        return ((bitField0_ & 0x00000400) == 0x00000400);
      }
      /**
       * <code>optional string currentPersonId = 11;</code>
       */
      public java.lang.String getCurrentPersonId() {
        java.lang.Object ref = currentPersonId_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          currentPersonId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string currentPersonId = 11;</code>
       */
      public com.google.protobuf.ByteString
          getCurrentPersonIdBytes() {
        java.lang.Object ref = currentPersonId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          currentPersonId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string currentPersonId = 11;</code>
       */
      public Builder setCurrentPersonId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000400;
        currentPersonId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string currentPersonId = 11;</code>
       */
      public Builder clearCurrentPersonId() {
        bitField0_ = (bitField0_ & ~0x00000400);
        currentPersonId_ = getDefaultInstance().getCurrentPersonId();
        onChanged();
        return this;
      }
      /**
       * <code>optional string currentPersonId = 11;</code>
       */
      public Builder setCurrentPersonIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000400;
        currentPersonId_ = value;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:Author)
    }

    static {
      defaultInstance = new Author(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:Author)
  }

  public interface BasicMetadataOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // repeated .TextWithLanguage title = 1;
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> 
        getTitleList();
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage getTitle(int index);
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    int getTitleCount();
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
        getTitleOrBuilderList();
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder getTitleOrBuilder(
        int index);

    // repeated .Author author = 2;
    /**
     * <code>repeated .Author author = 2;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Author> 
        getAuthorList();
    /**
     * <code>repeated .Author author = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.Author getAuthor(int index);
    /**
     * <code>repeated .Author author = 2;</code>
     */
    int getAuthorCount();
    /**
     * <code>repeated .Author author = 2;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder> 
        getAuthorOrBuilderList();
    /**
     * <code>repeated .Author author = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder getAuthorOrBuilder(
        int index);

    // optional string doi = 3;
    /**
     * <code>optional string doi = 3;</code>
     */
    boolean hasDoi();
    /**
     * <code>optional string doi = 3;</code>
     */
    java.lang.String getDoi();
    /**
     * <code>optional string doi = 3;</code>
     */
    com.google.protobuf.ByteString
        getDoiBytes();

    // optional string journal = 4;
    /**
     * <code>optional string journal = 4;</code>
     *
     * <pre>
     * journal should be treated as parent name
     * </pre>
     */
    boolean hasJournal();
    /**
     * <code>optional string journal = 4;</code>
     *
     * <pre>
     * journal should be treated as parent name
     * </pre>
     */
    java.lang.String getJournal();
    /**
     * <code>optional string journal = 4;</code>
     *
     * <pre>
     * journal should be treated as parent name
     * </pre>
     */
    com.google.protobuf.ByteString
        getJournalBytes();

    // optional string isbn = 5;
    /**
     * <code>optional string isbn = 5;</code>
     */
    boolean hasIsbn();
    /**
     * <code>optional string isbn = 5;</code>
     */
    java.lang.String getIsbn();
    /**
     * <code>optional string isbn = 5;</code>
     */
    com.google.protobuf.ByteString
        getIsbnBytes();

    // optional string issn = 6;
    /**
     * <code>optional string issn = 6;</code>
     */
    boolean hasIssn();
    /**
     * <code>optional string issn = 6;</code>
     */
    java.lang.String getIssn();
    /**
     * <code>optional string issn = 6;</code>
     */
    com.google.protobuf.ByteString
        getIssnBytes();

    // optional string year = 7;
    /**
     * <code>optional string year = 7;</code>
     */
    boolean hasYear();
    /**
     * <code>optional string year = 7;</code>
     */
    java.lang.String getYear();
    /**
     * <code>optional string year = 7;</code>
     */
    com.google.protobuf.ByteString
        getYearBytes();

    // optional string issue = 8;
    /**
     * <code>optional string issue = 8;</code>
     */
    boolean hasIssue();
    /**
     * <code>optional string issue = 8;</code>
     */
    java.lang.String getIssue();
    /**
     * <code>optional string issue = 8;</code>
     */
    com.google.protobuf.ByteString
        getIssueBytes();

    // optional string volume = 9;
    /**
     * <code>optional string volume = 9;</code>
     */
    boolean hasVolume();
    /**
     * <code>optional string volume = 9;</code>
     */
    java.lang.String getVolume();
    /**
     * <code>optional string volume = 9;</code>
     */
    com.google.protobuf.ByteString
        getVolumeBytes();

    // optional string pages = 10;
    /**
     * <code>optional string pages = 10;</code>
     */
    boolean hasPages();
    /**
     * <code>optional string pages = 10;</code>
     */
    java.lang.String getPages();
    /**
     * <code>optional string pages = 10;</code>
     */
    com.google.protobuf.ByteString
        getPagesBytes();

    // repeated .ClassifCode classifCode = 11;
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode> 
        getClassifCodeList();
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ClassifCode getClassifCode(int index);
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    int getClassifCodeCount();
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder> 
        getClassifCodeOrBuilderList();
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder getClassifCodeOrBuilder(
        int index);

    // repeated string parentId = 12;
    /**
     * <code>repeated string parentId = 12;</code>
     */
    java.util.List<java.lang.String>
    getParentIdList();
    /**
     * <code>repeated string parentId = 12;</code>
     */
    int getParentIdCount();
    /**
     * <code>repeated string parentId = 12;</code>
     */
    java.lang.String getParentId(int index);
    /**
     * <code>repeated string parentId = 12;</code>
     */
    com.google.protobuf.ByteString
        getParentIdBytes(int index);

    // repeated string currentProjectId = 13;
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    java.util.List<java.lang.String>
    getCurrentProjectIdList();
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    int getCurrentProjectIdCount();
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    java.lang.String getCurrentProjectId(int index);
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    com.google.protobuf.ByteString
        getCurrentProjectIdBytes(int index);

    // optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];
    /**
     * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
     */
    boolean hasParentType();
    /**
     * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType getParentType();

    // repeated string parentUrl = 15;
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    java.util.List<java.lang.String>
    getParentUrlList();
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    int getParentUrlCount();
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    java.lang.String getParentUrl(int index);
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    com.google.protobuf.ByteString
        getParentUrlBytes(int index);
  }
  /**
   * Protobuf type {@code BasicMetadata}
   *
   * <pre>
   * common metadata for documents and references
   * </pre>
   */
  public static final class BasicMetadata extends
      com.google.protobuf.GeneratedMessage
      implements BasicMetadataOrBuilder {
    // Use BasicMetadata.newBuilder() to construct.
    private BasicMetadata(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private BasicMetadata(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final BasicMetadata defaultInstance;
    public static BasicMetadata getDefaultInstance() {
      return defaultInstance;
    }

    public BasicMetadata getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private BasicMetadata(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                title_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage>();
                mutable_bitField0_ |= 0x00000001;
              }
              title_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.PARSER, extensionRegistry));
              break;
            }
            case 18: {
              if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
                author_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.Author>();
                mutable_bitField0_ |= 0x00000002;
              }
              author_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.Author.PARSER, extensionRegistry));
              break;
            }
            case 26: {
              bitField0_ |= 0x00000001;
              doi_ = input.readBytes();
              break;
            }
            case 34: {
              bitField0_ |= 0x00000002;
              journal_ = input.readBytes();
              break;
            }
            case 42: {
              bitField0_ |= 0x00000004;
              isbn_ = input.readBytes();
              break;
            }
            case 50: {
              bitField0_ |= 0x00000008;
              issn_ = input.readBytes();
              break;
            }
            case 58: {
              bitField0_ |= 0x00000010;
              year_ = input.readBytes();
              break;
            }
            case 66: {
              bitField0_ |= 0x00000020;
              issue_ = input.readBytes();
              break;
            }
            case 74: {
              bitField0_ |= 0x00000040;
              volume_ = input.readBytes();
              break;
            }
            case 82: {
              bitField0_ |= 0x00000080;
              pages_ = input.readBytes();
              break;
            }
            case 90: {
              if (!((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
                classifCode_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode>();
                mutable_bitField0_ |= 0x00000400;
              }
              classifCode_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.PARSER, extensionRegistry));
              break;
            }
            case 98: {
              if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
                parentId_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000800;
              }
              parentId_.add(input.readBytes());
              break;
            }
            case 106: {
              if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
                currentProjectId_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00001000;
              }
              currentProjectId_.add(input.readBytes());
              break;
            }
            case 112: {
              int rawValue = input.readEnum();
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType value = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(14, rawValue);
              } else {
                bitField0_ |= 0x00000100;
                parentType_ = value;
              }
              break;
            }
            case 122: {
              if (!((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
                parentUrl_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00004000;
              }
              parentUrl_.add(input.readBytes());
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
          title_ = java.util.Collections.unmodifiableList(title_);
        }
        if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
          author_ = java.util.Collections.unmodifiableList(author_);
        }
        if (((mutable_bitField0_ & 0x00000400) == 0x00000400)) {
          classifCode_ = java.util.Collections.unmodifiableList(classifCode_);
        }
        if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
          parentId_ = new com.google.protobuf.UnmodifiableLazyStringList(parentId_);
        }
        if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) {
          currentProjectId_ = new com.google.protobuf.UnmodifiableLazyStringList(currentProjectId_);
        }
        if (((mutable_bitField0_ & 0x00004000) == 0x00004000)) {
          parentUrl_ = new com.google.protobuf.UnmodifiableLazyStringList(parentUrl_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_BasicMetadata_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_BasicMetadata_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.class, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder.class);
    }

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

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

    /**
     * Protobuf enum {@code BasicMetadata.ParentType}
     */
    public enum ParentType
        implements com.google.protobuf.ProtocolMessageEnum {
      /**
       * <code>JOURNAL = 1;</code>
       */
      JOURNAL(0, 1),
      /**
       * <code>BOOK = 2;</code>
       */
      BOOK(1, 2),
      /**
       * <code>BLOG = 3;</code>
       */
      BLOG(2, 3),
      ;

      /**
       * <code>JOURNAL = 1;</code>
       */
      public static final int JOURNAL_VALUE = 1;
      /**
       * <code>BOOK = 2;</code>
       */
      public static final int BOOK_VALUE = 2;
      /**
       * <code>BLOG = 3;</code>
       */
      public static final int BLOG_VALUE = 3;


      public final int getNumber() { return value; }

      public static ParentType valueOf(int value) {
        switch (value) {
          case 1: return JOURNAL;
          case 2: return BOOK;
          case 3: return BLOG;
          default: return null;
        }
      }

      public static com.google.protobuf.Internal.EnumLiteMap<ParentType>
          internalGetValueMap() {
        return internalValueMap;
      }
      private static com.google.protobuf.Internal.EnumLiteMap<ParentType>
          internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<ParentType>() {
              public ParentType findValueByNumber(int number) {
                return ParentType.valueOf(number);
              }
            };

      public final com.google.protobuf.Descriptors.EnumValueDescriptor
          getValueDescriptor() {
        return getDescriptor().getValues().get(index);
      }
      public final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptorForType() {
        return getDescriptor();
      }
      public static final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDescriptor().getEnumTypes().get(0);
      }

      private static final ParentType[] VALUES = values();

      public static ParentType valueOf(
          com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
        if (desc.getType() != getDescriptor()) {
          throw new java.lang.IllegalArgumentException(
            "EnumValueDescriptor is not for this type.");
        }
        return VALUES[desc.getIndex()];
      }

      private final int index;
      private final int value;

      private ParentType(int index, int value) {
        this.index = index;
        this.value = value;
      }

      // @@protoc_insertion_point(enum_scope:BasicMetadata.ParentType)
    }

    private int bitField0_;
    // repeated .TextWithLanguage title = 1;
    public static final int TITLE_FIELD_NUMBER = 1;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> title_;
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> getTitleList() {
      return title_;
    }
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
        getTitleOrBuilderList() {
      return title_;
    }
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    public int getTitleCount() {
      return title_.size();
    }
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage getTitle(int index) {
      return title_.get(index);
    }
    /**
     * <code>repeated .TextWithLanguage title = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder getTitleOrBuilder(
        int index) {
      return title_.get(index);
    }

    // repeated .Author author = 2;
    public static final int AUTHOR_FIELD_NUMBER = 2;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Author> author_;
    /**
     * <code>repeated .Author author = 2;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Author> getAuthorList() {
      return author_;
    }
    /**
     * <code>repeated .Author author = 2;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder> 
        getAuthorOrBuilderList() {
      return author_;
    }
    /**
     * <code>repeated .Author author = 2;</code>
     */
    public int getAuthorCount() {
      return author_.size();
    }
    /**
     * <code>repeated .Author author = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.Author getAuthor(int index) {
      return author_.get(index);
    }
    /**
     * <code>repeated .Author author = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder getAuthorOrBuilder(
        int index) {
      return author_.get(index);
    }

    // optional string doi = 3;
    public static final int DOI_FIELD_NUMBER = 3;
    private java.lang.Object doi_;
    /**
     * <code>optional string doi = 3;</code>
     */
    public boolean hasDoi() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional string doi = 3;</code>
     */
    public java.lang.String getDoi() {
      java.lang.Object ref = doi_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          doi_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string doi = 3;</code>
     */
    public com.google.protobuf.ByteString
        getDoiBytes() {
      java.lang.Object ref = doi_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        doi_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string journal = 4;
    public static final int JOURNAL_FIELD_NUMBER = 4;
    private java.lang.Object journal_;
    /**
     * <code>optional string journal = 4;</code>
     *
     * <pre>
     * journal should be treated as parent name
     * </pre>
     */
    public boolean hasJournal() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional string journal = 4;</code>
     *
     * <pre>
     * journal should be treated as parent name
     * </pre>
     */
    public java.lang.String getJournal() {
      java.lang.Object ref = journal_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          journal_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string journal = 4;</code>
     *
     * <pre>
     * journal should be treated as parent name
     * </pre>
     */
    public com.google.protobuf.ByteString
        getJournalBytes() {
      java.lang.Object ref = journal_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        journal_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string isbn = 5;
    public static final int ISBN_FIELD_NUMBER = 5;
    private java.lang.Object isbn_;
    /**
     * <code>optional string isbn = 5;</code>
     */
    public boolean hasIsbn() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional string isbn = 5;</code>
     */
    public java.lang.String getIsbn() {
      java.lang.Object ref = isbn_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          isbn_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string isbn = 5;</code>
     */
    public com.google.protobuf.ByteString
        getIsbnBytes() {
      java.lang.Object ref = isbn_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        isbn_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string issn = 6;
    public static final int ISSN_FIELD_NUMBER = 6;
    private java.lang.Object issn_;
    /**
     * <code>optional string issn = 6;</code>
     */
    public boolean hasIssn() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional string issn = 6;</code>
     */
    public java.lang.String getIssn() {
      java.lang.Object ref = issn_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          issn_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string issn = 6;</code>
     */
    public com.google.protobuf.ByteString
        getIssnBytes() {
      java.lang.Object ref = issn_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        issn_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string year = 7;
    public static final int YEAR_FIELD_NUMBER = 7;
    private java.lang.Object year_;
    /**
     * <code>optional string year = 7;</code>
     */
    public boolean hasYear() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional string year = 7;</code>
     */
    public java.lang.String getYear() {
      java.lang.Object ref = year_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          year_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string year = 7;</code>
     */
    public com.google.protobuf.ByteString
        getYearBytes() {
      java.lang.Object ref = year_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        year_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string issue = 8;
    public static final int ISSUE_FIELD_NUMBER = 8;
    private java.lang.Object issue_;
    /**
     * <code>optional string issue = 8;</code>
     */
    public boolean hasIssue() {
      return ((bitField0_ & 0x00000020) == 0x00000020);
    }
    /**
     * <code>optional string issue = 8;</code>
     */
    public java.lang.String getIssue() {
      java.lang.Object ref = issue_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          issue_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string issue = 8;</code>
     */
    public com.google.protobuf.ByteString
        getIssueBytes() {
      java.lang.Object ref = issue_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        issue_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string volume = 9;
    public static final int VOLUME_FIELD_NUMBER = 9;
    private java.lang.Object volume_;
    /**
     * <code>optional string volume = 9;</code>
     */
    public boolean hasVolume() {
      return ((bitField0_ & 0x00000040) == 0x00000040);
    }
    /**
     * <code>optional string volume = 9;</code>
     */
    public java.lang.String getVolume() {
      java.lang.Object ref = volume_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          volume_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string volume = 9;</code>
     */
    public com.google.protobuf.ByteString
        getVolumeBytes() {
      java.lang.Object ref = volume_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        volume_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string pages = 10;
    public static final int PAGES_FIELD_NUMBER = 10;
    private java.lang.Object pages_;
    /**
     * <code>optional string pages = 10;</code>
     */
    public boolean hasPages() {
      return ((bitField0_ & 0x00000080) == 0x00000080);
    }
    /**
     * <code>optional string pages = 10;</code>
     */
    public java.lang.String getPages() {
      java.lang.Object ref = pages_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          pages_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string pages = 10;</code>
     */
    public com.google.protobuf.ByteString
        getPagesBytes() {
      java.lang.Object ref = pages_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        pages_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // repeated .ClassifCode classifCode = 11;
    public static final int CLASSIFCODE_FIELD_NUMBER = 11;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode> classifCode_;
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode> getClassifCodeList() {
      return classifCode_;
    }
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder> 
        getClassifCodeOrBuilderList() {
      return classifCode_;
    }
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    public int getClassifCodeCount() {
      return classifCode_.size();
    }
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode getClassifCode(int index) {
      return classifCode_.get(index);
    }
    /**
     * <code>repeated .ClassifCode classifCode = 11;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder getClassifCodeOrBuilder(
        int index) {
      return classifCode_.get(index);
    }

    // repeated string parentId = 12;
    public static final int PARENTID_FIELD_NUMBER = 12;
    private com.google.protobuf.LazyStringList parentId_;
    /**
     * <code>repeated string parentId = 12;</code>
     */
    public java.util.List<java.lang.String>
        getParentIdList() {
      return parentId_;
    }
    /**
     * <code>repeated string parentId = 12;</code>
     */
    public int getParentIdCount() {
      return parentId_.size();
    }
    /**
     * <code>repeated string parentId = 12;</code>
     */
    public java.lang.String getParentId(int index) {
      return parentId_.get(index);
    }
    /**
     * <code>repeated string parentId = 12;</code>
     */
    public com.google.protobuf.ByteString
        getParentIdBytes(int index) {
      return parentId_.getByteString(index);
    }

    // repeated string currentProjectId = 13;
    public static final int CURRENTPROJECTID_FIELD_NUMBER = 13;
    private com.google.protobuf.LazyStringList currentProjectId_;
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    public java.util.List<java.lang.String>
        getCurrentProjectIdList() {
      return currentProjectId_;
    }
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    public int getCurrentProjectIdCount() {
      return currentProjectId_.size();
    }
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    public java.lang.String getCurrentProjectId(int index) {
      return currentProjectId_.get(index);
    }
    /**
     * <code>repeated string currentProjectId = 13;</code>
     */
    public com.google.protobuf.ByteString
        getCurrentProjectIdBytes(int index) {
      return currentProjectId_.getByteString(index);
    }

    // optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];
    public static final int PARENTTYPE_FIELD_NUMBER = 14;
    private pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType parentType_;
    /**
     * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
     */
    public boolean hasParentType() {
      return ((bitField0_ & 0x00000100) == 0x00000100);
    }
    /**
     * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType getParentType() {
      return parentType_;
    }

    // repeated string parentUrl = 15;
    public static final int PARENTURL_FIELD_NUMBER = 15;
    private com.google.protobuf.LazyStringList parentUrl_;
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    public java.util.List<java.lang.String>
        getParentUrlList() {
      return parentUrl_;
    }
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    public int getParentUrlCount() {
      return parentUrl_.size();
    }
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    public java.lang.String getParentUrl(int index) {
      return parentUrl_.get(index);
    }
    /**
     * <code>repeated string parentUrl = 15;</code>
     */
    public com.google.protobuf.ByteString
        getParentUrlBytes(int index) {
      return parentUrl_.getByteString(index);
    }

    private void initFields() {
      title_ = java.util.Collections.emptyList();
      author_ = java.util.Collections.emptyList();
      doi_ = "";
      journal_ = "";
      isbn_ = "";
      issn_ = "";
      year_ = "";
      issue_ = "";
      volume_ = "";
      pages_ = "";
      classifCode_ = java.util.Collections.emptyList();
      parentId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      currentProjectId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      parentType_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType.JOURNAL;
      parentUrl_ = com.google.protobuf.LazyStringArrayList.EMPTY;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      for (int i = 0; i < getTitleCount(); i++) {
        if (!getTitle(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getAuthorCount(); i++) {
        if (!getAuthor(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getClassifCodeCount(); i++) {
        if (!getClassifCode(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      for (int i = 0; i < title_.size(); i++) {
        output.writeMessage(1, title_.get(i));
      }
      for (int i = 0; i < author_.size(); i++) {
        output.writeMessage(2, author_.get(i));
      }
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(3, getDoiBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(4, getJournalBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(5, getIsbnBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeBytes(6, getIssnBytes());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeBytes(7, getYearBytes());
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeBytes(8, getIssueBytes());
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        output.writeBytes(9, getVolumeBytes());
      }
      if (((bitField0_ & 0x00000080) == 0x00000080)) {
        output.writeBytes(10, getPagesBytes());
      }
      for (int i = 0; i < classifCode_.size(); i++) {
        output.writeMessage(11, classifCode_.get(i));
      }
      for (int i = 0; i < parentId_.size(); i++) {
        output.writeBytes(12, parentId_.getByteString(i));
      }
      for (int i = 0; i < currentProjectId_.size(); i++) {
        output.writeBytes(13, currentProjectId_.getByteString(i));
      }
      if (((bitField0_ & 0x00000100) == 0x00000100)) {
        output.writeEnum(14, parentType_.getNumber());
      }
      for (int i = 0; i < parentUrl_.size(); i++) {
        output.writeBytes(15, parentUrl_.getByteString(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      for (int i = 0; i < title_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, title_.get(i));
      }
      for (int i = 0; i < author_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, author_.get(i));
      }
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, getDoiBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(4, getJournalBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(5, getIsbnBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(6, getIssnBytes());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(7, getYearBytes());
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(8, getIssueBytes());
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(9, getVolumeBytes());
      }
      if (((bitField0_ & 0x00000080) == 0x00000080)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(10, getPagesBytes());
      }
      for (int i = 0; i < classifCode_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(11, classifCode_.get(i));
      }
      {
        int dataSize = 0;
        for (int i = 0; i < parentId_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(parentId_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getParentIdList().size();
      }
      {
        int dataSize = 0;
        for (int i = 0; i < currentProjectId_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(currentProjectId_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getCurrentProjectIdList().size();
      }
      if (((bitField0_ & 0x00000100) == 0x00000100)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(14, parentType_.getNumber());
      }
      {
        int dataSize = 0;
        for (int i = 0; i < parentUrl_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(parentUrl_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getParentUrlList().size();
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code BasicMetadata}
     *
     * <pre>
     * common metadata for documents and references
     * </pre>
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_BasicMetadata_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_BasicMetadata_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.class, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getTitleFieldBuilder();
          getAuthorFieldBuilder();
          getClassifCodeFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        if (titleBuilder_ == null) {
          title_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          titleBuilder_.clear();
        }
        if (authorBuilder_ == null) {
          author_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          authorBuilder_.clear();
        }
        doi_ = "";
        bitField0_ = (bitField0_ & ~0x00000004);
        journal_ = "";
        bitField0_ = (bitField0_ & ~0x00000008);
        isbn_ = "";
        bitField0_ = (bitField0_ & ~0x00000010);
        issn_ = "";
        bitField0_ = (bitField0_ & ~0x00000020);
        year_ = "";
        bitField0_ = (bitField0_ & ~0x00000040);
        issue_ = "";
        bitField0_ = (bitField0_ & ~0x00000080);
        volume_ = "";
        bitField0_ = (bitField0_ & ~0x00000100);
        pages_ = "";
        bitField0_ = (bitField0_ & ~0x00000200);
        if (classifCodeBuilder_ == null) {
          classifCode_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000400);
        } else {
          classifCodeBuilder_.clear();
        }
        parentId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000800);
        currentProjectId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00001000);
        parentType_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType.JOURNAL;
        bitField0_ = (bitField0_ & ~0x00002000);
        parentUrl_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00004000);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_BasicMetadata_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata build() {
        pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata result = new pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (titleBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001)) {
            title_ = java.util.Collections.unmodifiableList(title_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.title_ = title_;
        } else {
          result.title_ = titleBuilder_.build();
        }
        if (authorBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002)) {
            author_ = java.util.Collections.unmodifiableList(author_);
            bitField0_ = (bitField0_ & ~0x00000002);
          }
          result.author_ = author_;
        } else {
          result.author_ = authorBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000001;
        }
        result.doi_ = doi_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000002;
        }
        result.journal_ = journal_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000004;
        }
        result.isbn_ = isbn_;
        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
          to_bitField0_ |= 0x00000008;
        }
        result.issn_ = issn_;
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000010;
        }
        result.year_ = year_;
        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
          to_bitField0_ |= 0x00000020;
        }
        result.issue_ = issue_;
        if (((from_bitField0_ & 0x00000100) == 0x00000100)) {
          to_bitField0_ |= 0x00000040;
        }
        result.volume_ = volume_;
        if (((from_bitField0_ & 0x00000200) == 0x00000200)) {
          to_bitField0_ |= 0x00000080;
        }
        result.pages_ = pages_;
        if (classifCodeBuilder_ == null) {
          if (((bitField0_ & 0x00000400) == 0x00000400)) {
            classifCode_ = java.util.Collections.unmodifiableList(classifCode_);
            bitField0_ = (bitField0_ & ~0x00000400);
          }
          result.classifCode_ = classifCode_;
        } else {
          result.classifCode_ = classifCodeBuilder_.build();
        }
        if (((bitField0_ & 0x00000800) == 0x00000800)) {
          parentId_ = new com.google.protobuf.UnmodifiableLazyStringList(
              parentId_);
          bitField0_ = (bitField0_ & ~0x00000800);
        }
        result.parentId_ = parentId_;
        if (((bitField0_ & 0x00001000) == 0x00001000)) {
          currentProjectId_ = new com.google.protobuf.UnmodifiableLazyStringList(
              currentProjectId_);
          bitField0_ = (bitField0_ & ~0x00001000);
        }
        result.currentProjectId_ = currentProjectId_;
        if (((from_bitField0_ & 0x00002000) == 0x00002000)) {
          to_bitField0_ |= 0x00000100;
        }
        result.parentType_ = parentType_;
        if (((bitField0_ & 0x00004000) == 0x00004000)) {
          parentUrl_ = new com.google.protobuf.UnmodifiableLazyStringList(
              parentUrl_);
          bitField0_ = (bitField0_ & ~0x00004000);
        }
        result.parentUrl_ = parentUrl_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance()) return this;
        if (titleBuilder_ == null) {
          if (!other.title_.isEmpty()) {
            if (title_.isEmpty()) {
              title_ = other.title_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureTitleIsMutable();
              title_.addAll(other.title_);
            }
            onChanged();
          }
        } else {
          if (!other.title_.isEmpty()) {
            if (titleBuilder_.isEmpty()) {
              titleBuilder_.dispose();
              titleBuilder_ = null;
              title_ = other.title_;
              bitField0_ = (bitField0_ & ~0x00000001);
              titleBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getTitleFieldBuilder() : null;
            } else {
              titleBuilder_.addAllMessages(other.title_);
            }
          }
        }
        if (authorBuilder_ == null) {
          if (!other.author_.isEmpty()) {
            if (author_.isEmpty()) {
              author_ = other.author_;
              bitField0_ = (bitField0_ & ~0x00000002);
            } else {
              ensureAuthorIsMutable();
              author_.addAll(other.author_);
            }
            onChanged();
          }
        } else {
          if (!other.author_.isEmpty()) {
            if (authorBuilder_.isEmpty()) {
              authorBuilder_.dispose();
              authorBuilder_ = null;
              author_ = other.author_;
              bitField0_ = (bitField0_ & ~0x00000002);
              authorBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getAuthorFieldBuilder() : null;
            } else {
              authorBuilder_.addAllMessages(other.author_);
            }
          }
        }
        if (other.hasDoi()) {
          bitField0_ |= 0x00000004;
          doi_ = other.doi_;
          onChanged();
        }
        if (other.hasJournal()) {
          bitField0_ |= 0x00000008;
          journal_ = other.journal_;
          onChanged();
        }
        if (other.hasIsbn()) {
          bitField0_ |= 0x00000010;
          isbn_ = other.isbn_;
          onChanged();
        }
        if (other.hasIssn()) {
          bitField0_ |= 0x00000020;
          issn_ = other.issn_;
          onChanged();
        }
        if (other.hasYear()) {
          bitField0_ |= 0x00000040;
          year_ = other.year_;
          onChanged();
        }
        if (other.hasIssue()) {
          bitField0_ |= 0x00000080;
          issue_ = other.issue_;
          onChanged();
        }
        if (other.hasVolume()) {
          bitField0_ |= 0x00000100;
          volume_ = other.volume_;
          onChanged();
        }
        if (other.hasPages()) {
          bitField0_ |= 0x00000200;
          pages_ = other.pages_;
          onChanged();
        }
        if (classifCodeBuilder_ == null) {
          if (!other.classifCode_.isEmpty()) {
            if (classifCode_.isEmpty()) {
              classifCode_ = other.classifCode_;
              bitField0_ = (bitField0_ & ~0x00000400);
            } else {
              ensureClassifCodeIsMutable();
              classifCode_.addAll(other.classifCode_);
            }
            onChanged();
          }
        } else {
          if (!other.classifCode_.isEmpty()) {
            if (classifCodeBuilder_.isEmpty()) {
              classifCodeBuilder_.dispose();
              classifCodeBuilder_ = null;
              classifCode_ = other.classifCode_;
              bitField0_ = (bitField0_ & ~0x00000400);
              classifCodeBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getClassifCodeFieldBuilder() : null;
            } else {
              classifCodeBuilder_.addAllMessages(other.classifCode_);
            }
          }
        }
        if (!other.parentId_.isEmpty()) {
          if (parentId_.isEmpty()) {
            parentId_ = other.parentId_;
            bitField0_ = (bitField0_ & ~0x00000800);
          } else {
            ensureParentIdIsMutable();
            parentId_.addAll(other.parentId_);
          }
          onChanged();
        }
        if (!other.currentProjectId_.isEmpty()) {
          if (currentProjectId_.isEmpty()) {
            currentProjectId_ = other.currentProjectId_;
            bitField0_ = (bitField0_ & ~0x00001000);
          } else {
            ensureCurrentProjectIdIsMutable();
            currentProjectId_.addAll(other.currentProjectId_);
          }
          onChanged();
        }
        if (other.hasParentType()) {
          setParentType(other.getParentType());
        }
        if (!other.parentUrl_.isEmpty()) {
          if (parentUrl_.isEmpty()) {
            parentUrl_ = other.parentUrl_;
            bitField0_ = (bitField0_ & ~0x00004000);
          } else {
            ensureParentUrlIsMutable();
            parentUrl_.addAll(other.parentUrl_);
          }
          onChanged();
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        for (int i = 0; i < getTitleCount(); i++) {
          if (!getTitle(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getAuthorCount(); i++) {
          if (!getAuthor(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getClassifCodeCount(); i++) {
          if (!getClassifCode(i).isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // repeated .TextWithLanguage title = 1;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> title_ =
        java.util.Collections.emptyList();
      private void ensureTitleIsMutable() {
        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
          title_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage>(title_);
          bitField0_ |= 0x00000001;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> titleBuilder_;

      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> getTitleList() {
        if (titleBuilder_ == null) {
          return java.util.Collections.unmodifiableList(title_);
        } else {
          return titleBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public int getTitleCount() {
        if (titleBuilder_ == null) {
          return title_.size();
        } else {
          return titleBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage getTitle(int index) {
        if (titleBuilder_ == null) {
          return title_.get(index);
        } else {
          return titleBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder setTitle(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage value) {
        if (titleBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTitleIsMutable();
          title_.set(index, value);
          onChanged();
        } else {
          titleBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder setTitle(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder builderForValue) {
        if (titleBuilder_ == null) {
          ensureTitleIsMutable();
          title_.set(index, builderForValue.build());
          onChanged();
        } else {
          titleBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder addTitle(pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage value) {
        if (titleBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTitleIsMutable();
          title_.add(value);
          onChanged();
        } else {
          titleBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder addTitle(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage value) {
        if (titleBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureTitleIsMutable();
          title_.add(index, value);
          onChanged();
        } else {
          titleBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder addTitle(
          pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder builderForValue) {
        if (titleBuilder_ == null) {
          ensureTitleIsMutable();
          title_.add(builderForValue.build());
          onChanged();
        } else {
          titleBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder addTitle(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder builderForValue) {
        if (titleBuilder_ == null) {
          ensureTitleIsMutable();
          title_.add(index, builderForValue.build());
          onChanged();
        } else {
          titleBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder addAllTitle(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> values) {
        if (titleBuilder_ == null) {
          ensureTitleIsMutable();
          super.addAll(values, title_);
          onChanged();
        } else {
          titleBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder clearTitle() {
        if (titleBuilder_ == null) {
          title_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          titleBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public Builder removeTitle(int index) {
        if (titleBuilder_ == null) {
          ensureTitleIsMutable();
          title_.remove(index);
          onChanged();
        } else {
          titleBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder getTitleBuilder(
          int index) {
        return getTitleFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder getTitleOrBuilder(
          int index) {
        if (titleBuilder_ == null) {
          return title_.get(index);  } else {
          return titleBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
           getTitleOrBuilderList() {
        if (titleBuilder_ != null) {
          return titleBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(title_);
        }
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder addTitleBuilder() {
        return getTitleFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.getDefaultInstance());
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder addTitleBuilder(
          int index) {
        return getTitleFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.getDefaultInstance());
      }
      /**
       * <code>repeated .TextWithLanguage title = 1;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder> 
           getTitleBuilderList() {
        return getTitleFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
          getTitleFieldBuilder() {
        if (titleBuilder_ == null) {
          titleBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder>(
                  title_,
                  ((bitField0_ & 0x00000001) == 0x00000001),
                  getParentForChildren(),
                  isClean());
          title_ = null;
        }
        return titleBuilder_;
      }

      // repeated .Author author = 2;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Author> author_ =
        java.util.Collections.emptyList();
      private void ensureAuthorIsMutable() {
        if (!((bitField0_ & 0x00000002) == 0x00000002)) {
          author_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.Author>(author_);
          bitField0_ |= 0x00000002;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.Author, pl.edu.icm.coansys.models.DocumentProtos.Author.Builder, pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder> authorBuilder_;

      /**
       * <code>repeated .Author author = 2;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Author> getAuthorList() {
        if (authorBuilder_ == null) {
          return java.util.Collections.unmodifiableList(author_);
        } else {
          return authorBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public int getAuthorCount() {
        if (authorBuilder_ == null) {
          return author_.size();
        } else {
          return authorBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Author getAuthor(int index) {
        if (authorBuilder_ == null) {
          return author_.get(index);
        } else {
          return authorBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder setAuthor(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Author value) {
        if (authorBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuthorIsMutable();
          author_.set(index, value);
          onChanged();
        } else {
          authorBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder setAuthor(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Author.Builder builderForValue) {
        if (authorBuilder_ == null) {
          ensureAuthorIsMutable();
          author_.set(index, builderForValue.build());
          onChanged();
        } else {
          authorBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder addAuthor(pl.edu.icm.coansys.models.DocumentProtos.Author value) {
        if (authorBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuthorIsMutable();
          author_.add(value);
          onChanged();
        } else {
          authorBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder addAuthor(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Author value) {
        if (authorBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuthorIsMutable();
          author_.add(index, value);
          onChanged();
        } else {
          authorBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder addAuthor(
          pl.edu.icm.coansys.models.DocumentProtos.Author.Builder builderForValue) {
        if (authorBuilder_ == null) {
          ensureAuthorIsMutable();
          author_.add(builderForValue.build());
          onChanged();
        } else {
          authorBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder addAuthor(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Author.Builder builderForValue) {
        if (authorBuilder_ == null) {
          ensureAuthorIsMutable();
          author_.add(index, builderForValue.build());
          onChanged();
        } else {
          authorBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder addAllAuthor(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.Author> values) {
        if (authorBuilder_ == null) {
          ensureAuthorIsMutable();
          super.addAll(values, author_);
          onChanged();
        } else {
          authorBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder clearAuthor() {
        if (authorBuilder_ == null) {
          author_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000002);
          onChanged();
        } else {
          authorBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public Builder removeAuthor(int index) {
        if (authorBuilder_ == null) {
          ensureAuthorIsMutable();
          author_.remove(index);
          onChanged();
        } else {
          authorBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Author.Builder getAuthorBuilder(
          int index) {
        return getAuthorFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder getAuthorOrBuilder(
          int index) {
        if (authorBuilder_ == null) {
          return author_.get(index);  } else {
          return authorBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder> 
           getAuthorOrBuilderList() {
        if (authorBuilder_ != null) {
          return authorBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(author_);
        }
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Author.Builder addAuthorBuilder() {
        return getAuthorFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.Author.getDefaultInstance());
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Author.Builder addAuthorBuilder(
          int index) {
        return getAuthorFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.Author.getDefaultInstance());
      }
      /**
       * <code>repeated .Author author = 2;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Author.Builder> 
           getAuthorBuilderList() {
        return getAuthorFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.Author, pl.edu.icm.coansys.models.DocumentProtos.Author.Builder, pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder> 
          getAuthorFieldBuilder() {
        if (authorBuilder_ == null) {
          authorBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.Author, pl.edu.icm.coansys.models.DocumentProtos.Author.Builder, pl.edu.icm.coansys.models.DocumentProtos.AuthorOrBuilder>(
                  author_,
                  ((bitField0_ & 0x00000002) == 0x00000002),
                  getParentForChildren(),
                  isClean());
          author_ = null;
        }
        return authorBuilder_;
      }

      // optional string doi = 3;
      private java.lang.Object doi_ = "";
      /**
       * <code>optional string doi = 3;</code>
       */
      public boolean hasDoi() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional string doi = 3;</code>
       */
      public java.lang.String getDoi() {
        java.lang.Object ref = doi_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          doi_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string doi = 3;</code>
       */
      public com.google.protobuf.ByteString
          getDoiBytes() {
        java.lang.Object ref = doi_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          doi_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string doi = 3;</code>
       */
      public Builder setDoi(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        doi_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string doi = 3;</code>
       */
      public Builder clearDoi() {
        bitField0_ = (bitField0_ & ~0x00000004);
        doi_ = getDefaultInstance().getDoi();
        onChanged();
        return this;
      }
      /**
       * <code>optional string doi = 3;</code>
       */
      public Builder setDoiBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        doi_ = value;
        onChanged();
        return this;
      }

      // optional string journal = 4;
      private java.lang.Object journal_ = "";
      /**
       * <code>optional string journal = 4;</code>
       *
       * <pre>
       * journal should be treated as parent name
       * </pre>
       */
      public boolean hasJournal() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional string journal = 4;</code>
       *
       * <pre>
       * journal should be treated as parent name
       * </pre>
       */
      public java.lang.String getJournal() {
        java.lang.Object ref = journal_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          journal_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string journal = 4;</code>
       *
       * <pre>
       * journal should be treated as parent name
       * </pre>
       */
      public com.google.protobuf.ByteString
          getJournalBytes() {
        java.lang.Object ref = journal_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          journal_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string journal = 4;</code>
       *
       * <pre>
       * journal should be treated as parent name
       * </pre>
       */
      public Builder setJournal(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        journal_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string journal = 4;</code>
       *
       * <pre>
       * journal should be treated as parent name
       * </pre>
       */
      public Builder clearJournal() {
        bitField0_ = (bitField0_ & ~0x00000008);
        journal_ = getDefaultInstance().getJournal();
        onChanged();
        return this;
      }
      /**
       * <code>optional string journal = 4;</code>
       *
       * <pre>
       * journal should be treated as parent name
       * </pre>
       */
      public Builder setJournalBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        journal_ = value;
        onChanged();
        return this;
      }

      // optional string isbn = 5;
      private java.lang.Object isbn_ = "";
      /**
       * <code>optional string isbn = 5;</code>
       */
      public boolean hasIsbn() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional string isbn = 5;</code>
       */
      public java.lang.String getIsbn() {
        java.lang.Object ref = isbn_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          isbn_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string isbn = 5;</code>
       */
      public com.google.protobuf.ByteString
          getIsbnBytes() {
        java.lang.Object ref = isbn_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          isbn_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string isbn = 5;</code>
       */
      public Builder setIsbn(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        isbn_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string isbn = 5;</code>
       */
      public Builder clearIsbn() {
        bitField0_ = (bitField0_ & ~0x00000010);
        isbn_ = getDefaultInstance().getIsbn();
        onChanged();
        return this;
      }
      /**
       * <code>optional string isbn = 5;</code>
       */
      public Builder setIsbnBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        isbn_ = value;
        onChanged();
        return this;
      }

      // optional string issn = 6;
      private java.lang.Object issn_ = "";
      /**
       * <code>optional string issn = 6;</code>
       */
      public boolean hasIssn() {
        return ((bitField0_ & 0x00000020) == 0x00000020);
      }
      /**
       * <code>optional string issn = 6;</code>
       */
      public java.lang.String getIssn() {
        java.lang.Object ref = issn_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          issn_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string issn = 6;</code>
       */
      public com.google.protobuf.ByteString
          getIssnBytes() {
        java.lang.Object ref = issn_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          issn_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string issn = 6;</code>
       */
      public Builder setIssn(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000020;
        issn_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string issn = 6;</code>
       */
      public Builder clearIssn() {
        bitField0_ = (bitField0_ & ~0x00000020);
        issn_ = getDefaultInstance().getIssn();
        onChanged();
        return this;
      }
      /**
       * <code>optional string issn = 6;</code>
       */
      public Builder setIssnBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000020;
        issn_ = value;
        onChanged();
        return this;
      }

      // optional string year = 7;
      private java.lang.Object year_ = "";
      /**
       * <code>optional string year = 7;</code>
       */
      public boolean hasYear() {
        return ((bitField0_ & 0x00000040) == 0x00000040);
      }
      /**
       * <code>optional string year = 7;</code>
       */
      public java.lang.String getYear() {
        java.lang.Object ref = year_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          year_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string year = 7;</code>
       */
      public com.google.protobuf.ByteString
          getYearBytes() {
        java.lang.Object ref = year_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          year_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string year = 7;</code>
       */
      public Builder setYear(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000040;
        year_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string year = 7;</code>
       */
      public Builder clearYear() {
        bitField0_ = (bitField0_ & ~0x00000040);
        year_ = getDefaultInstance().getYear();
        onChanged();
        return this;
      }
      /**
       * <code>optional string year = 7;</code>
       */
      public Builder setYearBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000040;
        year_ = value;
        onChanged();
        return this;
      }

      // optional string issue = 8;
      private java.lang.Object issue_ = "";
      /**
       * <code>optional string issue = 8;</code>
       */
      public boolean hasIssue() {
        return ((bitField0_ & 0x00000080) == 0x00000080);
      }
      /**
       * <code>optional string issue = 8;</code>
       */
      public java.lang.String getIssue() {
        java.lang.Object ref = issue_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          issue_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string issue = 8;</code>
       */
      public com.google.protobuf.ByteString
          getIssueBytes() {
        java.lang.Object ref = issue_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          issue_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string issue = 8;</code>
       */
      public Builder setIssue(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000080;
        issue_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string issue = 8;</code>
       */
      public Builder clearIssue() {
        bitField0_ = (bitField0_ & ~0x00000080);
        issue_ = getDefaultInstance().getIssue();
        onChanged();
        return this;
      }
      /**
       * <code>optional string issue = 8;</code>
       */
      public Builder setIssueBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000080;
        issue_ = value;
        onChanged();
        return this;
      }

      // optional string volume = 9;
      private java.lang.Object volume_ = "";
      /**
       * <code>optional string volume = 9;</code>
       */
      public boolean hasVolume() {
        return ((bitField0_ & 0x00000100) == 0x00000100);
      }
      /**
       * <code>optional string volume = 9;</code>
       */
      public java.lang.String getVolume() {
        java.lang.Object ref = volume_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          volume_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string volume = 9;</code>
       */
      public com.google.protobuf.ByteString
          getVolumeBytes() {
        java.lang.Object ref = volume_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          volume_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string volume = 9;</code>
       */
      public Builder setVolume(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000100;
        volume_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string volume = 9;</code>
       */
      public Builder clearVolume() {
        bitField0_ = (bitField0_ & ~0x00000100);
        volume_ = getDefaultInstance().getVolume();
        onChanged();
        return this;
      }
      /**
       * <code>optional string volume = 9;</code>
       */
      public Builder setVolumeBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000100;
        volume_ = value;
        onChanged();
        return this;
      }

      // optional string pages = 10;
      private java.lang.Object pages_ = "";
      /**
       * <code>optional string pages = 10;</code>
       */
      public boolean hasPages() {
        return ((bitField0_ & 0x00000200) == 0x00000200);
      }
      /**
       * <code>optional string pages = 10;</code>
       */
      public java.lang.String getPages() {
        java.lang.Object ref = pages_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          pages_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string pages = 10;</code>
       */
      public com.google.protobuf.ByteString
          getPagesBytes() {
        java.lang.Object ref = pages_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          pages_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string pages = 10;</code>
       */
      public Builder setPages(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000200;
        pages_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string pages = 10;</code>
       */
      public Builder clearPages() {
        bitField0_ = (bitField0_ & ~0x00000200);
        pages_ = getDefaultInstance().getPages();
        onChanged();
        return this;
      }
      /**
       * <code>optional string pages = 10;</code>
       */
      public Builder setPagesBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000200;
        pages_ = value;
        onChanged();
        return this;
      }

      // repeated .ClassifCode classifCode = 11;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode> classifCode_ =
        java.util.Collections.emptyList();
      private void ensureClassifCodeIsMutable() {
        if (!((bitField0_ & 0x00000400) == 0x00000400)) {
          classifCode_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode>(classifCode_);
          bitField0_ |= 0x00000400;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ClassifCode, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder, pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder> classifCodeBuilder_;

      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode> getClassifCodeList() {
        if (classifCodeBuilder_ == null) {
          return java.util.Collections.unmodifiableList(classifCode_);
        } else {
          return classifCodeBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public int getClassifCodeCount() {
        if (classifCodeBuilder_ == null) {
          return classifCode_.size();
        } else {
          return classifCodeBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode getClassifCode(int index) {
        if (classifCodeBuilder_ == null) {
          return classifCode_.get(index);
        } else {
          return classifCodeBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder setClassifCode(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode value) {
        if (classifCodeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureClassifCodeIsMutable();
          classifCode_.set(index, value);
          onChanged();
        } else {
          classifCodeBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder setClassifCode(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder builderForValue) {
        if (classifCodeBuilder_ == null) {
          ensureClassifCodeIsMutable();
          classifCode_.set(index, builderForValue.build());
          onChanged();
        } else {
          classifCodeBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder addClassifCode(pl.edu.icm.coansys.models.DocumentProtos.ClassifCode value) {
        if (classifCodeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureClassifCodeIsMutable();
          classifCode_.add(value);
          onChanged();
        } else {
          classifCodeBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder addClassifCode(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode value) {
        if (classifCodeBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureClassifCodeIsMutable();
          classifCode_.add(index, value);
          onChanged();
        } else {
          classifCodeBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder addClassifCode(
          pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder builderForValue) {
        if (classifCodeBuilder_ == null) {
          ensureClassifCodeIsMutable();
          classifCode_.add(builderForValue.build());
          onChanged();
        } else {
          classifCodeBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder addClassifCode(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder builderForValue) {
        if (classifCodeBuilder_ == null) {
          ensureClassifCodeIsMutable();
          classifCode_.add(index, builderForValue.build());
          onChanged();
        } else {
          classifCodeBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder addAllClassifCode(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.ClassifCode> values) {
        if (classifCodeBuilder_ == null) {
          ensureClassifCodeIsMutable();
          super.addAll(values, classifCode_);
          onChanged();
        } else {
          classifCodeBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder clearClassifCode() {
        if (classifCodeBuilder_ == null) {
          classifCode_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000400);
          onChanged();
        } else {
          classifCodeBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public Builder removeClassifCode(int index) {
        if (classifCodeBuilder_ == null) {
          ensureClassifCodeIsMutable();
          classifCode_.remove(index);
          onChanged();
        } else {
          classifCodeBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder getClassifCodeBuilder(
          int index) {
        return getClassifCodeFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder getClassifCodeOrBuilder(
          int index) {
        if (classifCodeBuilder_ == null) {
          return classifCode_.get(index);  } else {
          return classifCodeBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder> 
           getClassifCodeOrBuilderList() {
        if (classifCodeBuilder_ != null) {
          return classifCodeBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(classifCode_);
        }
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder addClassifCodeBuilder() {
        return getClassifCodeFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.getDefaultInstance());
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder addClassifCodeBuilder(
          int index) {
        return getClassifCodeFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.getDefaultInstance());
      }
      /**
       * <code>repeated .ClassifCode classifCode = 11;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder> 
           getClassifCodeBuilderList() {
        return getClassifCodeFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ClassifCode, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder, pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder> 
          getClassifCodeFieldBuilder() {
        if (classifCodeBuilder_ == null) {
          classifCodeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ClassifCode, pl.edu.icm.coansys.models.DocumentProtos.ClassifCode.Builder, pl.edu.icm.coansys.models.DocumentProtos.ClassifCodeOrBuilder>(
                  classifCode_,
                  ((bitField0_ & 0x00000400) == 0x00000400),
                  getParentForChildren(),
                  isClean());
          classifCode_ = null;
        }
        return classifCodeBuilder_;
      }

      // repeated string parentId = 12;
      private com.google.protobuf.LazyStringList parentId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureParentIdIsMutable() {
        if (!((bitField0_ & 0x00000800) == 0x00000800)) {
          parentId_ = new com.google.protobuf.LazyStringArrayList(parentId_);
          bitField0_ |= 0x00000800;
         }
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public java.util.List<java.lang.String>
          getParentIdList() {
        return java.util.Collections.unmodifiableList(parentId_);
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public int getParentIdCount() {
        return parentId_.size();
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public java.lang.String getParentId(int index) {
        return parentId_.get(index);
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public com.google.protobuf.ByteString
          getParentIdBytes(int index) {
        return parentId_.getByteString(index);
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public Builder setParentId(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureParentIdIsMutable();
        parentId_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public Builder addParentId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureParentIdIsMutable();
        parentId_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public Builder addAllParentId(
          java.lang.Iterable<java.lang.String> values) {
        ensureParentIdIsMutable();
        super.addAll(values, parentId_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public Builder clearParentId() {
        parentId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000800);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentId = 12;</code>
       */
      public Builder addParentIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureParentIdIsMutable();
        parentId_.add(value);
        onChanged();
        return this;
      }

      // repeated string currentProjectId = 13;
      private com.google.protobuf.LazyStringList currentProjectId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureCurrentProjectIdIsMutable() {
        if (!((bitField0_ & 0x00001000) == 0x00001000)) {
          currentProjectId_ = new com.google.protobuf.LazyStringArrayList(currentProjectId_);
          bitField0_ |= 0x00001000;
         }
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public java.util.List<java.lang.String>
          getCurrentProjectIdList() {
        return java.util.Collections.unmodifiableList(currentProjectId_);
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public int getCurrentProjectIdCount() {
        return currentProjectId_.size();
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public java.lang.String getCurrentProjectId(int index) {
        return currentProjectId_.get(index);
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public com.google.protobuf.ByteString
          getCurrentProjectIdBytes(int index) {
        return currentProjectId_.getByteString(index);
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public Builder setCurrentProjectId(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureCurrentProjectIdIsMutable();
        currentProjectId_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public Builder addCurrentProjectId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureCurrentProjectIdIsMutable();
        currentProjectId_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public Builder addAllCurrentProjectId(
          java.lang.Iterable<java.lang.String> values) {
        ensureCurrentProjectIdIsMutable();
        super.addAll(values, currentProjectId_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public Builder clearCurrentProjectId() {
        currentProjectId_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00001000);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string currentProjectId = 13;</code>
       */
      public Builder addCurrentProjectIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureCurrentProjectIdIsMutable();
        currentProjectId_.add(value);
        onChanged();
        return this;
      }

      // optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];
      private pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType parentType_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType.JOURNAL;
      /**
       * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
       */
      public boolean hasParentType() {
        return ((bitField0_ & 0x00002000) == 0x00002000);
      }
      /**
       * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType getParentType() {
        return parentType_;
      }
      /**
       * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
       */
      public Builder setParentType(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00002000;
        parentType_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional .BasicMetadata.ParentType parentType = 14 [default = JOURNAL];</code>
       */
      public Builder clearParentType() {
        bitField0_ = (bitField0_ & ~0x00002000);
        parentType_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.ParentType.JOURNAL;
        onChanged();
        return this;
      }

      // repeated string parentUrl = 15;
      private com.google.protobuf.LazyStringList parentUrl_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureParentUrlIsMutable() {
        if (!((bitField0_ & 0x00004000) == 0x00004000)) {
          parentUrl_ = new com.google.protobuf.LazyStringArrayList(parentUrl_);
          bitField0_ |= 0x00004000;
         }
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public java.util.List<java.lang.String>
          getParentUrlList() {
        return java.util.Collections.unmodifiableList(parentUrl_);
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public int getParentUrlCount() {
        return parentUrl_.size();
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public java.lang.String getParentUrl(int index) {
        return parentUrl_.get(index);
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public com.google.protobuf.ByteString
          getParentUrlBytes(int index) {
        return parentUrl_.getByteString(index);
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public Builder setParentUrl(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureParentUrlIsMutable();
        parentUrl_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public Builder addParentUrl(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureParentUrlIsMutable();
        parentUrl_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public Builder addAllParentUrl(
          java.lang.Iterable<java.lang.String> values) {
        ensureParentUrlIsMutable();
        super.addAll(values, parentUrl_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public Builder clearParentUrl() {
        parentUrl_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00004000);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string parentUrl = 15;</code>
       */
      public Builder addParentUrlBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureParentUrlIsMutable();
        parentUrl_.add(value);
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:BasicMetadata)
    }

    static {
      defaultInstance = new BasicMetadata(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:BasicMetadata)
  }

  public interface KeywordsListOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // optional string type = 1;
    /**
     * <code>optional string type = 1;</code>
     */
    boolean hasType();
    /**
     * <code>optional string type = 1;</code>
     */
    java.lang.String getType();
    /**
     * <code>optional string type = 1;</code>
     */
    com.google.protobuf.ByteString
        getTypeBytes();

    // optional string language = 2;
    /**
     * <code>optional string language = 2;</code>
     */
    boolean hasLanguage();
    /**
     * <code>optional string language = 2;</code>
     */
    java.lang.String getLanguage();
    /**
     * <code>optional string language = 2;</code>
     */
    com.google.protobuf.ByteString
        getLanguageBytes();

    // repeated string keywords = 3;
    /**
     * <code>repeated string keywords = 3;</code>
     */
    java.util.List<java.lang.String>
    getKeywordsList();
    /**
     * <code>repeated string keywords = 3;</code>
     */
    int getKeywordsCount();
    /**
     * <code>repeated string keywords = 3;</code>
     */
    java.lang.String getKeywords(int index);
    /**
     * <code>repeated string keywords = 3;</code>
     */
    com.google.protobuf.ByteString
        getKeywordsBytes(int index);

    // optional string comment = 4;
    /**
     * <code>optional string comment = 4;</code>
     */
    boolean hasComment();
    /**
     * <code>optional string comment = 4;</code>
     */
    java.lang.String getComment();
    /**
     * <code>optional string comment = 4;</code>
     */
    com.google.protobuf.ByteString
        getCommentBytes();

    // optional .ProvenanceInfo provenance = 5;
    /**
     * <code>optional .ProvenanceInfo provenance = 5;</code>
     */
    boolean hasProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 5;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 5;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder();
  }
  /**
   * Protobuf type {@code KeywordsList}
   */
  public static final class KeywordsList extends
      com.google.protobuf.GeneratedMessage
      implements KeywordsListOrBuilder {
    // Use KeywordsList.newBuilder() to construct.
    private KeywordsList(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private KeywordsList(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final KeywordsList defaultInstance;
    public static KeywordsList getDefaultInstance() {
      return defaultInstance;
    }

    public KeywordsList getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private KeywordsList(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              type_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              language_ = input.readBytes();
              break;
            }
            case 26: {
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                keywords_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000004;
              }
              keywords_.add(input.readBytes());
              break;
            }
            case 34: {
              bitField0_ |= 0x00000004;
              comment_ = input.readBytes();
              break;
            }
            case 42: {
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder subBuilder = null;
              if (((bitField0_ & 0x00000008) == 0x00000008)) {
                subBuilder = provenance_.toBuilder();
              }
              provenance_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(provenance_);
                provenance_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000008;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
          keywords_ = new com.google.protobuf.UnmodifiableLazyStringList(keywords_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeywordsList_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeywordsList_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.class, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder.class);
    }

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

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

    private int bitField0_;
    // optional string type = 1;
    public static final int TYPE_FIELD_NUMBER = 1;
    private java.lang.Object type_;
    /**
     * <code>optional string type = 1;</code>
     */
    public boolean hasType() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>optional string type = 1;</code>
     */
    public java.lang.String getType() {
      java.lang.Object ref = type_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          type_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string type = 1;</code>
     */
    public com.google.protobuf.ByteString
        getTypeBytes() {
      java.lang.Object ref = type_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        type_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string language = 2;
    public static final int LANGUAGE_FIELD_NUMBER = 2;
    private java.lang.Object language_;
    /**
     * <code>optional string language = 2;</code>
     */
    public boolean hasLanguage() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional string language = 2;</code>
     */
    public java.lang.String getLanguage() {
      java.lang.Object ref = language_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          language_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string language = 2;</code>
     */
    public com.google.protobuf.ByteString
        getLanguageBytes() {
      java.lang.Object ref = language_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        language_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // repeated string keywords = 3;
    public static final int KEYWORDS_FIELD_NUMBER = 3;
    private com.google.protobuf.LazyStringList keywords_;
    /**
     * <code>repeated string keywords = 3;</code>
     */
    public java.util.List<java.lang.String>
        getKeywordsList() {
      return keywords_;
    }
    /**
     * <code>repeated string keywords = 3;</code>
     */
    public int getKeywordsCount() {
      return keywords_.size();
    }
    /**
     * <code>repeated string keywords = 3;</code>
     */
    public java.lang.String getKeywords(int index) {
      return keywords_.get(index);
    }
    /**
     * <code>repeated string keywords = 3;</code>
     */
    public com.google.protobuf.ByteString
        getKeywordsBytes(int index) {
      return keywords_.getByteString(index);
    }

    // optional string comment = 4;
    public static final int COMMENT_FIELD_NUMBER = 4;
    private java.lang.Object comment_;
    /**
     * <code>optional string comment = 4;</code>
     */
    public boolean hasComment() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional string comment = 4;</code>
     */
    public java.lang.String getComment() {
      java.lang.Object ref = comment_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          comment_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string comment = 4;</code>
     */
    public com.google.protobuf.ByteString
        getCommentBytes() {
      java.lang.Object ref = comment_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        comment_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional .ProvenanceInfo provenance = 5;
    public static final int PROVENANCE_FIELD_NUMBER = 5;
    private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_;
    /**
     * <code>optional .ProvenanceInfo provenance = 5;</code>
     */
    public boolean hasProvenance() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 5;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
      return provenance_;
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 5;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
      return provenance_;
    }

    private void initFields() {
      type_ = "";
      language_ = "";
      keywords_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      comment_ = "";
      provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (hasProvenance()) {
        if (!getProvenance().isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getTypeBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getLanguageBytes());
      }
      for (int i = 0; i < keywords_.size(); i++) {
        output.writeBytes(3, keywords_.getByteString(i));
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(4, getCommentBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeMessage(5, provenance_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getTypeBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getLanguageBytes());
      }
      {
        int dataSize = 0;
        for (int i = 0; i < keywords_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(keywords_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getKeywordsList().size();
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(4, getCommentBytes());
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, provenance_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.KeywordsList prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code KeywordsList}
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeywordsList_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeywordsList_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.class, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getProvenanceFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        type_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        language_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        keywords_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        comment_ = "";
        bitField0_ = (bitField0_ & ~0x00000008);
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000010);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_KeywordsList_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList build() {
        pl.edu.icm.coansys.models.DocumentProtos.KeywordsList result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.KeywordsList result = new pl.edu.icm.coansys.models.DocumentProtos.KeywordsList(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.type_ = type_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.language_ = language_;
        if (((bitField0_ & 0x00000004) == 0x00000004)) {
          keywords_ = new com.google.protobuf.UnmodifiableLazyStringList(
              keywords_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.keywords_ = keywords_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000004;
        }
        result.comment_ = comment_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000008;
        }
        if (provenanceBuilder_ == null) {
          result.provenance_ = provenance_;
        } else {
          result.provenance_ = provenanceBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.KeywordsList) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.KeywordsList)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.KeywordsList other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.getDefaultInstance()) return this;
        if (other.hasType()) {
          bitField0_ |= 0x00000001;
          type_ = other.type_;
          onChanged();
        }
        if (other.hasLanguage()) {
          bitField0_ |= 0x00000002;
          language_ = other.language_;
          onChanged();
        }
        if (!other.keywords_.isEmpty()) {
          if (keywords_.isEmpty()) {
            keywords_ = other.keywords_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensureKeywordsIsMutable();
            keywords_.addAll(other.keywords_);
          }
          onChanged();
        }
        if (other.hasComment()) {
          bitField0_ |= 0x00000008;
          comment_ = other.comment_;
          onChanged();
        }
        if (other.hasProvenance()) {
          mergeProvenance(other.getProvenance());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (hasProvenance()) {
          if (!getProvenance().isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.KeywordsList parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.KeywordsList) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // optional string type = 1;
      private java.lang.Object type_ = "";
      /**
       * <code>optional string type = 1;</code>
       */
      public boolean hasType() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>optional string type = 1;</code>
       */
      public java.lang.String getType() {
        java.lang.Object ref = type_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          type_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string type = 1;</code>
       */
      public com.google.protobuf.ByteString
          getTypeBytes() {
        java.lang.Object ref = type_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          type_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string type = 1;</code>
       */
      public Builder setType(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        type_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string type = 1;</code>
       */
      public Builder clearType() {
        bitField0_ = (bitField0_ & ~0x00000001);
        type_ = getDefaultInstance().getType();
        onChanged();
        return this;
      }
      /**
       * <code>optional string type = 1;</code>
       */
      public Builder setTypeBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        type_ = value;
        onChanged();
        return this;
      }

      // optional string language = 2;
      private java.lang.Object language_ = "";
      /**
       * <code>optional string language = 2;</code>
       */
      public boolean hasLanguage() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public java.lang.String getLanguage() {
        java.lang.Object ref = language_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          language_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public com.google.protobuf.ByteString
          getLanguageBytes() {
        java.lang.Object ref = language_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          language_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public Builder setLanguage(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        language_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public Builder clearLanguage() {
        bitField0_ = (bitField0_ & ~0x00000002);
        language_ = getDefaultInstance().getLanguage();
        onChanged();
        return this;
      }
      /**
       * <code>optional string language = 2;</code>
       */
      public Builder setLanguageBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        language_ = value;
        onChanged();
        return this;
      }

      // repeated string keywords = 3;
      private com.google.protobuf.LazyStringList keywords_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureKeywordsIsMutable() {
        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
          keywords_ = new com.google.protobuf.LazyStringArrayList(keywords_);
          bitField0_ |= 0x00000004;
         }
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public java.util.List<java.lang.String>
          getKeywordsList() {
        return java.util.Collections.unmodifiableList(keywords_);
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public int getKeywordsCount() {
        return keywords_.size();
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public java.lang.String getKeywords(int index) {
        return keywords_.get(index);
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public com.google.protobuf.ByteString
          getKeywordsBytes(int index) {
        return keywords_.getByteString(index);
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public Builder setKeywords(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureKeywordsIsMutable();
        keywords_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public Builder addKeywords(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureKeywordsIsMutable();
        keywords_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public Builder addAllKeywords(
          java.lang.Iterable<java.lang.String> values) {
        ensureKeywordsIsMutable();
        super.addAll(values, keywords_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public Builder clearKeywords() {
        keywords_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string keywords = 3;</code>
       */
      public Builder addKeywordsBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureKeywordsIsMutable();
        keywords_.add(value);
        onChanged();
        return this;
      }

      // optional string comment = 4;
      private java.lang.Object comment_ = "";
      /**
       * <code>optional string comment = 4;</code>
       */
      public boolean hasComment() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional string comment = 4;</code>
       */
      public java.lang.String getComment() {
        java.lang.Object ref = comment_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          comment_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string comment = 4;</code>
       */
      public com.google.protobuf.ByteString
          getCommentBytes() {
        java.lang.Object ref = comment_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          comment_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string comment = 4;</code>
       */
      public Builder setComment(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        comment_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string comment = 4;</code>
       */
      public Builder clearComment() {
        bitField0_ = (bitField0_ & ~0x00000008);
        comment_ = getDefaultInstance().getComment();
        onChanged();
        return this;
      }
      /**
       * <code>optional string comment = 4;</code>
       */
      public Builder setCommentBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        comment_ = value;
        onChanged();
        return this;
      }

      // optional .ProvenanceInfo provenance = 5;
      private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> provenanceBuilder_;
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public boolean hasProvenance() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
        if (provenanceBuilder_ == null) {
          return provenance_;
        } else {
          return provenanceBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public Builder setProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          provenance_ = value;
          onChanged();
        } else {
          provenanceBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public Builder setProvenance(
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder builderForValue) {
        if (provenanceBuilder_ == null) {
          provenance_ = builderForValue.build();
          onChanged();
        } else {
          provenanceBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public Builder mergeProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (((bitField0_ & 0x00000010) == 0x00000010) &&
              provenance_ != pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance()) {
            provenance_ =
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.newBuilder(provenance_).mergeFrom(value).buildPartial();
          } else {
            provenance_ = value;
          }
          onChanged();
        } else {
          provenanceBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000010;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public Builder clearProvenance() {
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
          onChanged();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000010);
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder getProvenanceBuilder() {
        bitField0_ |= 0x00000010;
        onChanged();
        return getProvenanceFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
        if (provenanceBuilder_ != null) {
          return provenanceBuilder_.getMessageOrBuilder();
        } else {
          return provenance_;
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 5;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> 
          getProvenanceFieldBuilder() {
        if (provenanceBuilder_ == null) {
          provenanceBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder>(
                  provenance_,
                  getParentForChildren(),
                  isClean());
          provenance_ = null;
        }
        return provenanceBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:KeywordsList)
    }

    static {
      defaultInstance = new KeywordsList(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:KeywordsList)
  }

  public interface DocumentMetadataOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string key = 1;
    /**
     * <code>required string key = 1;</code>
     */
    boolean hasKey();
    /**
     * <code>required string key = 1;</code>
     */
    java.lang.String getKey();
    /**
     * <code>required string key = 1;</code>
     */
    com.google.protobuf.ByteString
        getKeyBytes();

    // required .BasicMetadata basicMetadata = 2;
    /**
     * <code>required .BasicMetadata basicMetadata = 2;</code>
     */
    boolean hasBasicMetadata();
    /**
     * <code>required .BasicMetadata basicMetadata = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata getBasicMetadata();
    /**
     * <code>required .BasicMetadata basicMetadata = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder getBasicMetadataOrBuilder();

    // repeated .TextWithLanguage documentAbstract = 3;
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> 
        getDocumentAbstractList();
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage getDocumentAbstract(int index);
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    int getDocumentAbstractCount();
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
        getDocumentAbstractOrBuilderList();
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder getDocumentAbstractOrBuilder(
        int index);

    // repeated .KeywordsList keywords = 10;
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList> 
        getKeywordsList();
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeywordsList getKeywords(int index);
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    int getKeywordsCount();
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder> 
        getKeywordsOrBuilderList();
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder getKeywordsOrBuilder(
        int index);

    // repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo> 
        getSimilarDocumentInfoList();
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo getSimilarDocumentInfo(int index);
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    int getSimilarDocumentInfoCount();
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder> 
        getSimilarDocumentInfoOrBuilderList();
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder getSimilarDocumentInfoOrBuilder(
        int index);

    // repeated .KeyValue extId = 5;
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> 
        getExtIdList();
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index);
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    int getExtIdCount();
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getExtIdOrBuilderList();
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
        int index);

    // repeated .KeyValue auxiliarInfo = 6;
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> 
        getAuxiliarInfoList();
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAuxiliarInfo(int index);
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    int getAuxiliarInfoCount();
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getAuxiliarInfoOrBuilderList();
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAuxiliarInfoOrBuilder(
        int index);

    // repeated .Affiliation affiliations = 12;
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Affiliation> 
        getAffiliationsList();
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.Affiliation getAffiliations(int index);
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    int getAffiliationsCount();
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder> 
        getAffiliationsOrBuilderList();
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder getAffiliationsOrBuilder(
        int index);

    // repeated .ReferenceMetadata reference = 7;
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata> 
        getReferenceList();
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata getReference(int index);
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    int getReferenceCount();
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder> 
        getReferenceOrBuilderList();
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder getReferenceOrBuilder(
        int index);

    // repeated string collection = 8;
    /**
     * <code>repeated string collection = 8;</code>
     */
    java.util.List<java.lang.String>
    getCollectionList();
    /**
     * <code>repeated string collection = 8;</code>
     */
    int getCollectionCount();
    /**
     * <code>repeated string collection = 8;</code>
     */
    java.lang.String getCollection(int index);
    /**
     * <code>repeated string collection = 8;</code>
     */
    com.google.protobuf.ByteString
        getCollectionBytes(int index);

    // optional string sourcePath = 9;
    /**
     * <code>optional string sourcePath = 9;</code>
     */
    boolean hasSourcePath();
    /**
     * <code>optional string sourcePath = 9;</code>
     */
    java.lang.String getSourcePath();
    /**
     * <code>optional string sourcePath = 9;</code>
     */
    com.google.protobuf.ByteString
        getSourcePathBytes();

    // repeated string origKey = 11;
    /**
     * <code>repeated string origKey = 11;</code>
     */
    java.util.List<java.lang.String>
    getOrigKeyList();
    /**
     * <code>repeated string origKey = 11;</code>
     */
    int getOrigKeyCount();
    /**
     * <code>repeated string origKey = 11;</code>
     */
    java.lang.String getOrigKey(int index);
    /**
     * <code>repeated string origKey = 11;</code>
     */
    com.google.protobuf.ByteString
        getOrigKeyBytes(int index);

    // optional .DocumentMetadata.Type type = 21 [default = ARTICLE];
    /**
     * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
     */
    boolean hasType();
    /**
     * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type getType();
  }
  /**
   * Protobuf type {@code DocumentMetadata}
   *
   * <pre>
   * key -- a hash based on title, authors' names, year, abstract, issn, issue, pages, volume (name based UUID, type 3)
   * (see pl.edu.icm.coansys.parsers.MetadataToProtoMetadataParserImpl.calculateDocKey())
   * collection -- a collection name, usually a publisher name or if data is harvester from the web, a collection can be an URL
   * sourcePath -- additional info about a location from which the data was imported
   * </pre>
   */
  public static final class DocumentMetadata extends
      com.google.protobuf.GeneratedMessage
      implements DocumentMetadataOrBuilder {
    // Use DocumentMetadata.newBuilder() to construct.
    private DocumentMetadata(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private DocumentMetadata(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final DocumentMetadata defaultInstance;
    public static DocumentMetadata getDefaultInstance() {
      return defaultInstance;
    }

    public DocumentMetadata getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private DocumentMetadata(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              key_ = input.readBytes();
              break;
            }
            case 18: {
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder subBuilder = null;
              if (((bitField0_ & 0x00000002) == 0x00000002)) {
                subBuilder = basicMetadata_.toBuilder();
              }
              basicMetadata_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(basicMetadata_);
                basicMetadata_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000002;
              break;
            }
            case 26: {
              if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
                documentAbstract_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage>();
                mutable_bitField0_ |= 0x00000004;
              }
              documentAbstract_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.PARSER, extensionRegistry));
              break;
            }
            case 42: {
              if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
                extId_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>();
                mutable_bitField0_ |= 0x00000020;
              }
              extId_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.KeyValue.PARSER, extensionRegistry));
              break;
            }
            case 50: {
              if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
                auxiliarInfo_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>();
                mutable_bitField0_ |= 0x00000040;
              }
              auxiliarInfo_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.KeyValue.PARSER, extensionRegistry));
              break;
            }
            case 58: {
              if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
                reference_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata>();
                mutable_bitField0_ |= 0x00000100;
              }
              reference_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.PARSER, extensionRegistry));
              break;
            }
            case 66: {
              if (!((mutable_bitField0_ & 0x00000200) == 0x00000200)) {
                collection_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000200;
              }
              collection_.add(input.readBytes());
              break;
            }
            case 74: {
              bitField0_ |= 0x00000004;
              sourcePath_ = input.readBytes();
              break;
            }
            case 82: {
              if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
                keywords_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList>();
                mutable_bitField0_ |= 0x00000008;
              }
              keywords_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.PARSER, extensionRegistry));
              break;
            }
            case 90: {
              if (!((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
                origKey_ = new com.google.protobuf.LazyStringArrayList();
                mutable_bitField0_ |= 0x00000800;
              }
              origKey_.add(input.readBytes());
              break;
            }
            case 98: {
              if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
                affiliations_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.Affiliation>();
                mutable_bitField0_ |= 0x00000080;
              }
              affiliations_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.Affiliation.PARSER, extensionRegistry));
              break;
            }
            case 162: {
              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
                similarDocumentInfo_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo>();
                mutable_bitField0_ |= 0x00000010;
              }
              similarDocumentInfo_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.PARSER, extensionRegistry));
              break;
            }
            case 168: {
              int rawValue = input.readEnum();
              pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type value = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type.valueOf(rawValue);
              if (value == null) {
                unknownFields.mergeVarintField(21, rawValue);
              } else {
                bitField0_ |= 0x00000008;
                type_ = value;
              }
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
          documentAbstract_ = java.util.Collections.unmodifiableList(documentAbstract_);
        }
        if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) {
          extId_ = java.util.Collections.unmodifiableList(extId_);
        }
        if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) {
          auxiliarInfo_ = java.util.Collections.unmodifiableList(auxiliarInfo_);
        }
        if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) {
          reference_ = java.util.Collections.unmodifiableList(reference_);
        }
        if (((mutable_bitField0_ & 0x00000200) == 0x00000200)) {
          collection_ = new com.google.protobuf.UnmodifiableLazyStringList(collection_);
        }
        if (((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
          keywords_ = java.util.Collections.unmodifiableList(keywords_);
        }
        if (((mutable_bitField0_ & 0x00000800) == 0x00000800)) {
          origKey_ = new com.google.protobuf.UnmodifiableLazyStringList(origKey_);
        }
        if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) {
          affiliations_ = java.util.Collections.unmodifiableList(affiliations_);
        }
        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
          similarDocumentInfo_ = java.util.Collections.unmodifiableList(similarDocumentInfo_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentMetadata_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentMetadata_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.class, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder.class);
    }

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

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

    /**
     * Protobuf enum {@code DocumentMetadata.Type}
     */
    public enum Type
        implements com.google.protobuf.ProtocolMessageEnum {
      /**
       * <code>ARTICLE = 0;</code>
       */
      ARTICLE(0, 0),
      /**
       * <code>BOOK = 1;</code>
       */
      BOOK(1, 1),
      /**
       * <code>DATASET = 2;</code>
       */
      DATASET(2, 2),
      /**
       * <code>BLOG_ENTRY = 3;</code>
       */
      BLOG_ENTRY(3, 3),
      ;

      /**
       * <code>ARTICLE = 0;</code>
       */
      public static final int ARTICLE_VALUE = 0;
      /**
       * <code>BOOK = 1;</code>
       */
      public static final int BOOK_VALUE = 1;
      /**
       * <code>DATASET = 2;</code>
       */
      public static final int DATASET_VALUE = 2;
      /**
       * <code>BLOG_ENTRY = 3;</code>
       */
      public static final int BLOG_ENTRY_VALUE = 3;


      public final int getNumber() { return value; }

      public static Type valueOf(int value) {
        switch (value) {
          case 0: return ARTICLE;
          case 1: return BOOK;
          case 2: return DATASET;
          case 3: return BLOG_ENTRY;
          default: return null;
        }
      }

      public static com.google.protobuf.Internal.EnumLiteMap<Type>
          internalGetValueMap() {
        return internalValueMap;
      }
      private static com.google.protobuf.Internal.EnumLiteMap<Type>
          internalValueMap =
            new com.google.protobuf.Internal.EnumLiteMap<Type>() {
              public Type findValueByNumber(int number) {
                return Type.valueOf(number);
              }
            };

      public final com.google.protobuf.Descriptors.EnumValueDescriptor
          getValueDescriptor() {
        return getDescriptor().getValues().get(index);
      }
      public final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptorForType() {
        return getDescriptor();
      }
      public static final com.google.protobuf.Descriptors.EnumDescriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDescriptor().getEnumTypes().get(0);
      }

      private static final Type[] VALUES = values();

      public static Type valueOf(
          com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
        if (desc.getType() != getDescriptor()) {
          throw new java.lang.IllegalArgumentException(
            "EnumValueDescriptor is not for this type.");
        }
        return VALUES[desc.getIndex()];
      }

      private final int index;
      private final int value;

      private Type(int index, int value) {
        this.index = index;
        this.value = value;
      }

      // @@protoc_insertion_point(enum_scope:DocumentMetadata.Type)
    }

    private int bitField0_;
    // required string key = 1;
    public static final int KEY_FIELD_NUMBER = 1;
    private java.lang.Object key_;
    /**
     * <code>required string key = 1;</code>
     */
    public boolean hasKey() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string key = 1;</code>
     */
    public java.lang.String getKey() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          key_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string key = 1;</code>
     */
    public com.google.protobuf.ByteString
        getKeyBytes() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        key_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required .BasicMetadata basicMetadata = 2;
    public static final int BASICMETADATA_FIELD_NUMBER = 2;
    private pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata basicMetadata_;
    /**
     * <code>required .BasicMetadata basicMetadata = 2;</code>
     */
    public boolean hasBasicMetadata() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required .BasicMetadata basicMetadata = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata getBasicMetadata() {
      return basicMetadata_;
    }
    /**
     * <code>required .BasicMetadata basicMetadata = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder getBasicMetadataOrBuilder() {
      return basicMetadata_;
    }

    // repeated .TextWithLanguage documentAbstract = 3;
    public static final int DOCUMENTABSTRACT_FIELD_NUMBER = 3;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> documentAbstract_;
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> getDocumentAbstractList() {
      return documentAbstract_;
    }
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
        getDocumentAbstractOrBuilderList() {
      return documentAbstract_;
    }
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    public int getDocumentAbstractCount() {
      return documentAbstract_.size();
    }
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage getDocumentAbstract(int index) {
      return documentAbstract_.get(index);
    }
    /**
     * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder getDocumentAbstractOrBuilder(
        int index) {
      return documentAbstract_.get(index);
    }

    // repeated .KeywordsList keywords = 10;
    public static final int KEYWORDS_FIELD_NUMBER = 10;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList> keywords_;
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList> getKeywordsList() {
      return keywords_;
    }
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder> 
        getKeywordsOrBuilderList() {
      return keywords_;
    }
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    public int getKeywordsCount() {
      return keywords_.size();
    }
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList getKeywords(int index) {
      return keywords_.get(index);
    }
    /**
     * <code>repeated .KeywordsList keywords = 10;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder getKeywordsOrBuilder(
        int index) {
      return keywords_.get(index);
    }

    // repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;
    public static final int SIMILARDOCUMENTINFO_FIELD_NUMBER = 20;
    private java.util.List<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo> similarDocumentInfo_;
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo> getSimilarDocumentInfoList() {
      return similarDocumentInfo_;
    }
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder> 
        getSimilarDocumentInfoOrBuilderList() {
      return similarDocumentInfo_;
    }
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    public int getSimilarDocumentInfoCount() {
      return similarDocumentInfo_.size();
    }
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    public pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo getSimilarDocumentInfo(int index) {
      return similarDocumentInfo_.get(index);
    }
    /**
     * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
     */
    public pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder getSimilarDocumentInfoOrBuilder(
        int index) {
      return similarDocumentInfo_.get(index);
    }

    // repeated .KeyValue extId = 5;
    public static final int EXTID_FIELD_NUMBER = 5;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> extId_;
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getExtIdList() {
      return extId_;
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getExtIdOrBuilderList() {
      return extId_;
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public int getExtIdCount() {
      return extId_.size();
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index) {
      return extId_.get(index);
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
        int index) {
      return extId_.get(index);
    }

    // repeated .KeyValue auxiliarInfo = 6;
    public static final int AUXILIARINFO_FIELD_NUMBER = 6;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> auxiliarInfo_;
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getAuxiliarInfoList() {
      return auxiliarInfo_;
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getAuxiliarInfoOrBuilderList() {
      return auxiliarInfo_;
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    public int getAuxiliarInfoCount() {
      return auxiliarInfo_.size();
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAuxiliarInfo(int index) {
      return auxiliarInfo_.get(index);
    }
    /**
     * <code>repeated .KeyValue auxiliarInfo = 6;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAuxiliarInfoOrBuilder(
        int index) {
      return auxiliarInfo_.get(index);
    }

    // repeated .Affiliation affiliations = 12;
    public static final int AFFILIATIONS_FIELD_NUMBER = 12;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Affiliation> affiliations_;
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Affiliation> getAffiliationsList() {
      return affiliations_;
    }
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder> 
        getAffiliationsOrBuilderList() {
      return affiliations_;
    }
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    public int getAffiliationsCount() {
      return affiliations_.size();
    }
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.Affiliation getAffiliations(int index) {
      return affiliations_.get(index);
    }
    /**
     * <code>repeated .Affiliation affiliations = 12;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder getAffiliationsOrBuilder(
        int index) {
      return affiliations_.get(index);
    }

    // repeated .ReferenceMetadata reference = 7;
    public static final int REFERENCE_FIELD_NUMBER = 7;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata> reference_;
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata> getReferenceList() {
      return reference_;
    }
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder> 
        getReferenceOrBuilderList() {
      return reference_;
    }
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    public int getReferenceCount() {
      return reference_.size();
    }
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata getReference(int index) {
      return reference_.get(index);
    }
    /**
     * <code>repeated .ReferenceMetadata reference = 7;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder getReferenceOrBuilder(
        int index) {
      return reference_.get(index);
    }

    // repeated string collection = 8;
    public static final int COLLECTION_FIELD_NUMBER = 8;
    private com.google.protobuf.LazyStringList collection_;
    /**
     * <code>repeated string collection = 8;</code>
     */
    public java.util.List<java.lang.String>
        getCollectionList() {
      return collection_;
    }
    /**
     * <code>repeated string collection = 8;</code>
     */
    public int getCollectionCount() {
      return collection_.size();
    }
    /**
     * <code>repeated string collection = 8;</code>
     */
    public java.lang.String getCollection(int index) {
      return collection_.get(index);
    }
    /**
     * <code>repeated string collection = 8;</code>
     */
    public com.google.protobuf.ByteString
        getCollectionBytes(int index) {
      return collection_.getByteString(index);
    }

    // optional string sourcePath = 9;
    public static final int SOURCEPATH_FIELD_NUMBER = 9;
    private java.lang.Object sourcePath_;
    /**
     * <code>optional string sourcePath = 9;</code>
     */
    public boolean hasSourcePath() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional string sourcePath = 9;</code>
     */
    public java.lang.String getSourcePath() {
      java.lang.Object ref = sourcePath_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          sourcePath_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string sourcePath = 9;</code>
     */
    public com.google.protobuf.ByteString
        getSourcePathBytes() {
      java.lang.Object ref = sourcePath_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        sourcePath_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // repeated string origKey = 11;
    public static final int ORIGKEY_FIELD_NUMBER = 11;
    private com.google.protobuf.LazyStringList origKey_;
    /**
     * <code>repeated string origKey = 11;</code>
     */
    public java.util.List<java.lang.String>
        getOrigKeyList() {
      return origKey_;
    }
    /**
     * <code>repeated string origKey = 11;</code>
     */
    public int getOrigKeyCount() {
      return origKey_.size();
    }
    /**
     * <code>repeated string origKey = 11;</code>
     */
    public java.lang.String getOrigKey(int index) {
      return origKey_.get(index);
    }
    /**
     * <code>repeated string origKey = 11;</code>
     */
    public com.google.protobuf.ByteString
        getOrigKeyBytes(int index) {
      return origKey_.getByteString(index);
    }

    // optional .DocumentMetadata.Type type = 21 [default = ARTICLE];
    public static final int TYPE_FIELD_NUMBER = 21;
    private pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type type_;
    /**
     * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
     */
    public boolean hasType() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type getType() {
      return type_;
    }

    private void initFields() {
      key_ = "";
      basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
      documentAbstract_ = java.util.Collections.emptyList();
      keywords_ = java.util.Collections.emptyList();
      similarDocumentInfo_ = java.util.Collections.emptyList();
      extId_ = java.util.Collections.emptyList();
      auxiliarInfo_ = java.util.Collections.emptyList();
      affiliations_ = java.util.Collections.emptyList();
      reference_ = java.util.Collections.emptyList();
      collection_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      sourcePath_ = "";
      origKey_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      type_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type.ARTICLE;
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasKey()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasBasicMetadata()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!getBasicMetadata().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      for (int i = 0; i < getDocumentAbstractCount(); i++) {
        if (!getDocumentAbstract(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getKeywordsCount(); i++) {
        if (!getKeywords(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getSimilarDocumentInfoCount(); i++) {
        if (!getSimilarDocumentInfo(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getExtIdCount(); i++) {
        if (!getExtId(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getAuxiliarInfoCount(); i++) {
        if (!getAuxiliarInfo(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getAffiliationsCount(); i++) {
        if (!getAffiliations(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      for (int i = 0; i < getReferenceCount(); i++) {
        if (!getReference(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeMessage(2, basicMetadata_);
      }
      for (int i = 0; i < documentAbstract_.size(); i++) {
        output.writeMessage(3, documentAbstract_.get(i));
      }
      for (int i = 0; i < extId_.size(); i++) {
        output.writeMessage(5, extId_.get(i));
      }
      for (int i = 0; i < auxiliarInfo_.size(); i++) {
        output.writeMessage(6, auxiliarInfo_.get(i));
      }
      for (int i = 0; i < reference_.size(); i++) {
        output.writeMessage(7, reference_.get(i));
      }
      for (int i = 0; i < collection_.size(); i++) {
        output.writeBytes(8, collection_.getByteString(i));
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(9, getSourcePathBytes());
      }
      for (int i = 0; i < keywords_.size(); i++) {
        output.writeMessage(10, keywords_.get(i));
      }
      for (int i = 0; i < origKey_.size(); i++) {
        output.writeBytes(11, origKey_.getByteString(i));
      }
      for (int i = 0; i < affiliations_.size(); i++) {
        output.writeMessage(12, affiliations_.get(i));
      }
      for (int i = 0; i < similarDocumentInfo_.size(); i++) {
        output.writeMessage(20, similarDocumentInfo_.get(i));
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeEnum(21, type_.getNumber());
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, basicMetadata_);
      }
      for (int i = 0; i < documentAbstract_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, documentAbstract_.get(i));
      }
      for (int i = 0; i < extId_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, extId_.get(i));
      }
      for (int i = 0; i < auxiliarInfo_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(6, auxiliarInfo_.get(i));
      }
      for (int i = 0; i < reference_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(7, reference_.get(i));
      }
      {
        int dataSize = 0;
        for (int i = 0; i < collection_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(collection_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getCollectionList().size();
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(9, getSourcePathBytes());
      }
      for (int i = 0; i < keywords_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(10, keywords_.get(i));
      }
      {
        int dataSize = 0;
        for (int i = 0; i < origKey_.size(); i++) {
          dataSize += com.google.protobuf.CodedOutputStream
            .computeBytesSizeNoTag(origKey_.getByteString(i));
        }
        size += dataSize;
        size += 1 * getOrigKeyList().size();
      }
      for (int i = 0; i < affiliations_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(12, affiliations_.get(i));
      }
      for (int i = 0; i < similarDocumentInfo_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(20, similarDocumentInfo_.get(i));
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeEnumSize(21, type_.getNumber());
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code DocumentMetadata}
     *
     * <pre>
     * key -- a hash based on title, authors' names, year, abstract, issn, issue, pages, volume (name based UUID, type 3)
     * (see pl.edu.icm.coansys.parsers.MetadataToProtoMetadataParserImpl.calculateDocKey())
     * collection -- a collection name, usually a publisher name or if data is harvester from the web, a collection can be an URL
     * sourcePath -- additional info about a location from which the data was imported
     * </pre>
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadataOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentMetadata_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentMetadata_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.class, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getBasicMetadataFieldBuilder();
          getDocumentAbstractFieldBuilder();
          getKeywordsFieldBuilder();
          getSimilarDocumentInfoFieldBuilder();
          getExtIdFieldBuilder();
          getAuxiliarInfoFieldBuilder();
          getAffiliationsFieldBuilder();
          getReferenceFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        key_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        if (basicMetadataBuilder_ == null) {
          basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
        } else {
          basicMetadataBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000002);
        if (documentAbstractBuilder_ == null) {
          documentAbstract_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000004);
        } else {
          documentAbstractBuilder_.clear();
        }
        if (keywordsBuilder_ == null) {
          keywords_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000008);
        } else {
          keywordsBuilder_.clear();
        }
        if (similarDocumentInfoBuilder_ == null) {
          similarDocumentInfo_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
        } else {
          similarDocumentInfoBuilder_.clear();
        }
        if (extIdBuilder_ == null) {
          extId_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000020);
        } else {
          extIdBuilder_.clear();
        }
        if (auxiliarInfoBuilder_ == null) {
          auxiliarInfo_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000040);
        } else {
          auxiliarInfoBuilder_.clear();
        }
        if (affiliationsBuilder_ == null) {
          affiliations_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000080);
        } else {
          affiliationsBuilder_.clear();
        }
        if (referenceBuilder_ == null) {
          reference_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000100);
        } else {
          referenceBuilder_.clear();
        }
        collection_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000200);
        sourcePath_ = "";
        bitField0_ = (bitField0_ & ~0x00000400);
        origKey_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000800);
        type_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type.ARTICLE;
        bitField0_ = (bitField0_ & ~0x00001000);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentMetadata_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata build() {
        pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata result = new pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.key_ = key_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        if (basicMetadataBuilder_ == null) {
          result.basicMetadata_ = basicMetadata_;
        } else {
          result.basicMetadata_ = basicMetadataBuilder_.build();
        }
        if (documentAbstractBuilder_ == null) {
          if (((bitField0_ & 0x00000004) == 0x00000004)) {
            documentAbstract_ = java.util.Collections.unmodifiableList(documentAbstract_);
            bitField0_ = (bitField0_ & ~0x00000004);
          }
          result.documentAbstract_ = documentAbstract_;
        } else {
          result.documentAbstract_ = documentAbstractBuilder_.build();
        }
        if (keywordsBuilder_ == null) {
          if (((bitField0_ & 0x00000008) == 0x00000008)) {
            keywords_ = java.util.Collections.unmodifiableList(keywords_);
            bitField0_ = (bitField0_ & ~0x00000008);
          }
          result.keywords_ = keywords_;
        } else {
          result.keywords_ = keywordsBuilder_.build();
        }
        if (similarDocumentInfoBuilder_ == null) {
          if (((bitField0_ & 0x00000010) == 0x00000010)) {
            similarDocumentInfo_ = java.util.Collections.unmodifiableList(similarDocumentInfo_);
            bitField0_ = (bitField0_ & ~0x00000010);
          }
          result.similarDocumentInfo_ = similarDocumentInfo_;
        } else {
          result.similarDocumentInfo_ = similarDocumentInfoBuilder_.build();
        }
        if (extIdBuilder_ == null) {
          if (((bitField0_ & 0x00000020) == 0x00000020)) {
            extId_ = java.util.Collections.unmodifiableList(extId_);
            bitField0_ = (bitField0_ & ~0x00000020);
          }
          result.extId_ = extId_;
        } else {
          result.extId_ = extIdBuilder_.build();
        }
        if (auxiliarInfoBuilder_ == null) {
          if (((bitField0_ & 0x00000040) == 0x00000040)) {
            auxiliarInfo_ = java.util.Collections.unmodifiableList(auxiliarInfo_);
            bitField0_ = (bitField0_ & ~0x00000040);
          }
          result.auxiliarInfo_ = auxiliarInfo_;
        } else {
          result.auxiliarInfo_ = auxiliarInfoBuilder_.build();
        }
        if (affiliationsBuilder_ == null) {
          if (((bitField0_ & 0x00000080) == 0x00000080)) {
            affiliations_ = java.util.Collections.unmodifiableList(affiliations_);
            bitField0_ = (bitField0_ & ~0x00000080);
          }
          result.affiliations_ = affiliations_;
        } else {
          result.affiliations_ = affiliationsBuilder_.build();
        }
        if (referenceBuilder_ == null) {
          if (((bitField0_ & 0x00000100) == 0x00000100)) {
            reference_ = java.util.Collections.unmodifiableList(reference_);
            bitField0_ = (bitField0_ & ~0x00000100);
          }
          result.reference_ = reference_;
        } else {
          result.reference_ = referenceBuilder_.build();
        }
        if (((bitField0_ & 0x00000200) == 0x00000200)) {
          collection_ = new com.google.protobuf.UnmodifiableLazyStringList(
              collection_);
          bitField0_ = (bitField0_ & ~0x00000200);
        }
        result.collection_ = collection_;
        if (((from_bitField0_ & 0x00000400) == 0x00000400)) {
          to_bitField0_ |= 0x00000004;
        }
        result.sourcePath_ = sourcePath_;
        if (((bitField0_ & 0x00000800) == 0x00000800)) {
          origKey_ = new com.google.protobuf.UnmodifiableLazyStringList(
              origKey_);
          bitField0_ = (bitField0_ & ~0x00000800);
        }
        result.origKey_ = origKey_;
        if (((from_bitField0_ & 0x00001000) == 0x00001000)) {
          to_bitField0_ |= 0x00000008;
        }
        result.type_ = type_;
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDefaultInstance()) return this;
        if (other.hasKey()) {
          bitField0_ |= 0x00000001;
          key_ = other.key_;
          onChanged();
        }
        if (other.hasBasicMetadata()) {
          mergeBasicMetadata(other.getBasicMetadata());
        }
        if (documentAbstractBuilder_ == null) {
          if (!other.documentAbstract_.isEmpty()) {
            if (documentAbstract_.isEmpty()) {
              documentAbstract_ = other.documentAbstract_;
              bitField0_ = (bitField0_ & ~0x00000004);
            } else {
              ensureDocumentAbstractIsMutable();
              documentAbstract_.addAll(other.documentAbstract_);
            }
            onChanged();
          }
        } else {
          if (!other.documentAbstract_.isEmpty()) {
            if (documentAbstractBuilder_.isEmpty()) {
              documentAbstractBuilder_.dispose();
              documentAbstractBuilder_ = null;
              documentAbstract_ = other.documentAbstract_;
              bitField0_ = (bitField0_ & ~0x00000004);
              documentAbstractBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getDocumentAbstractFieldBuilder() : null;
            } else {
              documentAbstractBuilder_.addAllMessages(other.documentAbstract_);
            }
          }
        }
        if (keywordsBuilder_ == null) {
          if (!other.keywords_.isEmpty()) {
            if (keywords_.isEmpty()) {
              keywords_ = other.keywords_;
              bitField0_ = (bitField0_ & ~0x00000008);
            } else {
              ensureKeywordsIsMutable();
              keywords_.addAll(other.keywords_);
            }
            onChanged();
          }
        } else {
          if (!other.keywords_.isEmpty()) {
            if (keywordsBuilder_.isEmpty()) {
              keywordsBuilder_.dispose();
              keywordsBuilder_ = null;
              keywords_ = other.keywords_;
              bitField0_ = (bitField0_ & ~0x00000008);
              keywordsBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getKeywordsFieldBuilder() : null;
            } else {
              keywordsBuilder_.addAllMessages(other.keywords_);
            }
          }
        }
        if (similarDocumentInfoBuilder_ == null) {
          if (!other.similarDocumentInfo_.isEmpty()) {
            if (similarDocumentInfo_.isEmpty()) {
              similarDocumentInfo_ = other.similarDocumentInfo_;
              bitField0_ = (bitField0_ & ~0x00000010);
            } else {
              ensureSimilarDocumentInfoIsMutable();
              similarDocumentInfo_.addAll(other.similarDocumentInfo_);
            }
            onChanged();
          }
        } else {
          if (!other.similarDocumentInfo_.isEmpty()) {
            if (similarDocumentInfoBuilder_.isEmpty()) {
              similarDocumentInfoBuilder_.dispose();
              similarDocumentInfoBuilder_ = null;
              similarDocumentInfo_ = other.similarDocumentInfo_;
              bitField0_ = (bitField0_ & ~0x00000010);
              similarDocumentInfoBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getSimilarDocumentInfoFieldBuilder() : null;
            } else {
              similarDocumentInfoBuilder_.addAllMessages(other.similarDocumentInfo_);
            }
          }
        }
        if (extIdBuilder_ == null) {
          if (!other.extId_.isEmpty()) {
            if (extId_.isEmpty()) {
              extId_ = other.extId_;
              bitField0_ = (bitField0_ & ~0x00000020);
            } else {
              ensureExtIdIsMutable();
              extId_.addAll(other.extId_);
            }
            onChanged();
          }
        } else {
          if (!other.extId_.isEmpty()) {
            if (extIdBuilder_.isEmpty()) {
              extIdBuilder_.dispose();
              extIdBuilder_ = null;
              extId_ = other.extId_;
              bitField0_ = (bitField0_ & ~0x00000020);
              extIdBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getExtIdFieldBuilder() : null;
            } else {
              extIdBuilder_.addAllMessages(other.extId_);
            }
          }
        }
        if (auxiliarInfoBuilder_ == null) {
          if (!other.auxiliarInfo_.isEmpty()) {
            if (auxiliarInfo_.isEmpty()) {
              auxiliarInfo_ = other.auxiliarInfo_;
              bitField0_ = (bitField0_ & ~0x00000040);
            } else {
              ensureAuxiliarInfoIsMutable();
              auxiliarInfo_.addAll(other.auxiliarInfo_);
            }
            onChanged();
          }
        } else {
          if (!other.auxiliarInfo_.isEmpty()) {
            if (auxiliarInfoBuilder_.isEmpty()) {
              auxiliarInfoBuilder_.dispose();
              auxiliarInfoBuilder_ = null;
              auxiliarInfo_ = other.auxiliarInfo_;
              bitField0_ = (bitField0_ & ~0x00000040);
              auxiliarInfoBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getAuxiliarInfoFieldBuilder() : null;
            } else {
              auxiliarInfoBuilder_.addAllMessages(other.auxiliarInfo_);
            }
          }
        }
        if (affiliationsBuilder_ == null) {
          if (!other.affiliations_.isEmpty()) {
            if (affiliations_.isEmpty()) {
              affiliations_ = other.affiliations_;
              bitField0_ = (bitField0_ & ~0x00000080);
            } else {
              ensureAffiliationsIsMutable();
              affiliations_.addAll(other.affiliations_);
            }
            onChanged();
          }
        } else {
          if (!other.affiliations_.isEmpty()) {
            if (affiliationsBuilder_.isEmpty()) {
              affiliationsBuilder_.dispose();
              affiliationsBuilder_ = null;
              affiliations_ = other.affiliations_;
              bitField0_ = (bitField0_ & ~0x00000080);
              affiliationsBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getAffiliationsFieldBuilder() : null;
            } else {
              affiliationsBuilder_.addAllMessages(other.affiliations_);
            }
          }
        }
        if (referenceBuilder_ == null) {
          if (!other.reference_.isEmpty()) {
            if (reference_.isEmpty()) {
              reference_ = other.reference_;
              bitField0_ = (bitField0_ & ~0x00000100);
            } else {
              ensureReferenceIsMutable();
              reference_.addAll(other.reference_);
            }
            onChanged();
          }
        } else {
          if (!other.reference_.isEmpty()) {
            if (referenceBuilder_.isEmpty()) {
              referenceBuilder_.dispose();
              referenceBuilder_ = null;
              reference_ = other.reference_;
              bitField0_ = (bitField0_ & ~0x00000100);
              referenceBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getReferenceFieldBuilder() : null;
            } else {
              referenceBuilder_.addAllMessages(other.reference_);
            }
          }
        }
        if (!other.collection_.isEmpty()) {
          if (collection_.isEmpty()) {
            collection_ = other.collection_;
            bitField0_ = (bitField0_ & ~0x00000200);
          } else {
            ensureCollectionIsMutable();
            collection_.addAll(other.collection_);
          }
          onChanged();
        }
        if (other.hasSourcePath()) {
          bitField0_ |= 0x00000400;
          sourcePath_ = other.sourcePath_;
          onChanged();
        }
        if (!other.origKey_.isEmpty()) {
          if (origKey_.isEmpty()) {
            origKey_ = other.origKey_;
            bitField0_ = (bitField0_ & ~0x00000800);
          } else {
            ensureOrigKeyIsMutable();
            origKey_.addAll(other.origKey_);
          }
          onChanged();
        }
        if (other.hasType()) {
          setType(other.getType());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasKey()) {
          
          return false;
        }
        if (!hasBasicMetadata()) {
          
          return false;
        }
        if (!getBasicMetadata().isInitialized()) {
          
          return false;
        }
        for (int i = 0; i < getDocumentAbstractCount(); i++) {
          if (!getDocumentAbstract(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getKeywordsCount(); i++) {
          if (!getKeywords(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getSimilarDocumentInfoCount(); i++) {
          if (!getSimilarDocumentInfo(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getExtIdCount(); i++) {
          if (!getExtId(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getAuxiliarInfoCount(); i++) {
          if (!getAuxiliarInfo(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getAffiliationsCount(); i++) {
          if (!getAffiliations(i).isInitialized()) {
            
            return false;
          }
        }
        for (int i = 0; i < getReferenceCount(); i++) {
          if (!getReference(i).isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string key = 1;
      private java.lang.Object key_ = "";
      /**
       * <code>required string key = 1;</code>
       */
      public boolean hasKey() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string key = 1;</code>
       */
      public java.lang.String getKey() {
        java.lang.Object ref = key_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          key_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public com.google.protobuf.ByteString
          getKeyBytes() {
        java.lang.Object ref = key_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          key_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKey(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder clearKey() {
        bitField0_ = (bitField0_ & ~0x00000001);
        key_ = getDefaultInstance().getKey();
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKeyBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }

      // required .BasicMetadata basicMetadata = 2;
      private pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder> basicMetadataBuilder_;
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public boolean hasBasicMetadata() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata getBasicMetadata() {
        if (basicMetadataBuilder_ == null) {
          return basicMetadata_;
        } else {
          return basicMetadataBuilder_.getMessage();
        }
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public Builder setBasicMetadata(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata value) {
        if (basicMetadataBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          basicMetadata_ = value;
          onChanged();
        } else {
          basicMetadataBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public Builder setBasicMetadata(
          pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder builderForValue) {
        if (basicMetadataBuilder_ == null) {
          basicMetadata_ = builderForValue.build();
          onChanged();
        } else {
          basicMetadataBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public Builder mergeBasicMetadata(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata value) {
        if (basicMetadataBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002) &&
              basicMetadata_ != pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance()) {
            basicMetadata_ =
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.newBuilder(basicMetadata_).mergeFrom(value).buildPartial();
          } else {
            basicMetadata_ = value;
          }
          onChanged();
        } else {
          basicMetadataBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public Builder clearBasicMetadata() {
        if (basicMetadataBuilder_ == null) {
          basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
          onChanged();
        } else {
          basicMetadataBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000002);
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder getBasicMetadataBuilder() {
        bitField0_ |= 0x00000002;
        onChanged();
        return getBasicMetadataFieldBuilder().getBuilder();
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder getBasicMetadataOrBuilder() {
        if (basicMetadataBuilder_ != null) {
          return basicMetadataBuilder_.getMessageOrBuilder();
        } else {
          return basicMetadata_;
        }
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder> 
          getBasicMetadataFieldBuilder() {
        if (basicMetadataBuilder_ == null) {
          basicMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder>(
                  basicMetadata_,
                  getParentForChildren(),
                  isClean());
          basicMetadata_ = null;
        }
        return basicMetadataBuilder_;
      }

      // repeated .TextWithLanguage documentAbstract = 3;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> documentAbstract_ =
        java.util.Collections.emptyList();
      private void ensureDocumentAbstractIsMutable() {
        if (!((bitField0_ & 0x00000004) == 0x00000004)) {
          documentAbstract_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage>(documentAbstract_);
          bitField0_ |= 0x00000004;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> documentAbstractBuilder_;

      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> getDocumentAbstractList() {
        if (documentAbstractBuilder_ == null) {
          return java.util.Collections.unmodifiableList(documentAbstract_);
        } else {
          return documentAbstractBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public int getDocumentAbstractCount() {
        if (documentAbstractBuilder_ == null) {
          return documentAbstract_.size();
        } else {
          return documentAbstractBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage getDocumentAbstract(int index) {
        if (documentAbstractBuilder_ == null) {
          return documentAbstract_.get(index);
        } else {
          return documentAbstractBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder setDocumentAbstract(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage value) {
        if (documentAbstractBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureDocumentAbstractIsMutable();
          documentAbstract_.set(index, value);
          onChanged();
        } else {
          documentAbstractBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder setDocumentAbstract(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder builderForValue) {
        if (documentAbstractBuilder_ == null) {
          ensureDocumentAbstractIsMutable();
          documentAbstract_.set(index, builderForValue.build());
          onChanged();
        } else {
          documentAbstractBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder addDocumentAbstract(pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage value) {
        if (documentAbstractBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureDocumentAbstractIsMutable();
          documentAbstract_.add(value);
          onChanged();
        } else {
          documentAbstractBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder addDocumentAbstract(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage value) {
        if (documentAbstractBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureDocumentAbstractIsMutable();
          documentAbstract_.add(index, value);
          onChanged();
        } else {
          documentAbstractBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder addDocumentAbstract(
          pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder builderForValue) {
        if (documentAbstractBuilder_ == null) {
          ensureDocumentAbstractIsMutable();
          documentAbstract_.add(builderForValue.build());
          onChanged();
        } else {
          documentAbstractBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder addDocumentAbstract(
          int index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder builderForValue) {
        if (documentAbstractBuilder_ == null) {
          ensureDocumentAbstractIsMutable();
          documentAbstract_.add(index, builderForValue.build());
          onChanged();
        } else {
          documentAbstractBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder addAllDocumentAbstract(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage> values) {
        if (documentAbstractBuilder_ == null) {
          ensureDocumentAbstractIsMutable();
          super.addAll(values, documentAbstract_);
          onChanged();
        } else {
          documentAbstractBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder clearDocumentAbstract() {
        if (documentAbstractBuilder_ == null) {
          documentAbstract_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000004);
          onChanged();
        } else {
          documentAbstractBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public Builder removeDocumentAbstract(int index) {
        if (documentAbstractBuilder_ == null) {
          ensureDocumentAbstractIsMutable();
          documentAbstract_.remove(index);
          onChanged();
        } else {
          documentAbstractBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder getDocumentAbstractBuilder(
          int index) {
        return getDocumentAbstractFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder getDocumentAbstractOrBuilder(
          int index) {
        if (documentAbstractBuilder_ == null) {
          return documentAbstract_.get(index);  } else {
          return documentAbstractBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
           getDocumentAbstractOrBuilderList() {
        if (documentAbstractBuilder_ != null) {
          return documentAbstractBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(documentAbstract_);
        }
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder addDocumentAbstractBuilder() {
        return getDocumentAbstractFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.getDefaultInstance());
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder addDocumentAbstractBuilder(
          int index) {
        return getDocumentAbstractFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.getDefaultInstance());
      }
      /**
       * <code>repeated .TextWithLanguage documentAbstract = 3;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder> 
           getDocumentAbstractBuilderList() {
        return getDocumentAbstractFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder> 
          getDocumentAbstractFieldBuilder() {
        if (documentAbstractBuilder_ == null) {
          documentAbstractBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguage.Builder, pl.edu.icm.coansys.models.DocumentProtos.TextWithLanguageOrBuilder>(
                  documentAbstract_,
                  ((bitField0_ & 0x00000004) == 0x00000004),
                  getParentForChildren(),
                  isClean());
          documentAbstract_ = null;
        }
        return documentAbstractBuilder_;
      }

      // repeated .KeywordsList keywords = 10;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList> keywords_ =
        java.util.Collections.emptyList();
      private void ensureKeywordsIsMutable() {
        if (!((bitField0_ & 0x00000008) == 0x00000008)) {
          keywords_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList>(keywords_);
          bitField0_ |= 0x00000008;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeywordsList, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder> keywordsBuilder_;

      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList> getKeywordsList() {
        if (keywordsBuilder_ == null) {
          return java.util.Collections.unmodifiableList(keywords_);
        } else {
          return keywordsBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public int getKeywordsCount() {
        if (keywordsBuilder_ == null) {
          return keywords_.size();
        } else {
          return keywordsBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList getKeywords(int index) {
        if (keywordsBuilder_ == null) {
          return keywords_.get(index);
        } else {
          return keywordsBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder setKeywords(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList value) {
        if (keywordsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureKeywordsIsMutable();
          keywords_.set(index, value);
          onChanged();
        } else {
          keywordsBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder setKeywords(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder builderForValue) {
        if (keywordsBuilder_ == null) {
          ensureKeywordsIsMutable();
          keywords_.set(index, builderForValue.build());
          onChanged();
        } else {
          keywordsBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder addKeywords(pl.edu.icm.coansys.models.DocumentProtos.KeywordsList value) {
        if (keywordsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureKeywordsIsMutable();
          keywords_.add(value);
          onChanged();
        } else {
          keywordsBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder addKeywords(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList value) {
        if (keywordsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureKeywordsIsMutable();
          keywords_.add(index, value);
          onChanged();
        } else {
          keywordsBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder addKeywords(
          pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder builderForValue) {
        if (keywordsBuilder_ == null) {
          ensureKeywordsIsMutable();
          keywords_.add(builderForValue.build());
          onChanged();
        } else {
          keywordsBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder addKeywords(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder builderForValue) {
        if (keywordsBuilder_ == null) {
          ensureKeywordsIsMutable();
          keywords_.add(index, builderForValue.build());
          onChanged();
        } else {
          keywordsBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder addAllKeywords(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.KeywordsList> values) {
        if (keywordsBuilder_ == null) {
          ensureKeywordsIsMutable();
          super.addAll(values, keywords_);
          onChanged();
        } else {
          keywordsBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder clearKeywords() {
        if (keywordsBuilder_ == null) {
          keywords_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000008);
          onChanged();
        } else {
          keywordsBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public Builder removeKeywords(int index) {
        if (keywordsBuilder_ == null) {
          ensureKeywordsIsMutable();
          keywords_.remove(index);
          onChanged();
        } else {
          keywordsBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder getKeywordsBuilder(
          int index) {
        return getKeywordsFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder getKeywordsOrBuilder(
          int index) {
        if (keywordsBuilder_ == null) {
          return keywords_.get(index);  } else {
          return keywordsBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder> 
           getKeywordsOrBuilderList() {
        if (keywordsBuilder_ != null) {
          return keywordsBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(keywords_);
        }
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder addKeywordsBuilder() {
        return getKeywordsFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.getDefaultInstance());
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder addKeywordsBuilder(
          int index) {
        return getKeywordsFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.getDefaultInstance());
      }
      /**
       * <code>repeated .KeywordsList keywords = 10;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder> 
           getKeywordsBuilderList() {
        return getKeywordsFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeywordsList, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder> 
          getKeywordsFieldBuilder() {
        if (keywordsBuilder_ == null) {
          keywordsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.KeywordsList, pl.edu.icm.coansys.models.DocumentProtos.KeywordsList.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeywordsListOrBuilder>(
                  keywords_,
                  ((bitField0_ & 0x00000008) == 0x00000008),
                  getParentForChildren(),
                  isClean());
          keywords_ = null;
        }
        return keywordsBuilder_;
      }

      // repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;
      private java.util.List<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo> similarDocumentInfo_ =
        java.util.Collections.emptyList();
      private void ensureSimilarDocumentInfoIsMutable() {
        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
          similarDocumentInfo_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo>(similarDocumentInfo_);
          bitField0_ |= 0x00000010;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder> similarDocumentInfoBuilder_;

      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo> getSimilarDocumentInfoList() {
        if (similarDocumentInfoBuilder_ == null) {
          return java.util.Collections.unmodifiableList(similarDocumentInfo_);
        } else {
          return similarDocumentInfoBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public int getSimilarDocumentInfoCount() {
        if (similarDocumentInfoBuilder_ == null) {
          return similarDocumentInfo_.size();
        } else {
          return similarDocumentInfoBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo getSimilarDocumentInfo(int index) {
        if (similarDocumentInfoBuilder_ == null) {
          return similarDocumentInfo_.get(index);
        } else {
          return similarDocumentInfoBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder setSimilarDocumentInfo(
          int index, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo value) {
        if (similarDocumentInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureSimilarDocumentInfoIsMutable();
          similarDocumentInfo_.set(index, value);
          onChanged();
        } else {
          similarDocumentInfoBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder setSimilarDocumentInfo(
          int index, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder builderForValue) {
        if (similarDocumentInfoBuilder_ == null) {
          ensureSimilarDocumentInfoIsMutable();
          similarDocumentInfo_.set(index, builderForValue.build());
          onChanged();
        } else {
          similarDocumentInfoBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder addSimilarDocumentInfo(pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo value) {
        if (similarDocumentInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureSimilarDocumentInfoIsMutable();
          similarDocumentInfo_.add(value);
          onChanged();
        } else {
          similarDocumentInfoBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder addSimilarDocumentInfo(
          int index, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo value) {
        if (similarDocumentInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureSimilarDocumentInfoIsMutable();
          similarDocumentInfo_.add(index, value);
          onChanged();
        } else {
          similarDocumentInfoBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder addSimilarDocumentInfo(
          pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder builderForValue) {
        if (similarDocumentInfoBuilder_ == null) {
          ensureSimilarDocumentInfoIsMutable();
          similarDocumentInfo_.add(builderForValue.build());
          onChanged();
        } else {
          similarDocumentInfoBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder addSimilarDocumentInfo(
          int index, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder builderForValue) {
        if (similarDocumentInfoBuilder_ == null) {
          ensureSimilarDocumentInfoIsMutable();
          similarDocumentInfo_.add(index, builderForValue.build());
          onChanged();
        } else {
          similarDocumentInfoBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder addAllSimilarDocumentInfo(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo> values) {
        if (similarDocumentInfoBuilder_ == null) {
          ensureSimilarDocumentInfoIsMutable();
          super.addAll(values, similarDocumentInfo_);
          onChanged();
        } else {
          similarDocumentInfoBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder clearSimilarDocumentInfo() {
        if (similarDocumentInfoBuilder_ == null) {
          similarDocumentInfo_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
          onChanged();
        } else {
          similarDocumentInfoBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public Builder removeSimilarDocumentInfo(int index) {
        if (similarDocumentInfoBuilder_ == null) {
          ensureSimilarDocumentInfoIsMutable();
          similarDocumentInfo_.remove(index);
          onChanged();
        } else {
          similarDocumentInfoBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder getSimilarDocumentInfoBuilder(
          int index) {
        return getSimilarDocumentInfoFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder getSimilarDocumentInfoOrBuilder(
          int index) {
        if (similarDocumentInfoBuilder_ == null) {
          return similarDocumentInfo_.get(index);  } else {
          return similarDocumentInfoBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder> 
           getSimilarDocumentInfoOrBuilderList() {
        if (similarDocumentInfoBuilder_ != null) {
          return similarDocumentInfoBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(similarDocumentInfo_);
        }
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder addSimilarDocumentInfoBuilder() {
        return getSimilarDocumentInfoFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.getDefaultInstance());
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder addSimilarDocumentInfoBuilder(
          int index) {
        return getSimilarDocumentInfoFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.getDefaultInstance());
      }
      /**
       * <code>repeated .pl.edu.icm.coansys.models.DocumentSimilarityInfo similarDocumentInfo = 20;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder> 
           getSimilarDocumentInfoBuilderList() {
        return getSimilarDocumentInfoFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder> 
          getSimilarDocumentInfoFieldBuilder() {
        if (similarDocumentInfoBuilder_ == null) {
          similarDocumentInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfo.Builder, pl.edu.icm.coansys.models.DocumentSimilarityProtos.DocumentSimilarityInfoOrBuilder>(
                  similarDocumentInfo_,
                  ((bitField0_ & 0x00000010) == 0x00000010),
                  getParentForChildren(),
                  isClean());
          similarDocumentInfo_ = null;
        }
        return similarDocumentInfoBuilder_;
      }

      // repeated .KeyValue extId = 5;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> extId_ =
        java.util.Collections.emptyList();
      private void ensureExtIdIsMutable() {
        if (!((bitField0_ & 0x00000020) == 0x00000020)) {
          extId_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>(extId_);
          bitField0_ |= 0x00000020;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> extIdBuilder_;

      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getExtIdList() {
        if (extIdBuilder_ == null) {
          return java.util.Collections.unmodifiableList(extId_);
        } else {
          return extIdBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public int getExtIdCount() {
        if (extIdBuilder_ == null) {
          return extId_.size();
        } else {
          return extIdBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index) {
        if (extIdBuilder_ == null) {
          return extId_.get(index);
        } else {
          return extIdBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder setExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.set(index, value);
          onChanged();
        } else {
          extIdBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder setExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.set(index, builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.add(value);
          onChanged();
        } else {
          extIdBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.add(index, value);
          onChanged();
        } else {
          extIdBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.add(builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.add(index, builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addAllExtId(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValue> values) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          super.addAll(values, extId_);
          onChanged();
        } else {
          extIdBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder clearExtId() {
        if (extIdBuilder_ == null) {
          extId_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000020);
          onChanged();
        } else {
          extIdBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder removeExtId(int index) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.remove(index);
          onChanged();
        } else {
          extIdBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder getExtIdBuilder(
          int index) {
        return getExtIdFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
          int index) {
        if (extIdBuilder_ == null) {
          return extId_.get(index);  } else {
          return extIdBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
           getExtIdOrBuilderList() {
        if (extIdBuilder_ != null) {
          return extIdBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(extId_);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addExtIdBuilder() {
        return getExtIdFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addExtIdBuilder(
          int index) {
        return getExtIdFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder> 
           getExtIdBuilderList() {
        return getExtIdFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
          getExtIdFieldBuilder() {
        if (extIdBuilder_ == null) {
          extIdBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder>(
                  extId_,
                  ((bitField0_ & 0x00000020) == 0x00000020),
                  getParentForChildren(),
                  isClean());
          extId_ = null;
        }
        return extIdBuilder_;
      }

      // repeated .KeyValue auxiliarInfo = 6;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> auxiliarInfo_ =
        java.util.Collections.emptyList();
      private void ensureAuxiliarInfoIsMutable() {
        if (!((bitField0_ & 0x00000040) == 0x00000040)) {
          auxiliarInfo_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>(auxiliarInfo_);
          bitField0_ |= 0x00000040;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> auxiliarInfoBuilder_;

      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getAuxiliarInfoList() {
        if (auxiliarInfoBuilder_ == null) {
          return java.util.Collections.unmodifiableList(auxiliarInfo_);
        } else {
          return auxiliarInfoBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public int getAuxiliarInfoCount() {
        if (auxiliarInfoBuilder_ == null) {
          return auxiliarInfo_.size();
        } else {
          return auxiliarInfoBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getAuxiliarInfo(int index) {
        if (auxiliarInfoBuilder_ == null) {
          return auxiliarInfo_.get(index);
        } else {
          return auxiliarInfoBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder setAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (auxiliarInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.set(index, value);
          onChanged();
        } else {
          auxiliarInfoBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder setAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.set(index, builderForValue.build());
          onChanged();
        } else {
          auxiliarInfoBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder addAuxiliarInfo(pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (auxiliarInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(value);
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder addAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (auxiliarInfoBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(index, value);
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder addAuxiliarInfo(
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(builderForValue.build());
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder addAuxiliarInfo(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.add(index, builderForValue.build());
          onChanged();
        } else {
          auxiliarInfoBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder addAllAuxiliarInfo(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValue> values) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          super.addAll(values, auxiliarInfo_);
          onChanged();
        } else {
          auxiliarInfoBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder clearAuxiliarInfo() {
        if (auxiliarInfoBuilder_ == null) {
          auxiliarInfo_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000040);
          onChanged();
        } else {
          auxiliarInfoBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public Builder removeAuxiliarInfo(int index) {
        if (auxiliarInfoBuilder_ == null) {
          ensureAuxiliarInfoIsMutable();
          auxiliarInfo_.remove(index);
          onChanged();
        } else {
          auxiliarInfoBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder getAuxiliarInfoBuilder(
          int index) {
        return getAuxiliarInfoFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getAuxiliarInfoOrBuilder(
          int index) {
        if (auxiliarInfoBuilder_ == null) {
          return auxiliarInfo_.get(index);  } else {
          return auxiliarInfoBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
           getAuxiliarInfoOrBuilderList() {
        if (auxiliarInfoBuilder_ != null) {
          return auxiliarInfoBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(auxiliarInfo_);
        }
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addAuxiliarInfoBuilder() {
        return getAuxiliarInfoFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addAuxiliarInfoBuilder(
          int index) {
        return getAuxiliarInfoFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue auxiliarInfo = 6;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder> 
           getAuxiliarInfoBuilderList() {
        return getAuxiliarInfoFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
          getAuxiliarInfoFieldBuilder() {
        if (auxiliarInfoBuilder_ == null) {
          auxiliarInfoBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder>(
                  auxiliarInfo_,
                  ((bitField0_ & 0x00000040) == 0x00000040),
                  getParentForChildren(),
                  isClean());
          auxiliarInfo_ = null;
        }
        return auxiliarInfoBuilder_;
      }

      // repeated .Affiliation affiliations = 12;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Affiliation> affiliations_ =
        java.util.Collections.emptyList();
      private void ensureAffiliationsIsMutable() {
        if (!((bitField0_ & 0x00000080) == 0x00000080)) {
          affiliations_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.Affiliation>(affiliations_);
          bitField0_ |= 0x00000080;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.Affiliation, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder, pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder> affiliationsBuilder_;

      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Affiliation> getAffiliationsList() {
        if (affiliationsBuilder_ == null) {
          return java.util.Collections.unmodifiableList(affiliations_);
        } else {
          return affiliationsBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public int getAffiliationsCount() {
        if (affiliationsBuilder_ == null) {
          return affiliations_.size();
        } else {
          return affiliationsBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Affiliation getAffiliations(int index) {
        if (affiliationsBuilder_ == null) {
          return affiliations_.get(index);
        } else {
          return affiliationsBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder setAffiliations(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Affiliation value) {
        if (affiliationsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAffiliationsIsMutable();
          affiliations_.set(index, value);
          onChanged();
        } else {
          affiliationsBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder setAffiliations(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder builderForValue) {
        if (affiliationsBuilder_ == null) {
          ensureAffiliationsIsMutable();
          affiliations_.set(index, builderForValue.build());
          onChanged();
        } else {
          affiliationsBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder addAffiliations(pl.edu.icm.coansys.models.DocumentProtos.Affiliation value) {
        if (affiliationsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAffiliationsIsMutable();
          affiliations_.add(value);
          onChanged();
        } else {
          affiliationsBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder addAffiliations(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Affiliation value) {
        if (affiliationsBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureAffiliationsIsMutable();
          affiliations_.add(index, value);
          onChanged();
        } else {
          affiliationsBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder addAffiliations(
          pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder builderForValue) {
        if (affiliationsBuilder_ == null) {
          ensureAffiliationsIsMutable();
          affiliations_.add(builderForValue.build());
          onChanged();
        } else {
          affiliationsBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder addAffiliations(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder builderForValue) {
        if (affiliationsBuilder_ == null) {
          ensureAffiliationsIsMutable();
          affiliations_.add(index, builderForValue.build());
          onChanged();
        } else {
          affiliationsBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder addAllAffiliations(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.Affiliation> values) {
        if (affiliationsBuilder_ == null) {
          ensureAffiliationsIsMutable();
          super.addAll(values, affiliations_);
          onChanged();
        } else {
          affiliationsBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder clearAffiliations() {
        if (affiliationsBuilder_ == null) {
          affiliations_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000080);
          onChanged();
        } else {
          affiliationsBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public Builder removeAffiliations(int index) {
        if (affiliationsBuilder_ == null) {
          ensureAffiliationsIsMutable();
          affiliations_.remove(index);
          onChanged();
        } else {
          affiliationsBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder getAffiliationsBuilder(
          int index) {
        return getAffiliationsFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder getAffiliationsOrBuilder(
          int index) {
        if (affiliationsBuilder_ == null) {
          return affiliations_.get(index);  } else {
          return affiliationsBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder> 
           getAffiliationsOrBuilderList() {
        if (affiliationsBuilder_ != null) {
          return affiliationsBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(affiliations_);
        }
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder addAffiliationsBuilder() {
        return getAffiliationsFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.Affiliation.getDefaultInstance());
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder addAffiliationsBuilder(
          int index) {
        return getAffiliationsFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.getDefaultInstance());
      }
      /**
       * <code>repeated .Affiliation affiliations = 12;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder> 
           getAffiliationsBuilderList() {
        return getAffiliationsFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.Affiliation, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder, pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder> 
          getAffiliationsFieldBuilder() {
        if (affiliationsBuilder_ == null) {
          affiliationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.Affiliation, pl.edu.icm.coansys.models.DocumentProtos.Affiliation.Builder, pl.edu.icm.coansys.models.DocumentProtos.AffiliationOrBuilder>(
                  affiliations_,
                  ((bitField0_ & 0x00000080) == 0x00000080),
                  getParentForChildren(),
                  isClean());
          affiliations_ = null;
        }
        return affiliationsBuilder_;
      }

      // repeated .ReferenceMetadata reference = 7;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata> reference_ =
        java.util.Collections.emptyList();
      private void ensureReferenceIsMutable() {
        if (!((bitField0_ & 0x00000100) == 0x00000100)) {
          reference_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata>(reference_);
          bitField0_ |= 0x00000100;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder> referenceBuilder_;

      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata> getReferenceList() {
        if (referenceBuilder_ == null) {
          return java.util.Collections.unmodifiableList(reference_);
        } else {
          return referenceBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public int getReferenceCount() {
        if (referenceBuilder_ == null) {
          return reference_.size();
        } else {
          return referenceBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata getReference(int index) {
        if (referenceBuilder_ == null) {
          return reference_.get(index);
        } else {
          return referenceBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder setReference(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata value) {
        if (referenceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureReferenceIsMutable();
          reference_.set(index, value);
          onChanged();
        } else {
          referenceBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder setReference(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder builderForValue) {
        if (referenceBuilder_ == null) {
          ensureReferenceIsMutable();
          reference_.set(index, builderForValue.build());
          onChanged();
        } else {
          referenceBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder addReference(pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata value) {
        if (referenceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureReferenceIsMutable();
          reference_.add(value);
          onChanged();
        } else {
          referenceBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder addReference(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata value) {
        if (referenceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureReferenceIsMutable();
          reference_.add(index, value);
          onChanged();
        } else {
          referenceBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder addReference(
          pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder builderForValue) {
        if (referenceBuilder_ == null) {
          ensureReferenceIsMutable();
          reference_.add(builderForValue.build());
          onChanged();
        } else {
          referenceBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder addReference(
          int index, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder builderForValue) {
        if (referenceBuilder_ == null) {
          ensureReferenceIsMutable();
          reference_.add(index, builderForValue.build());
          onChanged();
        } else {
          referenceBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder addAllReference(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata> values) {
        if (referenceBuilder_ == null) {
          ensureReferenceIsMutable();
          super.addAll(values, reference_);
          onChanged();
        } else {
          referenceBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder clearReference() {
        if (referenceBuilder_ == null) {
          reference_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000100);
          onChanged();
        } else {
          referenceBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public Builder removeReference(int index) {
        if (referenceBuilder_ == null) {
          ensureReferenceIsMutable();
          reference_.remove(index);
          onChanged();
        } else {
          referenceBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder getReferenceBuilder(
          int index) {
        return getReferenceFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder getReferenceOrBuilder(
          int index) {
        if (referenceBuilder_ == null) {
          return reference_.get(index);  } else {
          return referenceBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder> 
           getReferenceOrBuilderList() {
        if (referenceBuilder_ != null) {
          return referenceBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(reference_);
        }
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder addReferenceBuilder() {
        return getReferenceFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.getDefaultInstance());
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder addReferenceBuilder(
          int index) {
        return getReferenceFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.getDefaultInstance());
      }
      /**
       * <code>repeated .ReferenceMetadata reference = 7;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder> 
           getReferenceBuilderList() {
        return getReferenceFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder> 
          getReferenceFieldBuilder() {
        if (referenceBuilder_ == null) {
          referenceBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder>(
                  reference_,
                  ((bitField0_ & 0x00000100) == 0x00000100),
                  getParentForChildren(),
                  isClean());
          reference_ = null;
        }
        return referenceBuilder_;
      }

      // repeated string collection = 8;
      private com.google.protobuf.LazyStringList collection_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureCollectionIsMutable() {
        if (!((bitField0_ & 0x00000200) == 0x00000200)) {
          collection_ = new com.google.protobuf.LazyStringArrayList(collection_);
          bitField0_ |= 0x00000200;
         }
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public java.util.List<java.lang.String>
          getCollectionList() {
        return java.util.Collections.unmodifiableList(collection_);
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public int getCollectionCount() {
        return collection_.size();
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public java.lang.String getCollection(int index) {
        return collection_.get(index);
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public com.google.protobuf.ByteString
          getCollectionBytes(int index) {
        return collection_.getByteString(index);
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public Builder setCollection(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureCollectionIsMutable();
        collection_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public Builder addCollection(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureCollectionIsMutable();
        collection_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public Builder addAllCollection(
          java.lang.Iterable<java.lang.String> values) {
        ensureCollectionIsMutable();
        super.addAll(values, collection_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public Builder clearCollection() {
        collection_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000200);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string collection = 8;</code>
       */
      public Builder addCollectionBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureCollectionIsMutable();
        collection_.add(value);
        onChanged();
        return this;
      }

      // optional string sourcePath = 9;
      private java.lang.Object sourcePath_ = "";
      /**
       * <code>optional string sourcePath = 9;</code>
       */
      public boolean hasSourcePath() {
        return ((bitField0_ & 0x00000400) == 0x00000400);
      }
      /**
       * <code>optional string sourcePath = 9;</code>
       */
      public java.lang.String getSourcePath() {
        java.lang.Object ref = sourcePath_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          sourcePath_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string sourcePath = 9;</code>
       */
      public com.google.protobuf.ByteString
          getSourcePathBytes() {
        java.lang.Object ref = sourcePath_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          sourcePath_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string sourcePath = 9;</code>
       */
      public Builder setSourcePath(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000400;
        sourcePath_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string sourcePath = 9;</code>
       */
      public Builder clearSourcePath() {
        bitField0_ = (bitField0_ & ~0x00000400);
        sourcePath_ = getDefaultInstance().getSourcePath();
        onChanged();
        return this;
      }
      /**
       * <code>optional string sourcePath = 9;</code>
       */
      public Builder setSourcePathBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000400;
        sourcePath_ = value;
        onChanged();
        return this;
      }

      // repeated string origKey = 11;
      private com.google.protobuf.LazyStringList origKey_ = com.google.protobuf.LazyStringArrayList.EMPTY;
      private void ensureOrigKeyIsMutable() {
        if (!((bitField0_ & 0x00000800) == 0x00000800)) {
          origKey_ = new com.google.protobuf.LazyStringArrayList(origKey_);
          bitField0_ |= 0x00000800;
         }
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public java.util.List<java.lang.String>
          getOrigKeyList() {
        return java.util.Collections.unmodifiableList(origKey_);
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public int getOrigKeyCount() {
        return origKey_.size();
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public java.lang.String getOrigKey(int index) {
        return origKey_.get(index);
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public com.google.protobuf.ByteString
          getOrigKeyBytes(int index) {
        return origKey_.getByteString(index);
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public Builder setOrigKey(
          int index, java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureOrigKeyIsMutable();
        origKey_.set(index, value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public Builder addOrigKey(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureOrigKeyIsMutable();
        origKey_.add(value);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public Builder addAllOrigKey(
          java.lang.Iterable<java.lang.String> values) {
        ensureOrigKeyIsMutable();
        super.addAll(values, origKey_);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public Builder clearOrigKey() {
        origKey_ = com.google.protobuf.LazyStringArrayList.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000800);
        onChanged();
        return this;
      }
      /**
       * <code>repeated string origKey = 11;</code>
       */
      public Builder addOrigKeyBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  ensureOrigKeyIsMutable();
        origKey_.add(value);
        onChanged();
        return this;
      }

      // optional .DocumentMetadata.Type type = 21 [default = ARTICLE];
      private pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type type_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type.ARTICLE;
      /**
       * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
       */
      public boolean hasType() {
        return ((bitField0_ & 0x00001000) == 0x00001000);
      }
      /**
       * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type getType() {
        return type_;
      }
      /**
       * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
       */
      public Builder setType(pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type value) {
        if (value == null) {
          throw new NullPointerException();
        }
        bitField0_ |= 0x00001000;
        type_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional .DocumentMetadata.Type type = 21 [default = ARTICLE];</code>
       */
      public Builder clearType() {
        bitField0_ = (bitField0_ & ~0x00001000);
        type_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Type.ARTICLE;
        onChanged();
        return this;
      }

      // @@protoc_insertion_point(builder_scope:DocumentMetadata)
    }

    static {
      defaultInstance = new DocumentMetadata(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:DocumentMetadata)
  }

  public interface ReferenceMetadataOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required .BasicMetadata basicMetadata = 1;
    /**
     * <code>required .BasicMetadata basicMetadata = 1;</code>
     */
    boolean hasBasicMetadata();
    /**
     * <code>required .BasicMetadata basicMetadata = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata getBasicMetadata();
    /**
     * <code>required .BasicMetadata basicMetadata = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder getBasicMetadataOrBuilder();

    // optional string sourceDocKey = 2;
    /**
     * <code>optional string sourceDocKey = 2;</code>
     */
    boolean hasSourceDocKey();
    /**
     * <code>optional string sourceDocKey = 2;</code>
     */
    java.lang.String getSourceDocKey();
    /**
     * <code>optional string sourceDocKey = 2;</code>
     */
    com.google.protobuf.ByteString
        getSourceDocKeyBytes();

    // optional int32 position = 3;
    /**
     * <code>optional int32 position = 3;</code>
     */
    boolean hasPosition();
    /**
     * <code>optional int32 position = 3;</code>
     */
    int getPosition();

    // optional string rawCitationText = 4;
    /**
     * <code>optional string rawCitationText = 4;</code>
     */
    boolean hasRawCitationText();
    /**
     * <code>optional string rawCitationText = 4;</code>
     */
    java.lang.String getRawCitationText();
    /**
     * <code>optional string rawCitationText = 4;</code>
     */
    com.google.protobuf.ByteString
        getRawCitationTextBytes();

    // repeated .KeyValue extId = 5;
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> 
        getExtIdList();
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index);
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    int getExtIdCount();
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getExtIdOrBuilderList();
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
        int index);
  }
  /**
   * Protobuf type {@code ReferenceMetadata}
   *
   * <pre>
   * position -- citation's position in reference list, starting by 1
   * </pre>
   */
  public static final class ReferenceMetadata extends
      com.google.protobuf.GeneratedMessage
      implements ReferenceMetadataOrBuilder {
    // Use ReferenceMetadata.newBuilder() to construct.
    private ReferenceMetadata(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private ReferenceMetadata(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final ReferenceMetadata defaultInstance;
    public static ReferenceMetadata getDefaultInstance() {
      return defaultInstance;
    }

    public ReferenceMetadata getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private ReferenceMetadata(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder subBuilder = null;
              if (((bitField0_ & 0x00000001) == 0x00000001)) {
                subBuilder = basicMetadata_.toBuilder();
              }
              basicMetadata_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(basicMetadata_);
                basicMetadata_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000001;
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              sourceDocKey_ = input.readBytes();
              break;
            }
            case 24: {
              bitField0_ |= 0x00000004;
              position_ = input.readInt32();
              break;
            }
            case 34: {
              bitField0_ |= 0x00000008;
              rawCitationText_ = input.readBytes();
              break;
            }
            case 42: {
              if (!((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
                extId_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>();
                mutable_bitField0_ |= 0x00000010;
              }
              extId_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.KeyValue.PARSER, extensionRegistry));
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000010) == 0x00000010)) {
          extId_ = java.util.Collections.unmodifiableList(extId_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ReferenceMetadata_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ReferenceMetadata_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.class, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder.class);
    }

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

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

    private int bitField0_;
    // required .BasicMetadata basicMetadata = 1;
    public static final int BASICMETADATA_FIELD_NUMBER = 1;
    private pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata basicMetadata_;
    /**
     * <code>required .BasicMetadata basicMetadata = 1;</code>
     */
    public boolean hasBasicMetadata() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required .BasicMetadata basicMetadata = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata getBasicMetadata() {
      return basicMetadata_;
    }
    /**
     * <code>required .BasicMetadata basicMetadata = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder getBasicMetadataOrBuilder() {
      return basicMetadata_;
    }

    // optional string sourceDocKey = 2;
    public static final int SOURCEDOCKEY_FIELD_NUMBER = 2;
    private java.lang.Object sourceDocKey_;
    /**
     * <code>optional string sourceDocKey = 2;</code>
     */
    public boolean hasSourceDocKey() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional string sourceDocKey = 2;</code>
     */
    public java.lang.String getSourceDocKey() {
      java.lang.Object ref = sourceDocKey_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          sourceDocKey_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string sourceDocKey = 2;</code>
     */
    public com.google.protobuf.ByteString
        getSourceDocKeyBytes() {
      java.lang.Object ref = sourceDocKey_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        sourceDocKey_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional int32 position = 3;
    public static final int POSITION_FIELD_NUMBER = 3;
    private int position_;
    /**
     * <code>optional int32 position = 3;</code>
     */
    public boolean hasPosition() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional int32 position = 3;</code>
     */
    public int getPosition() {
      return position_;
    }

    // optional string rawCitationText = 4;
    public static final int RAWCITATIONTEXT_FIELD_NUMBER = 4;
    private java.lang.Object rawCitationText_;
    /**
     * <code>optional string rawCitationText = 4;</code>
     */
    public boolean hasRawCitationText() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional string rawCitationText = 4;</code>
     */
    public java.lang.String getRawCitationText() {
      java.lang.Object ref = rawCitationText_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          rawCitationText_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string rawCitationText = 4;</code>
     */
    public com.google.protobuf.ByteString
        getRawCitationTextBytes() {
      java.lang.Object ref = rawCitationText_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        rawCitationText_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // repeated .KeyValue extId = 5;
    public static final int EXTID_FIELD_NUMBER = 5;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> extId_;
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getExtIdList() {
      return extId_;
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
        getExtIdOrBuilderList() {
      return extId_;
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public int getExtIdCount() {
      return extId_.size();
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index) {
      return extId_.get(index);
    }
    /**
     * <code>repeated .KeyValue extId = 5;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
        int index) {
      return extId_.get(index);
    }

    private void initFields() {
      basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
      sourceDocKey_ = "";
      position_ = 0;
      rawCitationText_ = "";
      extId_ = java.util.Collections.emptyList();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasBasicMetadata()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!getBasicMetadata().isInitialized()) {
        memoizedIsInitialized = 0;
        return false;
      }
      for (int i = 0; i < getExtIdCount(); i++) {
        if (!getExtId(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeMessage(1, basicMetadata_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getSourceDocKeyBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeInt32(3, position_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeBytes(4, getRawCitationTextBytes());
      }
      for (int i = 0; i < extId_.size(); i++) {
        output.writeMessage(5, extId_.get(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, basicMetadata_);
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getSourceDocKeyBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt32Size(3, position_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(4, getRawCitationTextBytes());
      }
      for (int i = 0; i < extId_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(5, extId_.get(i));
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code ReferenceMetadata}
     *
     * <pre>
     * position -- citation's position in reference list, starting by 1
     * </pre>
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadataOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ReferenceMetadata_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ReferenceMetadata_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.class, pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getBasicMetadataFieldBuilder();
          getExtIdFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        if (basicMetadataBuilder_ == null) {
          basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
        } else {
          basicMetadataBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000001);
        sourceDocKey_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        position_ = 0;
        bitField0_ = (bitField0_ & ~0x00000004);
        rawCitationText_ = "";
        bitField0_ = (bitField0_ & ~0x00000008);
        if (extIdBuilder_ == null) {
          extId_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
        } else {
          extIdBuilder_.clear();
        }
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_ReferenceMetadata_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata build() {
        pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata result = new pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        if (basicMetadataBuilder_ == null) {
          result.basicMetadata_ = basicMetadata_;
        } else {
          result.basicMetadata_ = basicMetadataBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.sourceDocKey_ = sourceDocKey_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.position_ = position_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.rawCitationText_ = rawCitationText_;
        if (extIdBuilder_ == null) {
          if (((bitField0_ & 0x00000010) == 0x00000010)) {
            extId_ = java.util.Collections.unmodifiableList(extId_);
            bitField0_ = (bitField0_ & ~0x00000010);
          }
          result.extId_ = extId_;
        } else {
          result.extId_ = extIdBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata.getDefaultInstance()) return this;
        if (other.hasBasicMetadata()) {
          mergeBasicMetadata(other.getBasicMetadata());
        }
        if (other.hasSourceDocKey()) {
          bitField0_ |= 0x00000002;
          sourceDocKey_ = other.sourceDocKey_;
          onChanged();
        }
        if (other.hasPosition()) {
          setPosition(other.getPosition());
        }
        if (other.hasRawCitationText()) {
          bitField0_ |= 0x00000008;
          rawCitationText_ = other.rawCitationText_;
          onChanged();
        }
        if (extIdBuilder_ == null) {
          if (!other.extId_.isEmpty()) {
            if (extId_.isEmpty()) {
              extId_ = other.extId_;
              bitField0_ = (bitField0_ & ~0x00000010);
            } else {
              ensureExtIdIsMutable();
              extId_.addAll(other.extId_);
            }
            onChanged();
          }
        } else {
          if (!other.extId_.isEmpty()) {
            if (extIdBuilder_.isEmpty()) {
              extIdBuilder_.dispose();
              extIdBuilder_ = null;
              extId_ = other.extId_;
              bitField0_ = (bitField0_ & ~0x00000010);
              extIdBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getExtIdFieldBuilder() : null;
            } else {
              extIdBuilder_.addAllMessages(other.extId_);
            }
          }
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasBasicMetadata()) {
          
          return false;
        }
        if (!getBasicMetadata().isInitialized()) {
          
          return false;
        }
        for (int i = 0; i < getExtIdCount(); i++) {
          if (!getExtId(i).isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.ReferenceMetadata) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required .BasicMetadata basicMetadata = 1;
      private pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder> basicMetadataBuilder_;
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public boolean hasBasicMetadata() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata getBasicMetadata() {
        if (basicMetadataBuilder_ == null) {
          return basicMetadata_;
        } else {
          return basicMetadataBuilder_.getMessage();
        }
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public Builder setBasicMetadata(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata value) {
        if (basicMetadataBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          basicMetadata_ = value;
          onChanged();
        } else {
          basicMetadataBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public Builder setBasicMetadata(
          pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder builderForValue) {
        if (basicMetadataBuilder_ == null) {
          basicMetadata_ = builderForValue.build();
          onChanged();
        } else {
          basicMetadataBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public Builder mergeBasicMetadata(pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata value) {
        if (basicMetadataBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001) &&
              basicMetadata_ != pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance()) {
            basicMetadata_ =
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.newBuilder(basicMetadata_).mergeFrom(value).buildPartial();
          } else {
            basicMetadata_ = value;
          }
          onChanged();
        } else {
          basicMetadataBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000001;
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public Builder clearBasicMetadata() {
        if (basicMetadataBuilder_ == null) {
          basicMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.getDefaultInstance();
          onChanged();
        } else {
          basicMetadataBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000001);
        return this;
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder getBasicMetadataBuilder() {
        bitField0_ |= 0x00000001;
        onChanged();
        return getBasicMetadataFieldBuilder().getBuilder();
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder getBasicMetadataOrBuilder() {
        if (basicMetadataBuilder_ != null) {
          return basicMetadataBuilder_.getMessageOrBuilder();
        } else {
          return basicMetadata_;
        }
      }
      /**
       * <code>required .BasicMetadata basicMetadata = 1;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder> 
          getBasicMetadataFieldBuilder() {
        if (basicMetadataBuilder_ == null) {
          basicMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.BasicMetadataOrBuilder>(
                  basicMetadata_,
                  getParentForChildren(),
                  isClean());
          basicMetadata_ = null;
        }
        return basicMetadataBuilder_;
      }

      // optional string sourceDocKey = 2;
      private java.lang.Object sourceDocKey_ = "";
      /**
       * <code>optional string sourceDocKey = 2;</code>
       */
      public boolean hasSourceDocKey() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional string sourceDocKey = 2;</code>
       */
      public java.lang.String getSourceDocKey() {
        java.lang.Object ref = sourceDocKey_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          sourceDocKey_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string sourceDocKey = 2;</code>
       */
      public com.google.protobuf.ByteString
          getSourceDocKeyBytes() {
        java.lang.Object ref = sourceDocKey_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          sourceDocKey_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string sourceDocKey = 2;</code>
       */
      public Builder setSourceDocKey(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        sourceDocKey_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string sourceDocKey = 2;</code>
       */
      public Builder clearSourceDocKey() {
        bitField0_ = (bitField0_ & ~0x00000002);
        sourceDocKey_ = getDefaultInstance().getSourceDocKey();
        onChanged();
        return this;
      }
      /**
       * <code>optional string sourceDocKey = 2;</code>
       */
      public Builder setSourceDocKeyBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        sourceDocKey_ = value;
        onChanged();
        return this;
      }

      // optional int32 position = 3;
      private int position_ ;
      /**
       * <code>optional int32 position = 3;</code>
       */
      public boolean hasPosition() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional int32 position = 3;</code>
       */
      public int getPosition() {
        return position_;
      }
      /**
       * <code>optional int32 position = 3;</code>
       */
      public Builder setPosition(int value) {
        bitField0_ |= 0x00000004;
        position_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int32 position = 3;</code>
       */
      public Builder clearPosition() {
        bitField0_ = (bitField0_ & ~0x00000004);
        position_ = 0;
        onChanged();
        return this;
      }

      // optional string rawCitationText = 4;
      private java.lang.Object rawCitationText_ = "";
      /**
       * <code>optional string rawCitationText = 4;</code>
       */
      public boolean hasRawCitationText() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional string rawCitationText = 4;</code>
       */
      public java.lang.String getRawCitationText() {
        java.lang.Object ref = rawCitationText_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          rawCitationText_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string rawCitationText = 4;</code>
       */
      public com.google.protobuf.ByteString
          getRawCitationTextBytes() {
        java.lang.Object ref = rawCitationText_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          rawCitationText_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string rawCitationText = 4;</code>
       */
      public Builder setRawCitationText(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        rawCitationText_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string rawCitationText = 4;</code>
       */
      public Builder clearRawCitationText() {
        bitField0_ = (bitField0_ & ~0x00000008);
        rawCitationText_ = getDefaultInstance().getRawCitationText();
        onChanged();
        return this;
      }
      /**
       * <code>optional string rawCitationText = 4;</code>
       */
      public Builder setRawCitationTextBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        rawCitationText_ = value;
        onChanged();
        return this;
      }

      // repeated .KeyValue extId = 5;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> extId_ =
        java.util.Collections.emptyList();
      private void ensureExtIdIsMutable() {
        if (!((bitField0_ & 0x00000010) == 0x00000010)) {
          extId_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.KeyValue>(extId_);
          bitField0_ |= 0x00000010;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> extIdBuilder_;

      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue> getExtIdList() {
        if (extIdBuilder_ == null) {
          return java.util.Collections.unmodifiableList(extId_);
        } else {
          return extIdBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public int getExtIdCount() {
        if (extIdBuilder_ == null) {
          return extId_.size();
        } else {
          return extIdBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue getExtId(int index) {
        if (extIdBuilder_ == null) {
          return extId_.get(index);
        } else {
          return extIdBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder setExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.set(index, value);
          onChanged();
        } else {
          extIdBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder setExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.set(index, builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.add(value);
          onChanged();
        } else {
          extIdBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue value) {
        if (extIdBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureExtIdIsMutable();
          extId_.add(index, value);
          onChanged();
        } else {
          extIdBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.add(builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addExtId(
          int index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder builderForValue) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.add(index, builderForValue.build());
          onChanged();
        } else {
          extIdBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder addAllExtId(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValue> values) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          super.addAll(values, extId_);
          onChanged();
        } else {
          extIdBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder clearExtId() {
        if (extIdBuilder_ == null) {
          extId_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000010);
          onChanged();
        } else {
          extIdBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public Builder removeExtId(int index) {
        if (extIdBuilder_ == null) {
          ensureExtIdIsMutable();
          extId_.remove(index);
          onChanged();
        } else {
          extIdBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder getExtIdBuilder(
          int index) {
        return getExtIdFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder getExtIdOrBuilder(
          int index) {
        if (extIdBuilder_ == null) {
          return extId_.get(index);  } else {
          return extIdBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
           getExtIdOrBuilderList() {
        if (extIdBuilder_ != null) {
          return extIdBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(extId_);
        }
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addExtIdBuilder() {
        return getExtIdFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder addExtIdBuilder(
          int index) {
        return getExtIdFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.getDefaultInstance());
      }
      /**
       * <code>repeated .KeyValue extId = 5;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder> 
           getExtIdBuilderList() {
        return getExtIdFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder> 
          getExtIdFieldBuilder() {
        if (extIdBuilder_ == null) {
          extIdBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.KeyValue, pl.edu.icm.coansys.models.DocumentProtos.KeyValue.Builder, pl.edu.icm.coansys.models.DocumentProtos.KeyValueOrBuilder>(
                  extId_,
                  ((bitField0_ & 0x00000010) == 0x00000010),
                  getParentForChildren(),
                  isClean());
          extId_ = null;
        }
        return extIdBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:ReferenceMetadata)
    }

    static {
      defaultInstance = new ReferenceMetadata(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:ReferenceMetadata)
  }

  public interface MediaOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string key = 1;
    /**
     * <code>required string key = 1;</code>
     */
    boolean hasKey();
    /**
     * <code>required string key = 1;</code>
     */
    java.lang.String getKey();
    /**
     * <code>required string key = 1;</code>
     */
    com.google.protobuf.ByteString
        getKeyBytes();

    // required string mediaType = 2;
    /**
     * <code>required string mediaType = 2;</code>
     */
    boolean hasMediaType();
    /**
     * <code>required string mediaType = 2;</code>
     */
    java.lang.String getMediaType();
    /**
     * <code>required string mediaType = 2;</code>
     */
    com.google.protobuf.ByteString
        getMediaTypeBytes();

    // required bytes content = 3;
    /**
     * <code>required bytes content = 3;</code>
     */
    boolean hasContent();
    /**
     * <code>required bytes content = 3;</code>
     */
    com.google.protobuf.ByteString getContent();

    // optional string collection = 4;
    /**
     * <code>optional string collection = 4;</code>
     */
    boolean hasCollection();
    /**
     * <code>optional string collection = 4;</code>
     */
    java.lang.String getCollection();
    /**
     * <code>optional string collection = 4;</code>
     */
    com.google.protobuf.ByteString
        getCollectionBytes();

    // optional string sourcePath = 5;
    /**
     * <code>optional string sourcePath = 5;</code>
     */
    boolean hasSourcePath();
    /**
     * <code>optional string sourcePath = 5;</code>
     */
    java.lang.String getSourcePath();
    /**
     * <code>optional string sourcePath = 5;</code>
     */
    com.google.protobuf.ByteString
        getSourcePathBytes();

    // optional int64 sourceFilesize = 6;
    /**
     * <code>optional int64 sourceFilesize = 6;</code>
     */
    boolean hasSourceFilesize();
    /**
     * <code>optional int64 sourceFilesize = 6;</code>
     */
    long getSourceFilesize();

    // optional string destinationPath = 7;
    /**
     * <code>optional string destinationPath = 7;</code>
     */
    boolean hasDestinationPath();
    /**
     * <code>optional string destinationPath = 7;</code>
     */
    java.lang.String getDestinationPath();
    /**
     * <code>optional string destinationPath = 7;</code>
     */
    com.google.protobuf.ByteString
        getDestinationPathBytes();

    // optional .ProvenanceInfo provenance = 8;
    /**
     * <code>optional .ProvenanceInfo provenance = 8;</code>
     */
    boolean hasProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 8;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance();
    /**
     * <code>optional .ProvenanceInfo provenance = 8;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder();
  }
  /**
   * Protobuf type {@code Media}
   *
   * <pre>
   * key -- same as in DocumentMetadata
   * mediaType -- "media.type.pdf", "media.type.txt" etc.; defined in ProtoConstants class
   * destinationPath -- probably unused
   * </pre>
   */
  public static final class Media extends
      com.google.protobuf.GeneratedMessage
      implements MediaOrBuilder {
    // Use Media.newBuilder() to construct.
    private Media(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private Media(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final Media defaultInstance;
    public static Media getDefaultInstance() {
      return defaultInstance;
    }

    public Media getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private Media(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              key_ = input.readBytes();
              break;
            }
            case 18: {
              bitField0_ |= 0x00000002;
              mediaType_ = input.readBytes();
              break;
            }
            case 26: {
              bitField0_ |= 0x00000004;
              content_ = input.readBytes();
              break;
            }
            case 34: {
              bitField0_ |= 0x00000008;
              collection_ = input.readBytes();
              break;
            }
            case 42: {
              bitField0_ |= 0x00000010;
              sourcePath_ = input.readBytes();
              break;
            }
            case 48: {
              bitField0_ |= 0x00000020;
              sourceFilesize_ = input.readInt64();
              break;
            }
            case 58: {
              bitField0_ |= 0x00000040;
              destinationPath_ = input.readBytes();
              break;
            }
            case 66: {
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder subBuilder = null;
              if (((bitField0_ & 0x00000080) == 0x00000080)) {
                subBuilder = provenance_.toBuilder();
              }
              provenance_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(provenance_);
                provenance_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000080;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Media_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Media_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.Media.class, pl.edu.icm.coansys.models.DocumentProtos.Media.Builder.class);
    }

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

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

    private int bitField0_;
    // required string key = 1;
    public static final int KEY_FIELD_NUMBER = 1;
    private java.lang.Object key_;
    /**
     * <code>required string key = 1;</code>
     */
    public boolean hasKey() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string key = 1;</code>
     */
    public java.lang.String getKey() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          key_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string key = 1;</code>
     */
    public com.google.protobuf.ByteString
        getKeyBytes() {
      java.lang.Object ref = key_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        key_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required string mediaType = 2;
    public static final int MEDIATYPE_FIELD_NUMBER = 2;
    private java.lang.Object mediaType_;
    /**
     * <code>required string mediaType = 2;</code>
     */
    public boolean hasMediaType() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required string mediaType = 2;</code>
     */
    public java.lang.String getMediaType() {
      java.lang.Object ref = mediaType_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          mediaType_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string mediaType = 2;</code>
     */
    public com.google.protobuf.ByteString
        getMediaTypeBytes() {
      java.lang.Object ref = mediaType_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        mediaType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // required bytes content = 3;
    public static final int CONTENT_FIELD_NUMBER = 3;
    private com.google.protobuf.ByteString content_;
    /**
     * <code>required bytes content = 3;</code>
     */
    public boolean hasContent() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>required bytes content = 3;</code>
     */
    public com.google.protobuf.ByteString getContent() {
      return content_;
    }

    // optional string collection = 4;
    public static final int COLLECTION_FIELD_NUMBER = 4;
    private java.lang.Object collection_;
    /**
     * <code>optional string collection = 4;</code>
     */
    public boolean hasCollection() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>optional string collection = 4;</code>
     */
    public java.lang.String getCollection() {
      java.lang.Object ref = collection_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          collection_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string collection = 4;</code>
     */
    public com.google.protobuf.ByteString
        getCollectionBytes() {
      java.lang.Object ref = collection_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        collection_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional string sourcePath = 5;
    public static final int SOURCEPATH_FIELD_NUMBER = 5;
    private java.lang.Object sourcePath_;
    /**
     * <code>optional string sourcePath = 5;</code>
     */
    public boolean hasSourcePath() {
      return ((bitField0_ & 0x00000010) == 0x00000010);
    }
    /**
     * <code>optional string sourcePath = 5;</code>
     */
    public java.lang.String getSourcePath() {
      java.lang.Object ref = sourcePath_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          sourcePath_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string sourcePath = 5;</code>
     */
    public com.google.protobuf.ByteString
        getSourcePathBytes() {
      java.lang.Object ref = sourcePath_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        sourcePath_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional int64 sourceFilesize = 6;
    public static final int SOURCEFILESIZE_FIELD_NUMBER = 6;
    private long sourceFilesize_;
    /**
     * <code>optional int64 sourceFilesize = 6;</code>
     */
    public boolean hasSourceFilesize() {
      return ((bitField0_ & 0x00000020) == 0x00000020);
    }
    /**
     * <code>optional int64 sourceFilesize = 6;</code>
     */
    public long getSourceFilesize() {
      return sourceFilesize_;
    }

    // optional string destinationPath = 7;
    public static final int DESTINATIONPATH_FIELD_NUMBER = 7;
    private java.lang.Object destinationPath_;
    /**
     * <code>optional string destinationPath = 7;</code>
     */
    public boolean hasDestinationPath() {
      return ((bitField0_ & 0x00000040) == 0x00000040);
    }
    /**
     * <code>optional string destinationPath = 7;</code>
     */
    public java.lang.String getDestinationPath() {
      java.lang.Object ref = destinationPath_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          destinationPath_ = s;
        }
        return s;
      }
    }
    /**
     * <code>optional string destinationPath = 7;</code>
     */
    public com.google.protobuf.ByteString
        getDestinationPathBytes() {
      java.lang.Object ref = destinationPath_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        destinationPath_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional .ProvenanceInfo provenance = 8;
    public static final int PROVENANCE_FIELD_NUMBER = 8;
    private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_;
    /**
     * <code>optional .ProvenanceInfo provenance = 8;</code>
     */
    public boolean hasProvenance() {
      return ((bitField0_ & 0x00000080) == 0x00000080);
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 8;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
      return provenance_;
    }
    /**
     * <code>optional .ProvenanceInfo provenance = 8;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
      return provenance_;
    }

    private void initFields() {
      key_ = "";
      mediaType_ = "";
      content_ = com.google.protobuf.ByteString.EMPTY;
      collection_ = "";
      sourcePath_ = "";
      sourceFilesize_ = 0L;
      destinationPath_ = "";
      provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasKey()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasMediaType()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (!hasContent()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (hasProvenance()) {
        if (!getProvenance().isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeBytes(2, getMediaTypeBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeBytes(3, content_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        output.writeBytes(4, getCollectionBytes());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        output.writeBytes(5, getSourcePathBytes());
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        output.writeInt64(6, sourceFilesize_);
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        output.writeBytes(7, getDestinationPathBytes());
      }
      if (((bitField0_ & 0x00000080) == 0x00000080)) {
        output.writeMessage(8, provenance_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getKeyBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(2, getMediaTypeBytes());
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(3, content_);
      }
      if (((bitField0_ & 0x00000008) == 0x00000008)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(4, getCollectionBytes());
      }
      if (((bitField0_ & 0x00000010) == 0x00000010)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(5, getSourcePathBytes());
      }
      if (((bitField0_ & 0x00000020) == 0x00000020)) {
        size += com.google.protobuf.CodedOutputStream
          .computeInt64Size(6, sourceFilesize_);
      }
      if (((bitField0_ & 0x00000040) == 0x00000040)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(7, getDestinationPathBytes());
      }
      if (((bitField0_ & 0x00000080) == 0x00000080)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(8, provenance_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.Media parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.Media prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code Media}
     *
     * <pre>
     * key -- same as in DocumentMetadata
     * mediaType -- "media.type.pdf", "media.type.txt" etc.; defined in ProtoConstants class
     * destinationPath -- probably unused
     * </pre>
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Media_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Media_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.Media.class, pl.edu.icm.coansys.models.DocumentProtos.Media.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.Media.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getProvenanceFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        key_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        mediaType_ = "";
        bitField0_ = (bitField0_ & ~0x00000002);
        content_ = com.google.protobuf.ByteString.EMPTY;
        bitField0_ = (bitField0_ & ~0x00000004);
        collection_ = "";
        bitField0_ = (bitField0_ & ~0x00000008);
        sourcePath_ = "";
        bitField0_ = (bitField0_ & ~0x00000010);
        sourceFilesize_ = 0L;
        bitField0_ = (bitField0_ & ~0x00000020);
        destinationPath_ = "";
        bitField0_ = (bitField0_ & ~0x00000040);
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000080);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_Media_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Media getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.Media.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Media build() {
        pl.edu.icm.coansys.models.DocumentProtos.Media result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.Media buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.Media result = new pl.edu.icm.coansys.models.DocumentProtos.Media(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.key_ = key_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        result.mediaType_ = mediaType_;
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        result.content_ = content_;
        if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
          to_bitField0_ |= 0x00000008;
        }
        result.collection_ = collection_;
        if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
          to_bitField0_ |= 0x00000010;
        }
        result.sourcePath_ = sourcePath_;
        if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
          to_bitField0_ |= 0x00000020;
        }
        result.sourceFilesize_ = sourceFilesize_;
        if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
          to_bitField0_ |= 0x00000040;
        }
        result.destinationPath_ = destinationPath_;
        if (((from_bitField0_ & 0x00000080) == 0x00000080)) {
          to_bitField0_ |= 0x00000080;
        }
        if (provenanceBuilder_ == null) {
          result.provenance_ = provenance_;
        } else {
          result.provenance_ = provenanceBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.Media) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.Media)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.Media other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.Media.getDefaultInstance()) return this;
        if (other.hasKey()) {
          bitField0_ |= 0x00000001;
          key_ = other.key_;
          onChanged();
        }
        if (other.hasMediaType()) {
          bitField0_ |= 0x00000002;
          mediaType_ = other.mediaType_;
          onChanged();
        }
        if (other.hasContent()) {
          setContent(other.getContent());
        }
        if (other.hasCollection()) {
          bitField0_ |= 0x00000008;
          collection_ = other.collection_;
          onChanged();
        }
        if (other.hasSourcePath()) {
          bitField0_ |= 0x00000010;
          sourcePath_ = other.sourcePath_;
          onChanged();
        }
        if (other.hasSourceFilesize()) {
          setSourceFilesize(other.getSourceFilesize());
        }
        if (other.hasDestinationPath()) {
          bitField0_ |= 0x00000040;
          destinationPath_ = other.destinationPath_;
          onChanged();
        }
        if (other.hasProvenance()) {
          mergeProvenance(other.getProvenance());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasKey()) {
          
          return false;
        }
        if (!hasMediaType()) {
          
          return false;
        }
        if (!hasContent()) {
          
          return false;
        }
        if (hasProvenance()) {
          if (!getProvenance().isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.Media parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.Media) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string key = 1;
      private java.lang.Object key_ = "";
      /**
       * <code>required string key = 1;</code>
       */
      public boolean hasKey() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string key = 1;</code>
       */
      public java.lang.String getKey() {
        java.lang.Object ref = key_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          key_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public com.google.protobuf.ByteString
          getKeyBytes() {
        java.lang.Object ref = key_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          key_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKey(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder clearKey() {
        bitField0_ = (bitField0_ & ~0x00000001);
        key_ = getDefaultInstance().getKey();
        onChanged();
        return this;
      }
      /**
       * <code>required string key = 1;</code>
       */
      public Builder setKeyBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        key_ = value;
        onChanged();
        return this;
      }

      // required string mediaType = 2;
      private java.lang.Object mediaType_ = "";
      /**
       * <code>required string mediaType = 2;</code>
       */
      public boolean hasMediaType() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>required string mediaType = 2;</code>
       */
      public java.lang.String getMediaType() {
        java.lang.Object ref = mediaType_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          mediaType_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string mediaType = 2;</code>
       */
      public com.google.protobuf.ByteString
          getMediaTypeBytes() {
        java.lang.Object ref = mediaType_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          mediaType_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string mediaType = 2;</code>
       */
      public Builder setMediaType(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        mediaType_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string mediaType = 2;</code>
       */
      public Builder clearMediaType() {
        bitField0_ = (bitField0_ & ~0x00000002);
        mediaType_ = getDefaultInstance().getMediaType();
        onChanged();
        return this;
      }
      /**
       * <code>required string mediaType = 2;</code>
       */
      public Builder setMediaTypeBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000002;
        mediaType_ = value;
        onChanged();
        return this;
      }

      // required bytes content = 3;
      private com.google.protobuf.ByteString content_ = com.google.protobuf.ByteString.EMPTY;
      /**
       * <code>required bytes content = 3;</code>
       */
      public boolean hasContent() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>required bytes content = 3;</code>
       */
      public com.google.protobuf.ByteString getContent() {
        return content_;
      }
      /**
       * <code>required bytes content = 3;</code>
       */
      public Builder setContent(com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000004;
        content_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required bytes content = 3;</code>
       */
      public Builder clearContent() {
        bitField0_ = (bitField0_ & ~0x00000004);
        content_ = getDefaultInstance().getContent();
        onChanged();
        return this;
      }

      // optional string collection = 4;
      private java.lang.Object collection_ = "";
      /**
       * <code>optional string collection = 4;</code>
       */
      public boolean hasCollection() {
        return ((bitField0_ & 0x00000008) == 0x00000008);
      }
      /**
       * <code>optional string collection = 4;</code>
       */
      public java.lang.String getCollection() {
        java.lang.Object ref = collection_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          collection_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string collection = 4;</code>
       */
      public com.google.protobuf.ByteString
          getCollectionBytes() {
        java.lang.Object ref = collection_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          collection_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string collection = 4;</code>
       */
      public Builder setCollection(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        collection_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string collection = 4;</code>
       */
      public Builder clearCollection() {
        bitField0_ = (bitField0_ & ~0x00000008);
        collection_ = getDefaultInstance().getCollection();
        onChanged();
        return this;
      }
      /**
       * <code>optional string collection = 4;</code>
       */
      public Builder setCollectionBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000008;
        collection_ = value;
        onChanged();
        return this;
      }

      // optional string sourcePath = 5;
      private java.lang.Object sourcePath_ = "";
      /**
       * <code>optional string sourcePath = 5;</code>
       */
      public boolean hasSourcePath() {
        return ((bitField0_ & 0x00000010) == 0x00000010);
      }
      /**
       * <code>optional string sourcePath = 5;</code>
       */
      public java.lang.String getSourcePath() {
        java.lang.Object ref = sourcePath_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          sourcePath_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string sourcePath = 5;</code>
       */
      public com.google.protobuf.ByteString
          getSourcePathBytes() {
        java.lang.Object ref = sourcePath_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          sourcePath_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string sourcePath = 5;</code>
       */
      public Builder setSourcePath(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        sourcePath_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string sourcePath = 5;</code>
       */
      public Builder clearSourcePath() {
        bitField0_ = (bitField0_ & ~0x00000010);
        sourcePath_ = getDefaultInstance().getSourcePath();
        onChanged();
        return this;
      }
      /**
       * <code>optional string sourcePath = 5;</code>
       */
      public Builder setSourcePathBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000010;
        sourcePath_ = value;
        onChanged();
        return this;
      }

      // optional int64 sourceFilesize = 6;
      private long sourceFilesize_ ;
      /**
       * <code>optional int64 sourceFilesize = 6;</code>
       */
      public boolean hasSourceFilesize() {
        return ((bitField0_ & 0x00000020) == 0x00000020);
      }
      /**
       * <code>optional int64 sourceFilesize = 6;</code>
       */
      public long getSourceFilesize() {
        return sourceFilesize_;
      }
      /**
       * <code>optional int64 sourceFilesize = 6;</code>
       */
      public Builder setSourceFilesize(long value) {
        bitField0_ |= 0x00000020;
        sourceFilesize_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional int64 sourceFilesize = 6;</code>
       */
      public Builder clearSourceFilesize() {
        bitField0_ = (bitField0_ & ~0x00000020);
        sourceFilesize_ = 0L;
        onChanged();
        return this;
      }

      // optional string destinationPath = 7;
      private java.lang.Object destinationPath_ = "";
      /**
       * <code>optional string destinationPath = 7;</code>
       */
      public boolean hasDestinationPath() {
        return ((bitField0_ & 0x00000040) == 0x00000040);
      }
      /**
       * <code>optional string destinationPath = 7;</code>
       */
      public java.lang.String getDestinationPath() {
        java.lang.Object ref = destinationPath_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          destinationPath_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>optional string destinationPath = 7;</code>
       */
      public com.google.protobuf.ByteString
          getDestinationPathBytes() {
        java.lang.Object ref = destinationPath_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          destinationPath_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>optional string destinationPath = 7;</code>
       */
      public Builder setDestinationPath(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000040;
        destinationPath_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>optional string destinationPath = 7;</code>
       */
      public Builder clearDestinationPath() {
        bitField0_ = (bitField0_ & ~0x00000040);
        destinationPath_ = getDefaultInstance().getDestinationPath();
        onChanged();
        return this;
      }
      /**
       * <code>optional string destinationPath = 7;</code>
       */
      public Builder setDestinationPathBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000040;
        destinationPath_ = value;
        onChanged();
        return this;
      }

      // optional .ProvenanceInfo provenance = 8;
      private pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> provenanceBuilder_;
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public boolean hasProvenance() {
        return ((bitField0_ & 0x00000080) == 0x00000080);
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo getProvenance() {
        if (provenanceBuilder_ == null) {
          return provenance_;
        } else {
          return provenanceBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public Builder setProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          provenance_ = value;
          onChanged();
        } else {
          provenanceBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000080;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public Builder setProvenance(
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder builderForValue) {
        if (provenanceBuilder_ == null) {
          provenance_ = builderForValue.build();
          onChanged();
        } else {
          provenanceBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000080;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public Builder mergeProvenance(pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo value) {
        if (provenanceBuilder_ == null) {
          if (((bitField0_ & 0x00000080) == 0x00000080) &&
              provenance_ != pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance()) {
            provenance_ =
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.newBuilder(provenance_).mergeFrom(value).buildPartial();
          } else {
            provenance_ = value;
          }
          onChanged();
        } else {
          provenanceBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000080;
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public Builder clearProvenance() {
        if (provenanceBuilder_ == null) {
          provenance_ = pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.getDefaultInstance();
          onChanged();
        } else {
          provenanceBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000080);
        return this;
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder getProvenanceBuilder() {
        bitField0_ |= 0x00000080;
        onChanged();
        return getProvenanceFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder getProvenanceOrBuilder() {
        if (provenanceBuilder_ != null) {
          return provenanceBuilder_.getMessageOrBuilder();
        } else {
          return provenance_;
        }
      }
      /**
       * <code>optional .ProvenanceInfo provenance = 8;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder> 
          getProvenanceFieldBuilder() {
        if (provenanceBuilder_ == null) {
          provenanceBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfo.Builder, pl.edu.icm.coansys.models.DocumentProtos.ProvenanceInfoOrBuilder>(
                  provenance_,
                  getParentForChildren(),
                  isClean());
          provenance_ = null;
        }
        return provenanceBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:Media)
    }

    static {
      defaultInstance = new Media(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:Media)
  }

  public interface MediaContainerOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // repeated .Media media = 1;
    /**
     * <code>repeated .Media media = 1;</code>
     */
    java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Media> 
        getMediaList();
    /**
     * <code>repeated .Media media = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.Media getMedia(int index);
    /**
     * <code>repeated .Media media = 1;</code>
     */
    int getMediaCount();
    /**
     * <code>repeated .Media media = 1;</code>
     */
    java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder> 
        getMediaOrBuilderList();
    /**
     * <code>repeated .Media media = 1;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder getMediaOrBuilder(
        int index);
  }
  /**
   * Protobuf type {@code MediaContainer}
   *
   * <pre>
   * a container to pack multiple media entries in a single message (to store in one HBase cell)
   * </pre>
   */
  public static final class MediaContainer extends
      com.google.protobuf.GeneratedMessage
      implements MediaContainerOrBuilder {
    // Use MediaContainer.newBuilder() to construct.
    private MediaContainer(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private MediaContainer(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final MediaContainer defaultInstance;
    public static MediaContainer getDefaultInstance() {
      return defaultInstance;
    }

    public MediaContainer getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private MediaContainer(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
                media_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.Media>();
                mutable_bitField0_ |= 0x00000001;
              }
              media_.add(input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.Media.PARSER, extensionRegistry));
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
          media_ = java.util.Collections.unmodifiableList(media_);
        }
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_MediaContainer_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_MediaContainer_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.class, pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder.class);
    }

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

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

    // repeated .Media media = 1;
    public static final int MEDIA_FIELD_NUMBER = 1;
    private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Media> media_;
    /**
     * <code>repeated .Media media = 1;</code>
     */
    public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Media> getMediaList() {
      return media_;
    }
    /**
     * <code>repeated .Media media = 1;</code>
     */
    public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder> 
        getMediaOrBuilderList() {
      return media_;
    }
    /**
     * <code>repeated .Media media = 1;</code>
     */
    public int getMediaCount() {
      return media_.size();
    }
    /**
     * <code>repeated .Media media = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.Media getMedia(int index) {
      return media_.get(index);
    }
    /**
     * <code>repeated .Media media = 1;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder getMediaOrBuilder(
        int index) {
      return media_.get(index);
    }

    private void initFields() {
      media_ = java.util.Collections.emptyList();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      for (int i = 0; i < getMediaCount(); i++) {
        if (!getMedia(i).isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      for (int i = 0; i < media_.size(); i++) {
        output.writeMessage(1, media_.get(i));
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      for (int i = 0; i < media_.size(); i++) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(1, media_.get(i));
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.MediaContainer prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code MediaContainer}
     *
     * <pre>
     * a container to pack multiple media entries in a single message (to store in one HBase cell)
     * </pre>
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.MediaContainerOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_MediaContainer_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_MediaContainer_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.class, pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getMediaFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        if (mediaBuilder_ == null) {
          media_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
        } else {
          mediaBuilder_.clear();
        }
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_MediaContainer_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.MediaContainer getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.MediaContainer build() {
        pl.edu.icm.coansys.models.DocumentProtos.MediaContainer result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.MediaContainer buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.MediaContainer result = new pl.edu.icm.coansys.models.DocumentProtos.MediaContainer(this);
        int from_bitField0_ = bitField0_;
        if (mediaBuilder_ == null) {
          if (((bitField0_ & 0x00000001) == 0x00000001)) {
            media_ = java.util.Collections.unmodifiableList(media_);
            bitField0_ = (bitField0_ & ~0x00000001);
          }
          result.media_ = media_;
        } else {
          result.media_ = mediaBuilder_.build();
        }
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.MediaContainer) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.MediaContainer)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.MediaContainer other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.getDefaultInstance()) return this;
        if (mediaBuilder_ == null) {
          if (!other.media_.isEmpty()) {
            if (media_.isEmpty()) {
              media_ = other.media_;
              bitField0_ = (bitField0_ & ~0x00000001);
            } else {
              ensureMediaIsMutable();
              media_.addAll(other.media_);
            }
            onChanged();
          }
        } else {
          if (!other.media_.isEmpty()) {
            if (mediaBuilder_.isEmpty()) {
              mediaBuilder_.dispose();
              mediaBuilder_ = null;
              media_ = other.media_;
              bitField0_ = (bitField0_ & ~0x00000001);
              mediaBuilder_ = 
                com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                   getMediaFieldBuilder() : null;
            } else {
              mediaBuilder_.addAllMessages(other.media_);
            }
          }
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        for (int i = 0; i < getMediaCount(); i++) {
          if (!getMedia(i).isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.MediaContainer parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.MediaContainer) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // repeated .Media media = 1;
      private java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Media> media_ =
        java.util.Collections.emptyList();
      private void ensureMediaIsMutable() {
        if (!((bitField0_ & 0x00000001) == 0x00000001)) {
          media_ = new java.util.ArrayList<pl.edu.icm.coansys.models.DocumentProtos.Media>(media_);
          bitField0_ |= 0x00000001;
         }
      }

      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.Media, pl.edu.icm.coansys.models.DocumentProtos.Media.Builder, pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder> mediaBuilder_;

      /**
       * <code>repeated .Media media = 1;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Media> getMediaList() {
        if (mediaBuilder_ == null) {
          return java.util.Collections.unmodifiableList(media_);
        } else {
          return mediaBuilder_.getMessageList();
        }
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public int getMediaCount() {
        if (mediaBuilder_ == null) {
          return media_.size();
        } else {
          return mediaBuilder_.getCount();
        }
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Media getMedia(int index) {
        if (mediaBuilder_ == null) {
          return media_.get(index);
        } else {
          return mediaBuilder_.getMessage(index);
        }
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder setMedia(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Media value) {
        if (mediaBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureMediaIsMutable();
          media_.set(index, value);
          onChanged();
        } else {
          mediaBuilder_.setMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder setMedia(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Media.Builder builderForValue) {
        if (mediaBuilder_ == null) {
          ensureMediaIsMutable();
          media_.set(index, builderForValue.build());
          onChanged();
        } else {
          mediaBuilder_.setMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder addMedia(pl.edu.icm.coansys.models.DocumentProtos.Media value) {
        if (mediaBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureMediaIsMutable();
          media_.add(value);
          onChanged();
        } else {
          mediaBuilder_.addMessage(value);
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder addMedia(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Media value) {
        if (mediaBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          ensureMediaIsMutable();
          media_.add(index, value);
          onChanged();
        } else {
          mediaBuilder_.addMessage(index, value);
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder addMedia(
          pl.edu.icm.coansys.models.DocumentProtos.Media.Builder builderForValue) {
        if (mediaBuilder_ == null) {
          ensureMediaIsMutable();
          media_.add(builderForValue.build());
          onChanged();
        } else {
          mediaBuilder_.addMessage(builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder addMedia(
          int index, pl.edu.icm.coansys.models.DocumentProtos.Media.Builder builderForValue) {
        if (mediaBuilder_ == null) {
          ensureMediaIsMutable();
          media_.add(index, builderForValue.build());
          onChanged();
        } else {
          mediaBuilder_.addMessage(index, builderForValue.build());
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder addAllMedia(
          java.lang.Iterable<? extends pl.edu.icm.coansys.models.DocumentProtos.Media> values) {
        if (mediaBuilder_ == null) {
          ensureMediaIsMutable();
          super.addAll(values, media_);
          onChanged();
        } else {
          mediaBuilder_.addAllMessages(values);
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder clearMedia() {
        if (mediaBuilder_ == null) {
          media_ = java.util.Collections.emptyList();
          bitField0_ = (bitField0_ & ~0x00000001);
          onChanged();
        } else {
          mediaBuilder_.clear();
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public Builder removeMedia(int index) {
        if (mediaBuilder_ == null) {
          ensureMediaIsMutable();
          media_.remove(index);
          onChanged();
        } else {
          mediaBuilder_.remove(index);
        }
        return this;
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Media.Builder getMediaBuilder(
          int index) {
        return getMediaFieldBuilder().getBuilder(index);
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder getMediaOrBuilder(
          int index) {
        if (mediaBuilder_ == null) {
          return media_.get(index);  } else {
          return mediaBuilder_.getMessageOrBuilder(index);
        }
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public java.util.List<? extends pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder> 
           getMediaOrBuilderList() {
        if (mediaBuilder_ != null) {
          return mediaBuilder_.getMessageOrBuilderList();
        } else {
          return java.util.Collections.unmodifiableList(media_);
        }
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Media.Builder addMediaBuilder() {
        return getMediaFieldBuilder().addBuilder(
            pl.edu.icm.coansys.models.DocumentProtos.Media.getDefaultInstance());
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.Media.Builder addMediaBuilder(
          int index) {
        return getMediaFieldBuilder().addBuilder(
            index, pl.edu.icm.coansys.models.DocumentProtos.Media.getDefaultInstance());
      }
      /**
       * <code>repeated .Media media = 1;</code>
       */
      public java.util.List<pl.edu.icm.coansys.models.DocumentProtos.Media.Builder> 
           getMediaBuilderList() {
        return getMediaFieldBuilder().getBuilderList();
      }
      private com.google.protobuf.RepeatedFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.Media, pl.edu.icm.coansys.models.DocumentProtos.Media.Builder, pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder> 
          getMediaFieldBuilder() {
        if (mediaBuilder_ == null) {
          mediaBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.Media, pl.edu.icm.coansys.models.DocumentProtos.Media.Builder, pl.edu.icm.coansys.models.DocumentProtos.MediaOrBuilder>(
                  media_,
                  ((bitField0_ & 0x00000001) == 0x00000001),
                  getParentForChildren(),
                  isClean());
          media_ = null;
        }
        return mediaBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:MediaContainer)
    }

    static {
      defaultInstance = new MediaContainer(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:MediaContainer)
  }

  public interface DocumentWrapperOrBuilder
      extends com.google.protobuf.MessageOrBuilder {

    // required string rowId = 1;
    /**
     * <code>required string rowId = 1;</code>
     */
    boolean hasRowId();
    /**
     * <code>required string rowId = 1;</code>
     */
    java.lang.String getRowId();
    /**
     * <code>required string rowId = 1;</code>
     */
    com.google.protobuf.ByteString
        getRowIdBytes();

    // optional .DocumentMetadata documentMetadata = 2;
    /**
     * <code>optional .DocumentMetadata documentMetadata = 2;</code>
     */
    boolean hasDocumentMetadata();
    /**
     * <code>optional .DocumentMetadata documentMetadata = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata getDocumentMetadata();
    /**
     * <code>optional .DocumentMetadata documentMetadata = 2;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder();

    // optional .MediaContainer mediaContainer = 3;
    /**
     * <code>optional .MediaContainer mediaContainer = 3;</code>
     */
    boolean hasMediaContainer();
    /**
     * <code>optional .MediaContainer mediaContainer = 3;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.MediaContainer getMediaContainer();
    /**
     * <code>optional .MediaContainer mediaContainer = 3;</code>
     */
    pl.edu.icm.coansys.models.DocumentProtos.MediaContainerOrBuilder getMediaContainerOrBuilder();
  }
  /**
   * Protobuf type {@code DocumentWrapper}
   *
   * <pre>
   * used only in sequece files, to store both metadata and media as a single value;
   * rowId -- collection + (if PDF attached) "_PDF" + "_" + documentMetadata.key;
   * </pre>
   */
  public static final class DocumentWrapper extends
      com.google.protobuf.GeneratedMessage
      implements DocumentWrapperOrBuilder {
    // Use DocumentWrapper.newBuilder() to construct.
    private DocumentWrapper(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
      super(builder);
      this.unknownFields = builder.getUnknownFields();
    }
    private DocumentWrapper(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

    private static final DocumentWrapper defaultInstance;
    public static DocumentWrapper getDefaultInstance() {
      return defaultInstance;
    }

    public DocumentWrapper getDefaultInstanceForType() {
      return defaultInstance;
    }

    private final com.google.protobuf.UnknownFieldSet unknownFields;
    @java.lang.Override
    public final com.google.protobuf.UnknownFieldSet
        getUnknownFields() {
      return this.unknownFields;
    }
    private DocumentWrapper(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      initFields();
      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;
            default: {
              if (!parseUnknownField(input, unknownFields,
                                     extensionRegistry, tag)) {
                done = true;
              }
              break;
            }
            case 10: {
              bitField0_ |= 0x00000001;
              rowId_ = input.readBytes();
              break;
            }
            case 18: {
              pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder subBuilder = null;
              if (((bitField0_ & 0x00000002) == 0x00000002)) {
                subBuilder = documentMetadata_.toBuilder();
              }
              documentMetadata_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(documentMetadata_);
                documentMetadata_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000002;
              break;
            }
            case 26: {
              pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder subBuilder = null;
              if (((bitField0_ & 0x00000004) == 0x00000004)) {
                subBuilder = mediaContainer_.toBuilder();
              }
              mediaContainer_ = input.readMessage(pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.PARSER, extensionRegistry);
              if (subBuilder != null) {
                subBuilder.mergeFrom(mediaContainer_);
                mediaContainer_ = subBuilder.buildPartial();
              }
              bitField0_ |= 0x00000004;
              break;
            }
          }
        }
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        throw e.setUnfinishedMessage(this);
      } catch (java.io.IOException e) {
        throw new com.google.protobuf.InvalidProtocolBufferException(
            e.getMessage()).setUnfinishedMessage(this);
      } finally {
        this.unknownFields = unknownFields.build();
        makeExtensionsImmutable();
      }
    }
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentWrapper_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentWrapper_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper.class, pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper.Builder.class);
    }

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

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

    private int bitField0_;
    // required string rowId = 1;
    public static final int ROWID_FIELD_NUMBER = 1;
    private java.lang.Object rowId_;
    /**
     * <code>required string rowId = 1;</code>
     */
    public boolean hasRowId() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string rowId = 1;</code>
     */
    public java.lang.String getRowId() {
      java.lang.Object ref = rowId_;
      if (ref instanceof java.lang.String) {
        return (java.lang.String) ref;
      } else {
        com.google.protobuf.ByteString bs = 
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          rowId_ = s;
        }
        return s;
      }
    }
    /**
     * <code>required string rowId = 1;</code>
     */
    public com.google.protobuf.ByteString
        getRowIdBytes() {
      java.lang.Object ref = rowId_;
      if (ref instanceof java.lang.String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        rowId_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }

    // optional .DocumentMetadata documentMetadata = 2;
    public static final int DOCUMENTMETADATA_FIELD_NUMBER = 2;
    private pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata documentMetadata_;
    /**
     * <code>optional .DocumentMetadata documentMetadata = 2;</code>
     */
    public boolean hasDocumentMetadata() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional .DocumentMetadata documentMetadata = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata getDocumentMetadata() {
      return documentMetadata_;
    }
    /**
     * <code>optional .DocumentMetadata documentMetadata = 2;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder() {
      return documentMetadata_;
    }

    // optional .MediaContainer mediaContainer = 3;
    public static final int MEDIACONTAINER_FIELD_NUMBER = 3;
    private pl.edu.icm.coansys.models.DocumentProtos.MediaContainer mediaContainer_;
    /**
     * <code>optional .MediaContainer mediaContainer = 3;</code>
     */
    public boolean hasMediaContainer() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional .MediaContainer mediaContainer = 3;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.MediaContainer getMediaContainer() {
      return mediaContainer_;
    }
    /**
     * <code>optional .MediaContainer mediaContainer = 3;</code>
     */
    public pl.edu.icm.coansys.models.DocumentProtos.MediaContainerOrBuilder getMediaContainerOrBuilder() {
      return mediaContainer_;
    }

    private void initFields() {
      rowId_ = "";
      documentMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDefaultInstance();
      mediaContainer_ = pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.getDefaultInstance();
    }
    private byte memoizedIsInitialized = -1;
    public final boolean isInitialized() {
      byte isInitialized = memoizedIsInitialized;
      if (isInitialized != -1) return isInitialized == 1;

      if (!hasRowId()) {
        memoizedIsInitialized = 0;
        return false;
      }
      if (hasDocumentMetadata()) {
        if (!getDocumentMetadata().isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      if (hasMediaContainer()) {
        if (!getMediaContainer().isInitialized()) {
          memoizedIsInitialized = 0;
          return false;
        }
      }
      memoizedIsInitialized = 1;
      return true;
    }

    public void writeTo(com.google.protobuf.CodedOutputStream output)
                        throws java.io.IOException {
      getSerializedSize();
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        output.writeBytes(1, getRowIdBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        output.writeMessage(2, documentMetadata_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        output.writeMessage(3, mediaContainer_);
      }
      getUnknownFields().writeTo(output);
    }

    private int memoizedSerializedSize = -1;
    public int getSerializedSize() {
      int size = memoizedSerializedSize;
      if (size != -1) return size;

      size = 0;
      if (((bitField0_ & 0x00000001) == 0x00000001)) {
        size += com.google.protobuf.CodedOutputStream
          .computeBytesSize(1, getRowIdBytes());
      }
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(2, documentMetadata_);
      }
      if (((bitField0_ & 0x00000004) == 0x00000004)) {
        size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(3, mediaContainer_);
      }
      size += getUnknownFields().getSerializedSize();
      memoizedSerializedSize = size;
      return size;
    }

    private static final long serialVersionUID = 0L;
    @java.lang.Override
    protected java.lang.Object writeReplace()
        throws java.io.ObjectStreamException {
      return super.writeReplace();
    }

    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(
        com.google.protobuf.ByteString data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(
        com.google.protobuf.ByteString data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(byte[] data)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(
        byte[] data,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return PARSER.parseFrom(data, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseDelimitedFrom(java.io.InputStream input)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseDelimitedFrom(
        java.io.InputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseDelimitedFrom(input, extensionRegistry);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(
        com.google.protobuf.CodedInputStream input)
        throws java.io.IOException {
      return PARSER.parseFrom(input);
    }
    public static pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parseFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      return PARSER.parseFrom(input, extensionRegistry);
    }

    public static Builder newBuilder() { return Builder.create(); }
    public Builder newBuilderForType() { return newBuilder(); }
    public static Builder newBuilder(pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper prototype) {
      return newBuilder().mergeFrom(prototype);
    }
    public Builder toBuilder() { return newBuilder(this); }

    @java.lang.Override
    protected Builder newBuilderForType(
        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      Builder builder = new Builder(parent);
      return builder;
    }
    /**
     * Protobuf type {@code DocumentWrapper}
     *
     * <pre>
     * used only in sequece files, to store both metadata and media as a single value;
     * rowId -- collection + (if PDF attached) "_PDF" + "_" + documentMetadata.key;
     * </pre>
     */
    public static final class Builder extends
        com.google.protobuf.GeneratedMessage.Builder<Builder>
       implements pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapperOrBuilder {
      public static final com.google.protobuf.Descriptors.Descriptor
          getDescriptor() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentWrapper_descriptor;
      }

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
          internalGetFieldAccessorTable() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentWrapper_fieldAccessorTable
            .ensureFieldAccessorsInitialized(
                pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper.class, pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper.Builder.class);
      }

      // Construct using pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper.newBuilder()
      private Builder() {
        maybeForceBuilderInitialization();
      }

      private Builder(
          com.google.protobuf.GeneratedMessage.BuilderParent parent) {
        super(parent);
        maybeForceBuilderInitialization();
      }
      private void maybeForceBuilderInitialization() {
        if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
          getDocumentMetadataFieldBuilder();
          getMediaContainerFieldBuilder();
        }
      }
      private static Builder create() {
        return new Builder();
      }

      public Builder clear() {
        super.clear();
        rowId_ = "";
        bitField0_ = (bitField0_ & ~0x00000001);
        if (documentMetadataBuilder_ == null) {
          documentMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDefaultInstance();
        } else {
          documentMetadataBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000002);
        if (mediaContainerBuilder_ == null) {
          mediaContainer_ = pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.getDefaultInstance();
        } else {
          mediaContainerBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }

      public Builder clone() {
        return create().mergeFrom(buildPartial());
      }

      public com.google.protobuf.Descriptors.Descriptor
          getDescriptorForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.internal_static_DocumentWrapper_descriptor;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper getDefaultInstanceForType() {
        return pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper.getDefaultInstance();
      }

      public pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper build() {
        pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper result = buildPartial();
        if (!result.isInitialized()) {
          throw newUninitializedMessageException(result);
        }
        return result;
      }

      public pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper buildPartial() {
        pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper result = new pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper(this);
        int from_bitField0_ = bitField0_;
        int to_bitField0_ = 0;
        if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
          to_bitField0_ |= 0x00000001;
        }
        result.rowId_ = rowId_;
        if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
          to_bitField0_ |= 0x00000002;
        }
        if (documentMetadataBuilder_ == null) {
          result.documentMetadata_ = documentMetadata_;
        } else {
          result.documentMetadata_ = documentMetadataBuilder_.build();
        }
        if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
          to_bitField0_ |= 0x00000004;
        }
        if (mediaContainerBuilder_ == null) {
          result.mediaContainer_ = mediaContainer_;
        } else {
          result.mediaContainer_ = mediaContainerBuilder_.build();
        }
        result.bitField0_ = to_bitField0_;
        onBuilt();
        return result;
      }

      public Builder mergeFrom(com.google.protobuf.Message other) {
        if (other instanceof pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper) {
          return mergeFrom((pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper)other);
        } else {
          super.mergeFrom(other);
          return this;
        }
      }

      public Builder mergeFrom(pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper other) {
        if (other == pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper.getDefaultInstance()) return this;
        if (other.hasRowId()) {
          bitField0_ |= 0x00000001;
          rowId_ = other.rowId_;
          onChanged();
        }
        if (other.hasDocumentMetadata()) {
          mergeDocumentMetadata(other.getDocumentMetadata());
        }
        if (other.hasMediaContainer()) {
          mergeMediaContainer(other.getMediaContainer());
        }
        this.mergeUnknownFields(other.getUnknownFields());
        return this;
      }

      public final boolean isInitialized() {
        if (!hasRowId()) {
          
          return false;
        }
        if (hasDocumentMetadata()) {
          if (!getDocumentMetadata().isInitialized()) {
            
            return false;
          }
        }
        if (hasMediaContainer()) {
          if (!getMediaContainer().isInitialized()) {
            
            return false;
          }
        }
        return true;
      }

      public Builder mergeFrom(
          com.google.protobuf.CodedInputStream input,
          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
          throws java.io.IOException {
        pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper parsedMessage = null;
        try {
          parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
        } catch (com.google.protobuf.InvalidProtocolBufferException e) {
          parsedMessage = (pl.edu.icm.coansys.models.DocumentProtos.DocumentWrapper) e.getUnfinishedMessage();
          throw e;
        } finally {
          if (parsedMessage != null) {
            mergeFrom(parsedMessage);
          }
        }
        return this;
      }
      private int bitField0_;

      // required string rowId = 1;
      private java.lang.Object rowId_ = "";
      /**
       * <code>required string rowId = 1;</code>
       */
      public boolean hasRowId() {
        return ((bitField0_ & 0x00000001) == 0x00000001);
      }
      /**
       * <code>required string rowId = 1;</code>
       */
      public java.lang.String getRowId() {
        java.lang.Object ref = rowId_;
        if (!(ref instanceof java.lang.String)) {
          java.lang.String s = ((com.google.protobuf.ByteString) ref)
              .toStringUtf8();
          rowId_ = s;
          return s;
        } else {
          return (java.lang.String) ref;
        }
      }
      /**
       * <code>required string rowId = 1;</code>
       */
      public com.google.protobuf.ByteString
          getRowIdBytes() {
        java.lang.Object ref = rowId_;
        if (ref instanceof String) {
          com.google.protobuf.ByteString b = 
              com.google.protobuf.ByteString.copyFromUtf8(
                  (java.lang.String) ref);
          rowId_ = b;
          return b;
        } else {
          return (com.google.protobuf.ByteString) ref;
        }
      }
      /**
       * <code>required string rowId = 1;</code>
       */
      public Builder setRowId(
          java.lang.String value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        rowId_ = value;
        onChanged();
        return this;
      }
      /**
       * <code>required string rowId = 1;</code>
       */
      public Builder clearRowId() {
        bitField0_ = (bitField0_ & ~0x00000001);
        rowId_ = getDefaultInstance().getRowId();
        onChanged();
        return this;
      }
      /**
       * <code>required string rowId = 1;</code>
       */
      public Builder setRowIdBytes(
          com.google.protobuf.ByteString value) {
        if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
        rowId_ = value;
        onChanged();
        return this;
      }

      // optional .DocumentMetadata documentMetadata = 2;
      private pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata documentMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadataOrBuilder> documentMetadataBuilder_;
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public boolean hasDocumentMetadata() {
        return ((bitField0_ & 0x00000002) == 0x00000002);
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata getDocumentMetadata() {
        if (documentMetadataBuilder_ == null) {
          return documentMetadata_;
        } else {
          return documentMetadataBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public Builder setDocumentMetadata(pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata value) {
        if (documentMetadataBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          documentMetadata_ = value;
          onChanged();
        } else {
          documentMetadataBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public Builder setDocumentMetadata(
          pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder builderForValue) {
        if (documentMetadataBuilder_ == null) {
          documentMetadata_ = builderForValue.build();
          onChanged();
        } else {
          documentMetadataBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public Builder mergeDocumentMetadata(pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata value) {
        if (documentMetadataBuilder_ == null) {
          if (((bitField0_ & 0x00000002) == 0x00000002) &&
              documentMetadata_ != pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDefaultInstance()) {
            documentMetadata_ =
              pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.newBuilder(documentMetadata_).mergeFrom(value).buildPartial();
          } else {
            documentMetadata_ = value;
          }
          onChanged();
        } else {
          documentMetadataBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000002;
        return this;
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public Builder clearDocumentMetadata() {
        if (documentMetadataBuilder_ == null) {
          documentMetadata_ = pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.getDefaultInstance();
          onChanged();
        } else {
          documentMetadataBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000002);
        return this;
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder getDocumentMetadataBuilder() {
        bitField0_ |= 0x00000002;
        onChanged();
        return getDocumentMetadataFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadataOrBuilder getDocumentMetadataOrBuilder() {
        if (documentMetadataBuilder_ != null) {
          return documentMetadataBuilder_.getMessageOrBuilder();
        } else {
          return documentMetadata_;
        }
      }
      /**
       * <code>optional .DocumentMetadata documentMetadata = 2;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadataOrBuilder> 
          getDocumentMetadataFieldBuilder() {
        if (documentMetadataBuilder_ == null) {
          documentMetadataBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadata.Builder, pl.edu.icm.coansys.models.DocumentProtos.DocumentMetadataOrBuilder>(
                  documentMetadata_,
                  getParentForChildren(),
                  isClean());
          documentMetadata_ = null;
        }
        return documentMetadataBuilder_;
      }

      // optional .MediaContainer mediaContainer = 3;
      private pl.edu.icm.coansys.models.DocumentProtos.MediaContainer mediaContainer_ = pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.getDefaultInstance();
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.MediaContainer, pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder, pl.edu.icm.coansys.models.DocumentProtos.MediaContainerOrBuilder> mediaContainerBuilder_;
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public boolean hasMediaContainer() {
        return ((bitField0_ & 0x00000004) == 0x00000004);
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.MediaContainer getMediaContainer() {
        if (mediaContainerBuilder_ == null) {
          return mediaContainer_;
        } else {
          return mediaContainerBuilder_.getMessage();
        }
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public Builder setMediaContainer(pl.edu.icm.coansys.models.DocumentProtos.MediaContainer value) {
        if (mediaContainerBuilder_ == null) {
          if (value == null) {
            throw new NullPointerException();
          }
          mediaContainer_ = value;
          onChanged();
        } else {
          mediaContainerBuilder_.setMessage(value);
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public Builder setMediaContainer(
          pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder builderForValue) {
        if (mediaContainerBuilder_ == null) {
          mediaContainer_ = builderForValue.build();
          onChanged();
        } else {
          mediaContainerBuilder_.setMessage(builderForValue.build());
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public Builder mergeMediaContainer(pl.edu.icm.coansys.models.DocumentProtos.MediaContainer value) {
        if (mediaContainerBuilder_ == null) {
          if (((bitField0_ & 0x00000004) == 0x00000004) &&
              mediaContainer_ != pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.getDefaultInstance()) {
            mediaContainer_ =
              pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.newBuilder(mediaContainer_).mergeFrom(value).buildPartial();
          } else {
            mediaContainer_ = value;
          }
          onChanged();
        } else {
          mediaContainerBuilder_.mergeFrom(value);
        }
        bitField0_ |= 0x00000004;
        return this;
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public Builder clearMediaContainer() {
        if (mediaContainerBuilder_ == null) {
          mediaContainer_ = pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.getDefaultInstance();
          onChanged();
        } else {
          mediaContainerBuilder_.clear();
        }
        bitField0_ = (bitField0_ & ~0x00000004);
        return this;
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder getMediaContainerBuilder() {
        bitField0_ |= 0x00000004;
        onChanged();
        return getMediaContainerFieldBuilder().getBuilder();
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      public pl.edu.icm.coansys.models.DocumentProtos.MediaContainerOrBuilder getMediaContainerOrBuilder() {
        if (mediaContainerBuilder_ != null) {
          return mediaContainerBuilder_.getMessageOrBuilder();
        } else {
          return mediaContainer_;
        }
      }
      /**
       * <code>optional .MediaContainer mediaContainer = 3;</code>
       */
      private com.google.protobuf.SingleFieldBuilder<
          pl.edu.icm.coansys.models.DocumentProtos.MediaContainer, pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder, pl.edu.icm.coansys.models.DocumentProtos.MediaContainerOrBuilder> 
          getMediaContainerFieldBuilder() {
        if (mediaContainerBuilder_ == null) {
          mediaContainerBuilder_ = new com.google.protobuf.SingleFieldBuilder<
              pl.edu.icm.coansys.models.DocumentProtos.MediaContainer, pl.edu.icm.coansys.models.DocumentProtos.MediaContainer.Builder, pl.edu.icm.coansys.models.DocumentProtos.MediaContainerOrBuilder>(
                  mediaContainer_,
                  getParentForChildren(),
                  isClean());
          mediaContainer_ = null;
        }
        return mediaContainerBuilder_;
      }

      // @@protoc_insertion_point(builder_scope:DocumentWrapper)
    }

    static {
      defaultInstance = new DocumentWrapper(true);
      defaultInstance.initFields();
    }

    // @@protoc_insertion_point(class_scope:DocumentWrapper)
  }

  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_ProvenanceInfo_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_ProvenanceInfo_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_ProvenanceInfo_SingleProvenanceInfo_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_ProvenanceInfo_SingleProvenanceInfo_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_KeyValue_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_KeyValue_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_TextWithLanguage_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_TextWithLanguage_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_ClassifCode_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_ClassifCode_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_Affiliation_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_Affiliation_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_Author_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_Author_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_BasicMetadata_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_BasicMetadata_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_KeywordsList_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_KeywordsList_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_DocumentMetadata_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_DocumentMetadata_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_ReferenceMetadata_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_ReferenceMetadata_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_Media_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_Media_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_MediaContainer_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_MediaContainer_fieldAccessorTable;
  private static com.google.protobuf.Descriptors.Descriptor
    internal_static_DocumentWrapper_descriptor;
  private static
    com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internal_static_DocumentWrapper_fieldAccessorTable;

  public static com.google.protobuf.Descriptors.FileDescriptor
      getDescriptor() {
    return descriptor;
  }
  private static com.google.protobuf.Descriptors.FileDescriptor
      descriptor;
  static {
    java.lang.String[] descriptorData = {
      "\n\tbw2.proto\032\035document_similarity_out.pro" +
      "to\"\354\001\n\016ProvenanceInfo\022?\n\021currentProvenan" +
      "ce\030\001 \002(\0132$.ProvenanceInfo.SingleProvenan" +
      "ceInfo\022A\n\023previousProvenances\030\002 \003(\0132$.Pr" +
      "ovenanceInfo.SingleProvenanceInfo\032V\n\024Sin" +
      "gleProvenanceInfo\022 \n\030lastModificationMar" +
      "kerId\030\001 \002(\t\022\034\n\024lastModificationDate\030\002 \002(" +
      "\003\"\\\n\010KeyValue\022\013\n\003key\030\001 \002(\t\022\r\n\005value\030\002 \002(" +
      "\t\022\017\n\007comment\030\003 \001(\t\022#\n\nprovenance\030\004 \001(\0132\017" +
      ".ProvenanceInfo\"C\n\020TextWithLanguage\022\014\n\004t",
      "ext\030\001 \002(\t\022\020\n\010language\030\002 \001(\t\022\017\n\007comment\030\003" +
      " \001(\t\"Q\n\013ClassifCode\022\016\n\006source\030\001 \002(\t\022\r\n\005v" +
      "alue\030\002 \003(\t\022#\n\nprovenance\030\003 \001(\0132\017.Provena" +
      "nceInfo\"\203\001\n\013Affiliation\022\013\n\003key\030\001 \002(\t\022\025\n\r" +
      "affiliationId\030\002 \002(\t\022\014\n\004text\030\003 \002(\t\022#\n\npro" +
      "venance\030\004 \001(\0132\017.ProvenanceInfo\022\035\n\025organi" +
      "zationCurrentId\030\005 \001(\t\"\364\001\n\006Author\022\013\n\003key\030" +
      "\001 \002(\t\022\021\n\tforenames\030\002 \001(\t\022\017\n\007surname\030\003 \001(" +
      "\t\022\014\n\004name\030\004 \001(\t\022\r\n\005email\030\005 \001(\t\022!\n\016affili" +
      "ationRef\030\006 \003(\0132\t.KeyValue\022\r\n\005docId\030\007 \001(\t",
      "\022\026\n\016positionNumber\030\010 \001(\005\022\030\n\005extId\030\t \003(\0132" +
      "\t.KeyValue\022\037\n\014auxiliarInfo\030\n \003(\0132\t.KeyVa" +
      "lue\022\027\n\017currentPersonId\030\013 \001(\t\"\211\003\n\rBasicMe" +
      "tadata\022 \n\005title\030\001 \003(\0132\021.TextWithLanguage" +
      "\022\027\n\006author\030\002 \003(\0132\007.Author\022\013\n\003doi\030\003 \001(\t\022\017" +
      "\n\007journal\030\004 \001(\t\022\014\n\004isbn\030\005 \001(\t\022\014\n\004issn\030\006 " +
      "\001(\t\022\014\n\004year\030\007 \001(\t\022\r\n\005issue\030\010 \001(\t\022\016\n\006volu" +
      "me\030\t \001(\t\022\r\n\005pages\030\n \001(\t\022!\n\013classifCode\030\013" +
      " \003(\0132\014.ClassifCode\022\020\n\010parentId\030\014 \003(\t\022\030\n\020" +
      "currentProjectId\030\r \003(\t\0226\n\nparentType\030\016 \001",
      "(\0162\031.BasicMetadata.ParentType:\007JOURNAL\022\021" +
      "\n\tparentUrl\030\017 \003(\t\"-\n\nParentType\022\013\n\007JOURN" +
      "AL\020\001\022\010\n\004BOOK\020\002\022\010\n\004BLOG\020\003\"v\n\014KeywordsList" +
      "\022\014\n\004type\030\001 \001(\t\022\020\n\010language\030\002 \001(\t\022\020\n\010keyw" +
      "ords\030\003 \003(\t\022\017\n\007comment\030\004 \001(\t\022#\n\nprovenanc" +
      "e\030\005 \001(\0132\017.ProvenanceInfo\"\216\004\n\020DocumentMet" +
      "adata\022\013\n\003key\030\001 \002(\t\022%\n\rbasicMetadata\030\002 \002(" +
      "\0132\016.BasicMetadata\022+\n\020documentAbstract\030\003 " +
      "\003(\0132\021.TextWithLanguage\022\037\n\010keywords\030\n \003(\013" +
      "2\r.KeywordsList\022N\n\023similarDocumentInfo\030\024",
      " \003(\01321.pl.edu.icm.coansys.models.Documen" +
      "tSimilarityInfo\022\030\n\005extId\030\005 \003(\0132\t.KeyValu" +
      "e\022\037\n\014auxiliarInfo\030\006 \003(\0132\t.KeyValue\022\"\n\014af" +
      "filiations\030\014 \003(\0132\014.Affiliation\022%\n\trefere" +
      "nce\030\007 \003(\0132\022.ReferenceMetadata\022\022\n\ncollect" +
      "ion\030\010 \003(\t\022\022\n\nsourcePath\030\t \001(\t\022\017\n\007origKey" +
      "\030\013 \003(\t\022-\n\004type\030\025 \001(\0162\026.DocumentMetadata." +
      "Type:\007ARTICLE\":\n\004Type\022\013\n\007ARTICLE\020\000\022\010\n\004BO" +
      "OK\020\001\022\013\n\007DATASET\020\002\022\016\n\nBLOG_ENTRY\020\003\"\225\001\n\021Re" +
      "ferenceMetadata\022%\n\rbasicMetadata\030\001 \002(\0132\016",
      ".BasicMetadata\022\024\n\014sourceDocKey\030\002 \001(\t\022\020\n\010" +
      "position\030\003 \001(\005\022\027\n\017rawCitationText\030\004 \001(\t\022" +
      "\030\n\005extId\030\005 \003(\0132\t.KeyValue\"\266\001\n\005Media\022\013\n\003k" +
      "ey\030\001 \002(\t\022\021\n\tmediaType\030\002 \002(\t\022\017\n\007content\030\003" +
      " \002(\014\022\022\n\ncollection\030\004 \001(\t\022\022\n\nsourcePath\030\005" +
      " \001(\t\022\026\n\016sourceFilesize\030\006 \001(\003\022\027\n\017destinat" +
      "ionPath\030\007 \001(\t\022#\n\nprovenance\030\010 \001(\0132\017.Prov" +
      "enanceInfo\"\'\n\016MediaContainer\022\025\n\005media\030\001 " +
      "\003(\0132\006.Media\"v\n\017DocumentWrapper\022\r\n\005rowId\030" +
      "\001 \002(\t\022+\n\020documentMetadata\030\002 \001(\0132\021.Docume",
      "ntMetadata\022\'\n\016mediaContainer\030\003 \001(\0132\017.Med" +
      "iaContainerB+\n\031pl.edu.icm.coansys.models" +
      "B\016DocumentProtos"
    };
    com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
      new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() {
        public com.google.protobuf.ExtensionRegistry assignDescriptors(
            com.google.protobuf.Descriptors.FileDescriptor root) {
          descriptor = root;
          internal_static_ProvenanceInfo_descriptor =
            getDescriptor().getMessageTypes().get(0);
          internal_static_ProvenanceInfo_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_ProvenanceInfo_descriptor,
              new java.lang.String[] { "CurrentProvenance", "PreviousProvenances", });
          internal_static_ProvenanceInfo_SingleProvenanceInfo_descriptor =
            internal_static_ProvenanceInfo_descriptor.getNestedTypes().get(0);
          internal_static_ProvenanceInfo_SingleProvenanceInfo_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_ProvenanceInfo_SingleProvenanceInfo_descriptor,
              new java.lang.String[] { "LastModificationMarkerId", "LastModificationDate", });
          internal_static_KeyValue_descriptor =
            getDescriptor().getMessageTypes().get(1);
          internal_static_KeyValue_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_KeyValue_descriptor,
              new java.lang.String[] { "Key", "Value", "Comment", "Provenance", });
          internal_static_TextWithLanguage_descriptor =
            getDescriptor().getMessageTypes().get(2);
          internal_static_TextWithLanguage_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_TextWithLanguage_descriptor,
              new java.lang.String[] { "Text", "Language", "Comment", });
          internal_static_ClassifCode_descriptor =
            getDescriptor().getMessageTypes().get(3);
          internal_static_ClassifCode_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_ClassifCode_descriptor,
              new java.lang.String[] { "Source", "Value", "Provenance", });
          internal_static_Affiliation_descriptor =
            getDescriptor().getMessageTypes().get(4);
          internal_static_Affiliation_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_Affiliation_descriptor,
              new java.lang.String[] { "Key", "AffiliationId", "Text", "Provenance", "OrganizationCurrentId", });
          internal_static_Author_descriptor =
            getDescriptor().getMessageTypes().get(5);
          internal_static_Author_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_Author_descriptor,
              new java.lang.String[] { "Key", "Forenames", "Surname", "Name", "Email", "AffiliationRef", "DocId", "PositionNumber", "ExtId", "AuxiliarInfo", "CurrentPersonId", });
          internal_static_BasicMetadata_descriptor =
            getDescriptor().getMessageTypes().get(6);
          internal_static_BasicMetadata_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_BasicMetadata_descriptor,
              new java.lang.String[] { "Title", "Author", "Doi", "Journal", "Isbn", "Issn", "Year", "Issue", "Volume", "Pages", "ClassifCode", "ParentId", "CurrentProjectId", "ParentType", "ParentUrl", });
          internal_static_KeywordsList_descriptor =
            getDescriptor().getMessageTypes().get(7);
          internal_static_KeywordsList_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_KeywordsList_descriptor,
              new java.lang.String[] { "Type", "Language", "Keywords", "Comment", "Provenance", });
          internal_static_DocumentMetadata_descriptor =
            getDescriptor().getMessageTypes().get(8);
          internal_static_DocumentMetadata_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_DocumentMetadata_descriptor,
              new java.lang.String[] { "Key", "BasicMetadata", "DocumentAbstract", "Keywords", "SimilarDocumentInfo", "ExtId", "AuxiliarInfo", "Affiliations", "Reference", "Collection", "SourcePath", "OrigKey", "Type", });
          internal_static_ReferenceMetadata_descriptor =
            getDescriptor().getMessageTypes().get(9);
          internal_static_ReferenceMetadata_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_ReferenceMetadata_descriptor,
              new java.lang.String[] { "BasicMetadata", "SourceDocKey", "Position", "RawCitationText", "ExtId", });
          internal_static_Media_descriptor =
            getDescriptor().getMessageTypes().get(10);
          internal_static_Media_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_Media_descriptor,
              new java.lang.String[] { "Key", "MediaType", "Content", "Collection", "SourcePath", "SourceFilesize", "DestinationPath", "Provenance", });
          internal_static_MediaContainer_descriptor =
            getDescriptor().getMessageTypes().get(11);
          internal_static_MediaContainer_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_MediaContainer_descriptor,
              new java.lang.String[] { "Media", });
          internal_static_DocumentWrapper_descriptor =
            getDescriptor().getMessageTypes().get(12);
          internal_static_DocumentWrapper_fieldAccessorTable = new
            com.google.protobuf.GeneratedMessage.FieldAccessorTable(
              internal_static_DocumentWrapper_descriptor,
              new java.lang.String[] { "RowId", "DocumentMetadata", "MediaContainer", });
          return null;
        }
      };
    com.google.protobuf.Descriptors.FileDescriptor
      .internalBuildGeneratedFileFrom(descriptorData,
        new com.google.protobuf.Descriptors.FileDescriptor[] {
          pl.edu.icm.coansys.models.DocumentSimilarityProtos.getDescriptor(),
        }, assigner);
  }

  // @@protoc_insertion_point(outer_class_scope)
}
