// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: compiler/ir/serialization.common/src/KotlinIr.proto

package org.jetbrains.kotlin.backend.common.serialization.proto;

/**
 * Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry}
 */
public final class FileEntry extends
    org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements
    // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry)
    FileEntryOrBuilder {
  // Use FileEntry.newBuilder() to construct.
  private FileEntry(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) {
    super(builder);
    this.unknownFields = builder.getUnknownFields();
  }
  private FileEntry(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;}

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

  public FileEntry getDefaultInstanceForType() {
    return defaultInstance;
  }

  private final org.jetbrains.kotlin.protobuf.ByteString unknownFields;
  private FileEntry(
      org.jetbrains.kotlin.protobuf.CodedInputStream input,
      org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
      throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
    initFields();
    int mutable_bitField0_ = 0;
    org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput =
        org.jetbrains.kotlin.protobuf.ByteString.newOutput();
    org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput =
        org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance(
            unknownFieldsOutput, 1);
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          default: {
            if (!parseUnknownField(input, unknownFieldsCodedOutput,
                                   extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
          case 10: {
            org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes();
            bitField0_ |= 0x00000001;
            name_ = bs;
            break;
          }
          case 16: {
            if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
              lineStartOffset_ = new java.util.ArrayList<java.lang.Integer>();
              mutable_bitField0_ |= 0x00000002;
            }
            lineStartOffset_.add(input.readInt32());
            break;
          }
          case 18: {
            int length = input.readRawVarint32();
            int limit = input.pushLimit(length);
            if (!((mutable_bitField0_ & 0x00000002) == 0x00000002) && input.getBytesUntilLimit() > 0) {
              lineStartOffset_ = new java.util.ArrayList<java.lang.Integer>();
              mutable_bitField0_ |= 0x00000002;
            }
            while (input.getBytesUntilLimit() > 0) {
              lineStartOffset_.add(input.readInt32());
            }
            input.popLimit(limit);
            break;
          }
          case 24: {
            bitField0_ |= 0x00000002;
            firstRelevantLineIndex_ = input.readInt32();
            break;
          }
        }
      }
    } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException(
          e.getMessage()).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) {
        lineStartOffset_ = java.util.Collections.unmodifiableList(lineStartOffset_);
      }
      try {
        unknownFieldsCodedOutput.flush();
      } catch (java.io.IOException e) {
      // Should not happen
      } finally {
        unknownFields = unknownFieldsOutput.toByteString();
      }
      makeExtensionsImmutable();
    }
  }
  public static org.jetbrains.kotlin.protobuf.Parser<FileEntry> PARSER =
      new org.jetbrains.kotlin.protobuf.AbstractParser<FileEntry>() {
    public FileEntry parsePartialFrom(
        org.jetbrains.kotlin.protobuf.CodedInputStream input,
        org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
        throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
      return new FileEntry(input, extensionRegistry);
    }
  };

  @java.lang.Override
  public org.jetbrains.kotlin.protobuf.Parser<FileEntry> getParserForType() {
    return PARSER;
  }

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

  public static final int LINE_START_OFFSET_FIELD_NUMBER = 2;
  private java.util.List<java.lang.Integer> lineStartOffset_;
  /**
   * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
   */
  public java.util.List<java.lang.Integer>
      getLineStartOffsetList() {
    return lineStartOffset_;
  }
  /**
   * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
   */
  public int getLineStartOffsetCount() {
    return lineStartOffset_.size();
  }
  /**
   * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
   */
  public int getLineStartOffset(int index) {
    return lineStartOffset_.get(index);
  }
  private int lineStartOffsetMemoizedSerializedSize = -1;

  public static final int FIRST_RELEVANT_LINE_INDEX_FIELD_NUMBER = 3;
  private int firstRelevantLineIndex_;
  /**
   * <code>optional int32 first_relevant_line_index = 3 [default = 0];</code>
   */
  public boolean hasFirstRelevantLineIndex() {
    return ((bitField0_ & 0x00000002) == 0x00000002);
  }
  /**
   * <code>optional int32 first_relevant_line_index = 3 [default = 0];</code>
   */
  public int getFirstRelevantLineIndex() {
    return firstRelevantLineIndex_;
  }

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

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

  public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    getSerializedSize();
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      output.writeBytes(1, getNameBytes());
    }
    if (getLineStartOffsetList().size() > 0) {
      output.writeRawVarint32(18);
      output.writeRawVarint32(lineStartOffsetMemoizedSerializedSize);
    }
    for (int i = 0; i < lineStartOffset_.size(); i++) {
      output.writeInt32NoTag(lineStartOffset_.get(i));
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      output.writeInt32(3, firstRelevantLineIndex_);
    }
    output.writeRawBytes(unknownFields);
  }

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

    size = 0;
    if (((bitField0_ & 0x00000001) == 0x00000001)) {
      size += org.jetbrains.kotlin.protobuf.CodedOutputStream
        .computeBytesSize(1, getNameBytes());
    }
    {
      int dataSize = 0;
      for (int i = 0; i < lineStartOffset_.size(); i++) {
        dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream
          .computeInt32SizeNoTag(lineStartOffset_.get(i));
      }
      size += dataSize;
      if (!getLineStartOffsetList().isEmpty()) {
        size += 1;
        size += org.jetbrains.kotlin.protobuf.CodedOutputStream
            .computeInt32SizeNoTag(dataSize);
      }
      lineStartOffsetMemoizedSerializedSize = dataSize;
    }
    if (((bitField0_ & 0x00000002) == 0x00000002)) {
      size += org.jetbrains.kotlin.protobuf.CodedOutputStream
        .computeInt32Size(3, firstRelevantLineIndex_);
    }
    size += unknownFields.size();
    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 org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(
      org.jetbrains.kotlin.protobuf.ByteString data)
      throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(
      org.jetbrains.kotlin.protobuf.ByteString data,
      org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
      throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(byte[] data)
      throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(
      byte[] data,
      org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
      throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(
      java.io.InputStream input,
      org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseFrom(input, extensionRegistry);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseDelimitedFrom(
      java.io.InputStream input,
      org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return PARSER.parseDelimitedFrom(input, extensionRegistry);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(
      org.jetbrains.kotlin.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return PARSER.parseFrom(input);
  }
  public static org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parseFrom(
      org.jetbrains.kotlin.protobuf.CodedInputStream input,
      org.jetbrains.kotlin.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(org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry prototype) {
    return newBuilder().mergeFrom(prototype);
  }
  public Builder toBuilder() { return newBuilder(this); }

  /**
   * Protobuf type {@code org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry}
   */
  public static final class Builder extends
      org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder<
        org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry, Builder>
      implements
      // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry)
      org.jetbrains.kotlin.backend.common.serialization.proto.FileEntryOrBuilder {
    // Construct using org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
    }
    private static Builder create() {
      return new Builder();
    }

    public Builder clear() {
      super.clear();
      name_ = "";
      bitField0_ = (bitField0_ & ~0x00000001);
      lineStartOffset_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000002);
      firstRelevantLineIndex_ = 0;
      bitField0_ = (bitField0_ & ~0x00000004);
      return this;
    }

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

    public org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry getDefaultInstanceForType() {
      return org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry.getDefaultInstance();
    }

    public org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry build() {
      org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry buildPartial() {
      org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry result = new org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
        to_bitField0_ |= 0x00000001;
      }
      result.name_ = name_;
      if (((bitField0_ & 0x00000002) == 0x00000002)) {
        lineStartOffset_ = java.util.Collections.unmodifiableList(lineStartOffset_);
        bitField0_ = (bitField0_ & ~0x00000002);
      }
      result.lineStartOffset_ = lineStartOffset_;
      if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
        to_bitField0_ |= 0x00000002;
      }
      result.firstRelevantLineIndex_ = firstRelevantLineIndex_;
      result.bitField0_ = to_bitField0_;
      return result;
    }

    public Builder mergeFrom(org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry other) {
      if (other == org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry.getDefaultInstance()) return this;
      if (other.hasName()) {
        bitField0_ |= 0x00000001;
        name_ = other.name_;
        
      }
      if (!other.lineStartOffset_.isEmpty()) {
        if (lineStartOffset_.isEmpty()) {
          lineStartOffset_ = other.lineStartOffset_;
          bitField0_ = (bitField0_ & ~0x00000002);
        } else {
          ensureLineStartOffsetIsMutable();
          lineStartOffset_.addAll(other.lineStartOffset_);
        }
        
      }
      if (other.hasFirstRelevantLineIndex()) {
        setFirstRelevantLineIndex(other.getFirstRelevantLineIndex());
      }
      setUnknownFields(
          getUnknownFields().concat(other.unknownFields));
      return this;
    }

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

    public Builder mergeFrom(
        org.jetbrains.kotlin.protobuf.CodedInputStream input,
        org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry) e.getUnfinishedMessage();
        throw e;
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object name_ = "";
    /**
     * <code>required string name = 1;</code>
     */
    public boolean hasName() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required string name = 1;</code>
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        org.jetbrains.kotlin.protobuf.ByteString bs =
            (org.jetbrains.kotlin.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          name_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>required string name = 1;</code>
     */
    public org.jetbrains.kotlin.protobuf.ByteString
        getNameBytes() {
      java.lang.Object ref = name_;
      if (ref instanceof String) {
        org.jetbrains.kotlin.protobuf.ByteString b = 
            org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        name_ = b;
        return b;
      } else {
        return (org.jetbrains.kotlin.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>required string name = 1;</code>
     */
    public Builder setName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
      name_ = value;
      
      return this;
    }
    /**
     * <code>required string name = 1;</code>
     */
    public Builder clearName() {
      bitField0_ = (bitField0_ & ~0x00000001);
      name_ = getDefaultInstance().getName();
      
      return this;
    }
    /**
     * <code>required string name = 1;</code>
     */
    public Builder setNameBytes(
        org.jetbrains.kotlin.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
      name_ = value;
      
      return this;
    }

    private java.util.List<java.lang.Integer> lineStartOffset_ = java.util.Collections.emptyList();
    private void ensureLineStartOffsetIsMutable() {
      if (!((bitField0_ & 0x00000002) == 0x00000002)) {
        lineStartOffset_ = new java.util.ArrayList<java.lang.Integer>(lineStartOffset_);
        bitField0_ |= 0x00000002;
       }
    }
    /**
     * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
     */
    public java.util.List<java.lang.Integer>
        getLineStartOffsetList() {
      return java.util.Collections.unmodifiableList(lineStartOffset_);
    }
    /**
     * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
     */
    public int getLineStartOffsetCount() {
      return lineStartOffset_.size();
    }
    /**
     * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
     */
    public int getLineStartOffset(int index) {
      return lineStartOffset_.get(index);
    }
    /**
     * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
     */
    public Builder setLineStartOffset(
        int index, int value) {
      ensureLineStartOffsetIsMutable();
      lineStartOffset_.set(index, value);
      
      return this;
    }
    /**
     * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
     */
    public Builder addLineStartOffset(int value) {
      ensureLineStartOffsetIsMutable();
      lineStartOffset_.add(value);
      
      return this;
    }
    /**
     * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
     */
    public Builder addAllLineStartOffset(
        java.lang.Iterable<? extends java.lang.Integer> values) {
      ensureLineStartOffsetIsMutable();
      org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll(
          values, lineStartOffset_);
      
      return this;
    }
    /**
     * <code>repeated int32 line_start_offset = 2 [packed = true];</code>
     */
    public Builder clearLineStartOffset() {
      lineStartOffset_ = java.util.Collections.emptyList();
      bitField0_ = (bitField0_ & ~0x00000002);
      
      return this;
    }

    private int firstRelevantLineIndex_ ;
    /**
     * <code>optional int32 first_relevant_line_index = 3 [default = 0];</code>
     */
    public boolean hasFirstRelevantLineIndex() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional int32 first_relevant_line_index = 3 [default = 0];</code>
     */
    public int getFirstRelevantLineIndex() {
      return firstRelevantLineIndex_;
    }
    /**
     * <code>optional int32 first_relevant_line_index = 3 [default = 0];</code>
     */
    public Builder setFirstRelevantLineIndex(int value) {
      bitField0_ |= 0x00000004;
      firstRelevantLineIndex_ = value;
      
      return this;
    }
    /**
     * <code>optional int32 first_relevant_line_index = 3 [default = 0];</code>
     */
    public Builder clearFirstRelevantLineIndex() {
      bitField0_ = (bitField0_ & ~0x00000004);
      firstRelevantLineIndex_ = 0;
      
      return this;
    }

    // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry)
  }

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

  // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.backend.common.serialization.proto.FileEntry)
}
