/*
 Copyright 2013-2015 Jason Leyba

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
 */

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

package com.github.jsdossier.proto;

/**
 * Protobuf type {@code dossier.Index}
 *
 * <pre>
 * Describes how to build the side index for a generated page.
 * </pre>
 */
public final class Index extends
    com.google.protobuf.GeneratedMessage implements
    // @@protoc_insertion_point(message_implements:dossier.Index)
    IndexOrBuilder {
  // Use Index.newBuilder() to construct.
  private Index(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
    super(builder);
    this.unknownFields = builder.getUnknownFields();
  }
  private Index(boolean noInit) { this.unknownFields = com.google.protobuf.UnknownFieldSet.getDefaultInstance(); }

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

  public Index getDefaultInstanceForType() {
    return defaultInstance;
  }

  private final com.google.protobuf.UnknownFieldSet unknownFields;
  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
      getUnknownFields() {
    return this.unknownFields;
  }
  private Index(
      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: {
            com.google.protobuf.ByteString bs = input.readBytes();
            bitField0_ |= 0x00000001;
            home_ = bs;
            break;
          }
          case 16: {
            bitField0_ |= 0x00000002;
            includeTypes_ = input.readBool();
            break;
          }
          case 24: {
            bitField0_ |= 0x00000004;
            includeModules_ = input.readBool();
            break;
          }
          case 34: {
            if (!((mutable_bitField0_ & 0x00000008) == 0x00000008)) {
              links_ = new java.util.ArrayList<com.github.jsdossier.proto.TypeLink>();
              mutable_bitField0_ |= 0x00000008;
            }
            links_.add(input.readMessage(com.github.jsdossier.proto.TypeLink.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_ & 0x00000008) == 0x00000008)) {
        links_ = java.util.Collections.unmodifiableList(links_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return com.github.jsdossier.proto.Dossier.internal_static_dossier_Index_descriptor;
  }

  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return com.github.jsdossier.proto.Dossier.internal_static_dossier_Index_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            com.github.jsdossier.proto.Index.class, com.github.jsdossier.proto.Index.Builder.class);
  }

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

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

  private int bitField0_;
  public static final int HOME_FIELD_NUMBER = 1;
  private java.lang.Object home_;
  /**
   * <code>required string home = 1;</code>
   *
   * <pre>
   * Defines the href from the current page to the main index.
   * </pre>
   */
  public boolean hasHome() {
    return ((bitField0_ & 0x00000001) == 0x00000001);
  }
  /**
   * <code>required string home = 1;</code>
   *
   * <pre>
   * Defines the href from the current page to the main index.
   * </pre>
   */
  public java.lang.String getHome() {
    java.lang.Object ref = home_;
    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()) {
        home_ = s;
      }
      return s;
    }
  }
  /**
   * <code>required string home = 1;</code>
   *
   * <pre>
   * Defines the href from the current page to the main index.
   * </pre>
   */
  public com.google.protobuf.ByteString
      getHomeBytes() {
    java.lang.Object ref = home_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      home_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int INCLUDE_TYPES_FIELD_NUMBER = 2;
  private boolean includeTypes_;
  /**
   * <code>optional bool include_types = 2;</code>
   *
   * <pre>
   * Whether to generate the global type section.
   * </pre>
   */
  public boolean hasIncludeTypes() {
    return ((bitField0_ & 0x00000002) == 0x00000002);
  }
  /**
   * <code>optional bool include_types = 2;</code>
   *
   * <pre>
   * Whether to generate the global type section.
   * </pre>
   */
  public boolean getIncludeTypes() {
    return includeTypes_;
  }

  public static final int INCLUDE_MODULES_FIELD_NUMBER = 3;
  private boolean includeModules_;
  /**
   * <code>optional bool include_modules = 3;</code>
   *
   * <pre>
   * Whether to generate the module type section.
   * </pre>
   */
  public boolean hasIncludeModules() {
    return ((bitField0_ & 0x00000004) == 0x00000004);
  }
  /**
   * <code>optional bool include_modules = 3;</code>
   *
   * <pre>
   * Whether to generate the module type section.
   * </pre>
   */
  public boolean getIncludeModules() {
    return includeModules_;
  }

  public static final int LINKS_FIELD_NUMBER = 4;
  private java.util.List<com.github.jsdossier.proto.TypeLink> links_;
  /**
   * <code>repeated .dossier.TypeLink links = 4;</code>
   *
   * <pre>
   * Additional links to include in the navigation pane.
   * </pre>
   */
  public java.util.List<com.github.jsdossier.proto.TypeLink> getLinksList() {
    return links_;
  }
  /**
   * <code>repeated .dossier.TypeLink links = 4;</code>
   *
   * <pre>
   * Additional links to include in the navigation pane.
   * </pre>
   */
  public java.util.List<? extends com.github.jsdossier.proto.TypeLinkOrBuilder> 
      getLinksOrBuilderList() {
    return links_;
  }
  /**
   * <code>repeated .dossier.TypeLink links = 4;</code>
   *
   * <pre>
   * Additional links to include in the navigation pane.
   * </pre>
   */
  public int getLinksCount() {
    return links_.size();
  }
  /**
   * <code>repeated .dossier.TypeLink links = 4;</code>
   *
   * <pre>
   * Additional links to include in the navigation pane.
   * </pre>
   */
  public com.github.jsdossier.proto.TypeLink getLinks(int index) {
    return links_.get(index);
  }
  /**
   * <code>repeated .dossier.TypeLink links = 4;</code>
   *
   * <pre>
   * Additional links to include in the navigation pane.
   * </pre>
   */
  public com.github.jsdossier.proto.TypeLinkOrBuilder getLinksOrBuilder(
      int index) {
    return links_.get(index);
  }

  private void initFields() {
    home_ = "";
    includeTypes_ = false;
    includeModules_ = false;
    links_ = java.util.Collections.emptyList();
  }
  private byte memoizedIsInitialized = -1;
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    if (!hasHome()) {
      memoizedIsInitialized = 0;
      return false;
    }
    for (int i = 0; i < getLinksCount(); i++) {
      if (!getLinks(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, getHomeBytes());
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      output.writeBool(2, includeTypes_);
    }
    if (((bitField0_ & 0x00000004) == 0x00000004)) {
      output.writeBool(3, includeModules_);
    }
    for (int i = 0; i < links_.size(); i++) {
      output.writeMessage(4, links_.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
        .computeBytesSize(1, getHomeBytes());
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(2, includeTypes_);
    }
    if (((bitField0_ & 0x00000004) == 0x00000004)) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(3, includeModules_);
    }
    for (int i = 0; i < links_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(4, links_.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 com.github.jsdossier.proto.Index parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.github.jsdossier.proto.Index parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.github.jsdossier.proto.Index parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static com.github.jsdossier.proto.Index parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static com.github.jsdossier.proto.Index parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static com.github.jsdossier.proto.Index parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }
  public static com.github.jsdossier.proto.Index parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input);
  }
  public static com.github.jsdossier.proto.Index parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input, extensionRegistry);
  }
  public static com.github.jsdossier.proto.Index parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static com.github.jsdossier.proto.Index 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(com.github.jsdossier.proto.Index 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 dossier.Index}
   *
   * <pre>
   * Describes how to build the side index for a generated page.
   * </pre>
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
      // @@protoc_insertion_point(builder_implements:dossier.Index)
      com.github.jsdossier.proto.IndexOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return com.github.jsdossier.proto.Dossier.internal_static_dossier_Index_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.github.jsdossier.proto.Dossier.internal_static_dossier_Index_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.github.jsdossier.proto.Index.class, com.github.jsdossier.proto.Index.Builder.class);
    }

    // Construct using com.github.jsdossier.proto.Index.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

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

    public Builder clear() {
      super.clear();
      home_ = "";
      bitField0_ = (bitField0_ & ~0x00000001);
      includeTypes_ = false;
      bitField0_ = (bitField0_ & ~0x00000002);
      includeModules_ = false;
      bitField0_ = (bitField0_ & ~0x00000004);
      if (linksBuilder_ == null) {
        links_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
      } else {
        linksBuilder_.clear();
      }
      return this;
    }

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

    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return com.github.jsdossier.proto.Dossier.internal_static_dossier_Index_descriptor;
    }

    public com.github.jsdossier.proto.Index getDefaultInstanceForType() {
      return com.github.jsdossier.proto.Index.getDefaultInstance();
    }

    public com.github.jsdossier.proto.Index build() {
      com.github.jsdossier.proto.Index result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.github.jsdossier.proto.Index buildPartial() {
      com.github.jsdossier.proto.Index result = new com.github.jsdossier.proto.Index(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
        to_bitField0_ |= 0x00000001;
      }
      result.home_ = home_;
      if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
        to_bitField0_ |= 0x00000002;
      }
      result.includeTypes_ = includeTypes_;
      if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
        to_bitField0_ |= 0x00000004;
      }
      result.includeModules_ = includeModules_;
      if (linksBuilder_ == null) {
        if (((bitField0_ & 0x00000008) == 0x00000008)) {
          links_ = java.util.Collections.unmodifiableList(links_);
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.links_ = links_;
      } else {
        result.links_ = linksBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.github.jsdossier.proto.Index) {
        return mergeFrom((com.github.jsdossier.proto.Index)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.github.jsdossier.proto.Index other) {
      if (other == com.github.jsdossier.proto.Index.getDefaultInstance()) return this;
      if (other.hasHome()) {
        bitField0_ |= 0x00000001;
        home_ = other.home_;
        onChanged();
      }
      if (other.hasIncludeTypes()) {
        setIncludeTypes(other.getIncludeTypes());
      }
      if (other.hasIncludeModules()) {
        setIncludeModules(other.getIncludeModules());
      }
      if (linksBuilder_ == null) {
        if (!other.links_.isEmpty()) {
          if (links_.isEmpty()) {
            links_ = other.links_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureLinksIsMutable();
            links_.addAll(other.links_);
          }
          onChanged();
        }
      } else {
        if (!other.links_.isEmpty()) {
          if (linksBuilder_.isEmpty()) {
            linksBuilder_.dispose();
            linksBuilder_ = null;
            links_ = other.links_;
            bitField0_ = (bitField0_ & ~0x00000008);
            linksBuilder_ = 
              com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
                 getLinksFieldBuilder() : null;
          } else {
            linksBuilder_.addAllMessages(other.links_);
          }
        }
      }
      this.mergeUnknownFields(other.getUnknownFields());
      return this;
    }

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

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.github.jsdossier.proto.Index parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.github.jsdossier.proto.Index) e.getUnfinishedMessage();
        throw e;
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object home_ = "";
    /**
     * <code>required string home = 1;</code>
     *
     * <pre>
     * Defines the href from the current page to the main index.
     * </pre>
     */
    public boolean hasHome() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string home = 1;</code>
     *
     * <pre>
     * Defines the href from the current page to the main index.
     * </pre>
     */
    public java.lang.String getHome() {
      java.lang.Object ref = home_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          home_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>required string home = 1;</code>
     *
     * <pre>
     * Defines the href from the current page to the main index.
     * </pre>
     */
    public com.google.protobuf.ByteString
        getHomeBytes() {
      java.lang.Object ref = home_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        home_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>required string home = 1;</code>
     *
     * <pre>
     * Defines the href from the current page to the main index.
     * </pre>
     */
    public Builder setHome(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
      home_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>required string home = 1;</code>
     *
     * <pre>
     * Defines the href from the current page to the main index.
     * </pre>
     */
    public Builder clearHome() {
      bitField0_ = (bitField0_ & ~0x00000001);
      home_ = getDefaultInstance().getHome();
      onChanged();
      return this;
    }
    /**
     * <code>required string home = 1;</code>
     *
     * <pre>
     * Defines the href from the current page to the main index.
     * </pre>
     */
    public Builder setHomeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
      home_ = value;
      onChanged();
      return this;
    }

    private boolean includeTypes_ ;
    /**
     * <code>optional bool include_types = 2;</code>
     *
     * <pre>
     * Whether to generate the global type section.
     * </pre>
     */
    public boolean hasIncludeTypes() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>optional bool include_types = 2;</code>
     *
     * <pre>
     * Whether to generate the global type section.
     * </pre>
     */
    public boolean getIncludeTypes() {
      return includeTypes_;
    }
    /**
     * <code>optional bool include_types = 2;</code>
     *
     * <pre>
     * Whether to generate the global type section.
     * </pre>
     */
    public Builder setIncludeTypes(boolean value) {
      bitField0_ |= 0x00000002;
      includeTypes_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>optional bool include_types = 2;</code>
     *
     * <pre>
     * Whether to generate the global type section.
     * </pre>
     */
    public Builder clearIncludeTypes() {
      bitField0_ = (bitField0_ & ~0x00000002);
      includeTypes_ = false;
      onChanged();
      return this;
    }

    private boolean includeModules_ ;
    /**
     * <code>optional bool include_modules = 3;</code>
     *
     * <pre>
     * Whether to generate the module type section.
     * </pre>
     */
    public boolean hasIncludeModules() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional bool include_modules = 3;</code>
     *
     * <pre>
     * Whether to generate the module type section.
     * </pre>
     */
    public boolean getIncludeModules() {
      return includeModules_;
    }
    /**
     * <code>optional bool include_modules = 3;</code>
     *
     * <pre>
     * Whether to generate the module type section.
     * </pre>
     */
    public Builder setIncludeModules(boolean value) {
      bitField0_ |= 0x00000004;
      includeModules_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>optional bool include_modules = 3;</code>
     *
     * <pre>
     * Whether to generate the module type section.
     * </pre>
     */
    public Builder clearIncludeModules() {
      bitField0_ = (bitField0_ & ~0x00000004);
      includeModules_ = false;
      onChanged();
      return this;
    }

    private java.util.List<com.github.jsdossier.proto.TypeLink> links_ =
      java.util.Collections.emptyList();
    private void ensureLinksIsMutable() {
      if (!((bitField0_ & 0x00000008) == 0x00000008)) {
        links_ = new java.util.ArrayList<com.github.jsdossier.proto.TypeLink>(links_);
        bitField0_ |= 0x00000008;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilder<
        com.github.jsdossier.proto.TypeLink, com.github.jsdossier.proto.TypeLink.Builder, com.github.jsdossier.proto.TypeLinkOrBuilder> linksBuilder_;

    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public java.util.List<com.github.jsdossier.proto.TypeLink> getLinksList() {
      if (linksBuilder_ == null) {
        return java.util.Collections.unmodifiableList(links_);
      } else {
        return linksBuilder_.getMessageList();
      }
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public int getLinksCount() {
      if (linksBuilder_ == null) {
        return links_.size();
      } else {
        return linksBuilder_.getCount();
      }
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public com.github.jsdossier.proto.TypeLink getLinks(int index) {
      if (linksBuilder_ == null) {
        return links_.get(index);
      } else {
        return linksBuilder_.getMessage(index);
      }
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder setLinks(
        int index, com.github.jsdossier.proto.TypeLink value) {
      if (linksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLinksIsMutable();
        links_.set(index, value);
        onChanged();
      } else {
        linksBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder setLinks(
        int index, com.github.jsdossier.proto.TypeLink.Builder builderForValue) {
      if (linksBuilder_ == null) {
        ensureLinksIsMutable();
        links_.set(index, builderForValue.build());
        onChanged();
      } else {
        linksBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder addLinks(com.github.jsdossier.proto.TypeLink value) {
      if (linksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLinksIsMutable();
        links_.add(value);
        onChanged();
      } else {
        linksBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder addLinks(
        int index, com.github.jsdossier.proto.TypeLink value) {
      if (linksBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureLinksIsMutable();
        links_.add(index, value);
        onChanged();
      } else {
        linksBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder addLinks(
        com.github.jsdossier.proto.TypeLink.Builder builderForValue) {
      if (linksBuilder_ == null) {
        ensureLinksIsMutable();
        links_.add(builderForValue.build());
        onChanged();
      } else {
        linksBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder addLinks(
        int index, com.github.jsdossier.proto.TypeLink.Builder builderForValue) {
      if (linksBuilder_ == null) {
        ensureLinksIsMutable();
        links_.add(index, builderForValue.build());
        onChanged();
      } else {
        linksBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder addAllLinks(
        java.lang.Iterable<? extends com.github.jsdossier.proto.TypeLink> values) {
      if (linksBuilder_ == null) {
        ensureLinksIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, links_);
        onChanged();
      } else {
        linksBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder clearLinks() {
      if (linksBuilder_ == null) {
        links_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
      } else {
        linksBuilder_.clear();
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public Builder removeLinks(int index) {
      if (linksBuilder_ == null) {
        ensureLinksIsMutable();
        links_.remove(index);
        onChanged();
      } else {
        linksBuilder_.remove(index);
      }
      return this;
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public com.github.jsdossier.proto.TypeLink.Builder getLinksBuilder(
        int index) {
      return getLinksFieldBuilder().getBuilder(index);
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public com.github.jsdossier.proto.TypeLinkOrBuilder getLinksOrBuilder(
        int index) {
      if (linksBuilder_ == null) {
        return links_.get(index);  } else {
        return linksBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public java.util.List<? extends com.github.jsdossier.proto.TypeLinkOrBuilder> 
         getLinksOrBuilderList() {
      if (linksBuilder_ != null) {
        return linksBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(links_);
      }
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public com.github.jsdossier.proto.TypeLink.Builder addLinksBuilder() {
      return getLinksFieldBuilder().addBuilder(
          com.github.jsdossier.proto.TypeLink.getDefaultInstance());
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public com.github.jsdossier.proto.TypeLink.Builder addLinksBuilder(
        int index) {
      return getLinksFieldBuilder().addBuilder(
          index, com.github.jsdossier.proto.TypeLink.getDefaultInstance());
    }
    /**
     * <code>repeated .dossier.TypeLink links = 4;</code>
     *
     * <pre>
     * Additional links to include in the navigation pane.
     * </pre>
     */
    public java.util.List<com.github.jsdossier.proto.TypeLink.Builder> 
         getLinksBuilderList() {
      return getLinksFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilder<
        com.github.jsdossier.proto.TypeLink, com.github.jsdossier.proto.TypeLink.Builder, com.github.jsdossier.proto.TypeLinkOrBuilder> 
        getLinksFieldBuilder() {
      if (linksBuilder_ == null) {
        linksBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
            com.github.jsdossier.proto.TypeLink, com.github.jsdossier.proto.TypeLink.Builder, com.github.jsdossier.proto.TypeLinkOrBuilder>(
                links_,
                ((bitField0_ & 0x00000008) == 0x00000008),
                getParentForChildren(),
                isClean());
        links_ = null;
      }
      return linksBuilder_;
    }

    // @@protoc_insertion_point(builder_scope:dossier.Index)
  }

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

  // @@protoc_insertion_point(class_scope:dossier.Index)
}

