All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.okapi.proto.textunitflat.TextFragment Maven / Gradle / Ivy

There is a newer version: 1.47.0
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: TextUnitFlat.proto

package net.sf.okapi.proto.textunitflat;

/**
 * Protobuf type {@code TextFragment}
 */
public final class TextFragment extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:TextFragment)
    TextFragmentOrBuilder {
private static final long serialVersionUID = 0L;
  // Use TextFragment.newBuilder() to construct.
  private TextFragment(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    super(builder);
  }
  private TextFragment() {
    text_ = "";
    codes_ = java.util.Collections.emptyList();
  }

  @java.lang.Override
  @SuppressWarnings({"unused"})
  protected java.lang.Object newInstance(
      UnusedPrivateParameter unused) {
    return new TextFragment();
  }

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private TextFragment(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    this();
    if (extensionRegistry == null) {
      throw new java.lang.NullPointerException();
    }
    int mutable_bitField0_ = 0;
    com.google.protobuf.UnknownFieldSet.Builder unknownFields =
        com.google.protobuf.UnknownFieldSet.newBuilder();
    try {
      boolean done = false;
      while (!done) {
        int tag = input.readTag();
        switch (tag) {
          case 0:
            done = true;
            break;
          case 10: {
            java.lang.String s = input.readStringRequireUtf8();

            text_ = s;
            break;
          }
          case 18: {
            if (!((mutable_bitField0_ & 0x00000001) != 0)) {
              codes_ = new java.util.ArrayList();
              mutable_bitField0_ |= 0x00000001;
            }
            codes_.add(
                input.readMessage(net.sf.okapi.proto.textunitflat.Code.parser(), extensionRegistry));
            break;
          }
          case 24: {

            balanced_ = input.readBool();
            break;
          }
          default: {
            if (!parseUnknownField(
                input, unknownFields, extensionRegistry, tag)) {
              done = true;
            }
            break;
          }
        }
      }
    } catch (com.google.protobuf.InvalidProtocolBufferException e) {
      throw e.setUnfinishedMessage(this);
    } catch (com.google.protobuf.UninitializedMessageException e) {
      throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
    } catch (java.io.IOException e) {
      throw new com.google.protobuf.InvalidProtocolBufferException(
          e).setUnfinishedMessage(this);
    } finally {
      if (((mutable_bitField0_ & 0x00000001) != 0)) {
        codes_ = java.util.Collections.unmodifiableList(codes_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextFragment_descriptor;
  }

  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextFragment_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            net.sf.okapi.proto.textunitflat.TextFragment.class, net.sf.okapi.proto.textunitflat.TextFragment.Builder.class);
  }

  /**
   * Protobuf enum {@code TextFragment.TagType}
   */
  public enum TagType
      implements com.google.protobuf.ProtocolMessageEnum {
    /**
     * OPENING = 0;
     */
    OPENING(0),
    /**
     * CLOSING = 1;
     */
    CLOSING(1),
    /**
     * PLACEHOLDER = 2;
     */
    PLACEHOLDER(2),
    UNRECOGNIZED(-1),
    ;

    /**
     * OPENING = 0;
     */
    public static final int OPENING_VALUE = 0;
    /**
     * CLOSING = 1;
     */
    public static final int CLOSING_VALUE = 1;
    /**
     * PLACEHOLDER = 2;
     */
    public static final int PLACEHOLDER_VALUE = 2;


    public final int getNumber() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalArgumentException(
            "Can't get the number of an unknown enum value.");
      }
      return value;
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     * @deprecated Use {@link #forNumber(int)} instead.
     */
    @java.lang.Deprecated
    public static TagType valueOf(int value) {
      return forNumber(value);
    }

    /**
     * @param value The numeric wire value of the corresponding enum entry.
     * @return The enum associated with the given numeric wire value.
     */
    public static TagType forNumber(int value) {
      switch (value) {
        case 0: return OPENING;
        case 1: return CLOSING;
        case 2: return PLACEHOLDER;
        default: return null;
      }
    }

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

    public final com.google.protobuf.Descriptors.EnumValueDescriptor
        getValueDescriptor() {
      if (this == UNRECOGNIZED) {
        throw new java.lang.IllegalStateException(
            "Can't get the descriptor of an unrecognized enum value.");
      }
      return getDescriptor().getValues().get(ordinal());
    }
    public final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptorForType() {
      return getDescriptor();
    }
    public static final com.google.protobuf.Descriptors.EnumDescriptor
        getDescriptor() {
      return net.sf.okapi.proto.textunitflat.TextFragment.getDescriptor().getEnumTypes().get(0);
    }

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

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

    private final int value;

    private TagType(int value) {
      this.value = value;
    }

    // @@protoc_insertion_point(enum_scope:TextFragment.TagType)
  }

  public static final int TEXT_FIELD_NUMBER = 1;
  private volatile java.lang.Object text_;
  /**
   * string text = 1;
   * @return The text.
   */
  @java.lang.Override
  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();
      text_ = s;
      return s;
    }
  }
  /**
   * string text = 1;
   * @return The bytes for text.
   */
  @java.lang.Override
  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;
    }
  }

  public static final int CODES_FIELD_NUMBER = 2;
  private java.util.List codes_;
  /**
   * repeated .Code codes = 2;
   */
  @java.lang.Override
  public java.util.List getCodesList() {
    return codes_;
  }
  /**
   * repeated .Code codes = 2;
   */
  @java.lang.Override
  public java.util.List 
      getCodesOrBuilderList() {
    return codes_;
  }
  /**
   * repeated .Code codes = 2;
   */
  @java.lang.Override
  public int getCodesCount() {
    return codes_.size();
  }
  /**
   * repeated .Code codes = 2;
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.Code getCodes(int index) {
    return codes_.get(index);
  }
  /**
   * repeated .Code codes = 2;
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.CodeOrBuilder getCodesOrBuilder(
      int index) {
    return codes_.get(index);
  }

  public static final int BALANCED_FIELD_NUMBER = 3;
  private boolean balanced_;
  /**
   * bool balanced = 3;
   * @return The balanced.
   */
  @java.lang.Override
  public boolean getBalanced() {
    return balanced_;
  }

  private byte memoizedIsInitialized = -1;
  @java.lang.Override
  public final boolean isInitialized() {
    byte isInitialized = memoizedIsInitialized;
    if (isInitialized == 1) return true;
    if (isInitialized == 0) return false;

    memoizedIsInitialized = 1;
    return true;
  }

  @java.lang.Override
  public void writeTo(com.google.protobuf.CodedOutputStream output)
                      throws java.io.IOException {
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, text_);
    }
    for (int i = 0; i < codes_.size(); i++) {
      output.writeMessage(2, codes_.get(i));
    }
    if (balanced_ != false) {
      output.writeBool(3, balanced_);
    }
    unknownFields.writeTo(output);
  }

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

    size = 0;
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, text_);
    }
    for (int i = 0; i < codes_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(2, codes_.get(i));
    }
    if (balanced_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(3, balanced_);
    }
    size += unknownFields.getSerializedSize();
    memoizedSize = size;
    return size;
  }

  @java.lang.Override
  public boolean equals(final java.lang.Object obj) {
    if (obj == this) {
     return true;
    }
    if (!(obj instanceof net.sf.okapi.proto.textunitflat.TextFragment)) {
      return super.equals(obj);
    }
    net.sf.okapi.proto.textunitflat.TextFragment other = (net.sf.okapi.proto.textunitflat.TextFragment) obj;

    if (!getText()
        .equals(other.getText())) return false;
    if (!getCodesList()
        .equals(other.getCodesList())) return false;
    if (getBalanced()
        != other.getBalanced()) return false;
    if (!unknownFields.equals(other.unknownFields)) return false;
    return true;
  }

  @java.lang.Override
  public int hashCode() {
    if (memoizedHashCode != 0) {
      return memoizedHashCode;
    }
    int hash = 41;
    hash = (19 * hash) + getDescriptor().hashCode();
    hash = (37 * hash) + TEXT_FIELD_NUMBER;
    hash = (53 * hash) + getText().hashCode();
    if (getCodesCount() > 0) {
      hash = (37 * hash) + CODES_FIELD_NUMBER;
      hash = (53 * hash) + getCodesList().hashCode();
    }
    hash = (37 * hash) + BALANCED_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getBalanced());
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      java.nio.ByteBuffer data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      com.google.protobuf.ByteString data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      byte[] data,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data, extensionRegistry);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseDelimitedFrom(
      java.io.InputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      com.google.protobuf.CodedInputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static net.sf.okapi.proto.textunitflat.TextFragment parseFrom(
      com.google.protobuf.CodedInputStream input,
      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input, extensionRegistry);
  }

  @java.lang.Override
  public Builder newBuilderForType() { return newBuilder(); }
  public static Builder newBuilder() {
    return DEFAULT_INSTANCE.toBuilder();
  }
  public static Builder newBuilder(net.sf.okapi.proto.textunitflat.TextFragment prototype) {
    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
  }
  @java.lang.Override
  public Builder toBuilder() {
    return this == DEFAULT_INSTANCE
        ? new Builder() : new Builder().mergeFrom(this);
  }

  @java.lang.Override
  protected Builder newBuilderForType(
      com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
    Builder builder = new Builder(parent);
    return builder;
  }
  /**
   * Protobuf type {@code TextFragment}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder implements
      // @@protoc_insertion_point(builder_implements:TextFragment)
      net.sf.okapi.proto.textunitflat.TextFragmentOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextFragment_descriptor;
    }

    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextFragment_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              net.sf.okapi.proto.textunitflat.TextFragment.class, net.sf.okapi.proto.textunitflat.TextFragment.Builder.class);
    }

    // Construct using net.sf.okapi.proto.textunitflat.TextFragment.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(
        com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }
    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessageV3
              .alwaysUseFieldBuilders) {
        getCodesFieldBuilder();
      }
    }
    @java.lang.Override
    public Builder clear() {
      super.clear();
      text_ = "";

      if (codesBuilder_ == null) {
        codes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
      } else {
        codesBuilder_.clear();
      }
      balanced_ = false;

      return this;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.Descriptor
        getDescriptorForType() {
      return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextFragment_descriptor;
    }

    @java.lang.Override
    public net.sf.okapi.proto.textunitflat.TextFragment getDefaultInstanceForType() {
      return net.sf.okapi.proto.textunitflat.TextFragment.getDefaultInstance();
    }

    @java.lang.Override
    public net.sf.okapi.proto.textunitflat.TextFragment build() {
      net.sf.okapi.proto.textunitflat.TextFragment result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    @java.lang.Override
    public net.sf.okapi.proto.textunitflat.TextFragment buildPartial() {
      net.sf.okapi.proto.textunitflat.TextFragment result = new net.sf.okapi.proto.textunitflat.TextFragment(this);
      int from_bitField0_ = bitField0_;
      result.text_ = text_;
      if (codesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) != 0)) {
          codes_ = java.util.Collections.unmodifiableList(codes_);
          bitField0_ = (bitField0_ & ~0x00000001);
        }
        result.codes_ = codes_;
      } else {
        result.codes_ = codesBuilder_.build();
      }
      result.balanced_ = balanced_;
      onBuilt();
      return result;
    }

    @java.lang.Override
    public Builder clone() {
      return super.clone();
    }
    @java.lang.Override
    public Builder setField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.setField(field, value);
    }
    @java.lang.Override
    public Builder clearField(
        com.google.protobuf.Descriptors.FieldDescriptor field) {
      return super.clearField(field);
    }
    @java.lang.Override
    public Builder clearOneof(
        com.google.protobuf.Descriptors.OneofDescriptor oneof) {
      return super.clearOneof(oneof);
    }
    @java.lang.Override
    public Builder setRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        int index, java.lang.Object value) {
      return super.setRepeatedField(field, index, value);
    }
    @java.lang.Override
    public Builder addRepeatedField(
        com.google.protobuf.Descriptors.FieldDescriptor field,
        java.lang.Object value) {
      return super.addRepeatedField(field, value);
    }
    @java.lang.Override
    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof net.sf.okapi.proto.textunitflat.TextFragment) {
        return mergeFrom((net.sf.okapi.proto.textunitflat.TextFragment)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(net.sf.okapi.proto.textunitflat.TextFragment other) {
      if (other == net.sf.okapi.proto.textunitflat.TextFragment.getDefaultInstance()) return this;
      if (!other.getText().isEmpty()) {
        text_ = other.text_;
        onChanged();
      }
      if (codesBuilder_ == null) {
        if (!other.codes_.isEmpty()) {
          if (codes_.isEmpty()) {
            codes_ = other.codes_;
            bitField0_ = (bitField0_ & ~0x00000001);
          } else {
            ensureCodesIsMutable();
            codes_.addAll(other.codes_);
          }
          onChanged();
        }
      } else {
        if (!other.codes_.isEmpty()) {
          if (codesBuilder_.isEmpty()) {
            codesBuilder_.dispose();
            codesBuilder_ = null;
            codes_ = other.codes_;
            bitField0_ = (bitField0_ & ~0x00000001);
            codesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getCodesFieldBuilder() : null;
          } else {
            codesBuilder_.addAllMessages(other.codes_);
          }
        }
      }
      if (other.getBalanced() != false) {
        setBalanced(other.getBalanced());
      }
      this.mergeUnknownFields(other.unknownFields);
      onChanged();
      return this;
    }

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

    @java.lang.Override
    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      net.sf.okapi.proto.textunitflat.TextFragment parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (net.sf.okapi.proto.textunitflat.TextFragment) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object text_ = "";
    /**
     * string text = 1;
     * @return The text.
     */
    public java.lang.String getText() {
      java.lang.Object ref = text_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        text_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * string text = 1;
     * @return The bytes for text.
     */
    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;
      }
    }
    /**
     * string text = 1;
     * @param value The text to set.
     * @return This builder for chaining.
     */
    public Builder setText(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      text_ = value;
      onChanged();
      return this;
    }
    /**
     * string text = 1;
     * @return This builder for chaining.
     */
    public Builder clearText() {
      
      text_ = getDefaultInstance().getText();
      onChanged();
      return this;
    }
    /**
     * string text = 1;
     * @param value The bytes for text to set.
     * @return This builder for chaining.
     */
    public Builder setTextBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      text_ = value;
      onChanged();
      return this;
    }

    private java.util.List codes_ =
      java.util.Collections.emptyList();
    private void ensureCodesIsMutable() {
      if (!((bitField0_ & 0x00000001) != 0)) {
        codes_ = new java.util.ArrayList(codes_);
        bitField0_ |= 0x00000001;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.Code, net.sf.okapi.proto.textunitflat.Code.Builder, net.sf.okapi.proto.textunitflat.CodeOrBuilder> codesBuilder_;

    /**
     * repeated .Code codes = 2;
     */
    public java.util.List getCodesList() {
      if (codesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(codes_);
      } else {
        return codesBuilder_.getMessageList();
      }
    }
    /**
     * repeated .Code codes = 2;
     */
    public int getCodesCount() {
      if (codesBuilder_ == null) {
        return codes_.size();
      } else {
        return codesBuilder_.getCount();
      }
    }
    /**
     * repeated .Code codes = 2;
     */
    public net.sf.okapi.proto.textunitflat.Code getCodes(int index) {
      if (codesBuilder_ == null) {
        return codes_.get(index);
      } else {
        return codesBuilder_.getMessage(index);
      }
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder setCodes(
        int index, net.sf.okapi.proto.textunitflat.Code value) {
      if (codesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCodesIsMutable();
        codes_.set(index, value);
        onChanged();
      } else {
        codesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder setCodes(
        int index, net.sf.okapi.proto.textunitflat.Code.Builder builderForValue) {
      if (codesBuilder_ == null) {
        ensureCodesIsMutable();
        codes_.set(index, builderForValue.build());
        onChanged();
      } else {
        codesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder addCodes(net.sf.okapi.proto.textunitflat.Code value) {
      if (codesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCodesIsMutable();
        codes_.add(value);
        onChanged();
      } else {
        codesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder addCodes(
        int index, net.sf.okapi.proto.textunitflat.Code value) {
      if (codesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureCodesIsMutable();
        codes_.add(index, value);
        onChanged();
      } else {
        codesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder addCodes(
        net.sf.okapi.proto.textunitflat.Code.Builder builderForValue) {
      if (codesBuilder_ == null) {
        ensureCodesIsMutable();
        codes_.add(builderForValue.build());
        onChanged();
      } else {
        codesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder addCodes(
        int index, net.sf.okapi.proto.textunitflat.Code.Builder builderForValue) {
      if (codesBuilder_ == null) {
        ensureCodesIsMutable();
        codes_.add(index, builderForValue.build());
        onChanged();
      } else {
        codesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder addAllCodes(
        java.lang.Iterable values) {
      if (codesBuilder_ == null) {
        ensureCodesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, codes_);
        onChanged();
      } else {
        codesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder clearCodes() {
      if (codesBuilder_ == null) {
        codes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000001);
        onChanged();
      } else {
        codesBuilder_.clear();
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public Builder removeCodes(int index) {
      if (codesBuilder_ == null) {
        ensureCodesIsMutable();
        codes_.remove(index);
        onChanged();
      } else {
        codesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * repeated .Code codes = 2;
     */
    public net.sf.okapi.proto.textunitflat.Code.Builder getCodesBuilder(
        int index) {
      return getCodesFieldBuilder().getBuilder(index);
    }
    /**
     * repeated .Code codes = 2;
     */
    public net.sf.okapi.proto.textunitflat.CodeOrBuilder getCodesOrBuilder(
        int index) {
      if (codesBuilder_ == null) {
        return codes_.get(index);  } else {
        return codesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * repeated .Code codes = 2;
     */
    public java.util.List 
         getCodesOrBuilderList() {
      if (codesBuilder_ != null) {
        return codesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(codes_);
      }
    }
    /**
     * repeated .Code codes = 2;
     */
    public net.sf.okapi.proto.textunitflat.Code.Builder addCodesBuilder() {
      return getCodesFieldBuilder().addBuilder(
          net.sf.okapi.proto.textunitflat.Code.getDefaultInstance());
    }
    /**
     * repeated .Code codes = 2;
     */
    public net.sf.okapi.proto.textunitflat.Code.Builder addCodesBuilder(
        int index) {
      return getCodesFieldBuilder().addBuilder(
          index, net.sf.okapi.proto.textunitflat.Code.getDefaultInstance());
    }
    /**
     * repeated .Code codes = 2;
     */
    public java.util.List 
         getCodesBuilderList() {
      return getCodesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.Code, net.sf.okapi.proto.textunitflat.Code.Builder, net.sf.okapi.proto.textunitflat.CodeOrBuilder> 
        getCodesFieldBuilder() {
      if (codesBuilder_ == null) {
        codesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            net.sf.okapi.proto.textunitflat.Code, net.sf.okapi.proto.textunitflat.Code.Builder, net.sf.okapi.proto.textunitflat.CodeOrBuilder>(
                codes_,
                ((bitField0_ & 0x00000001) != 0),
                getParentForChildren(),
                isClean());
        codes_ = null;
      }
      return codesBuilder_;
    }

    private boolean balanced_ ;
    /**
     * bool balanced = 3;
     * @return The balanced.
     */
    @java.lang.Override
    public boolean getBalanced() {
      return balanced_;
    }
    /**
     * bool balanced = 3;
     * @param value The balanced to set.
     * @return This builder for chaining.
     */
    public Builder setBalanced(boolean value) {
      
      balanced_ = value;
      onChanged();
      return this;
    }
    /**
     * bool balanced = 3;
     * @return This builder for chaining.
     */
    public Builder clearBalanced() {
      
      balanced_ = false;
      onChanged();
      return this;
    }
    @java.lang.Override
    public final Builder setUnknownFields(
        final com.google.protobuf.UnknownFieldSet unknownFields) {
      return super.setUnknownFields(unknownFields);
    }

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


    // @@protoc_insertion_point(builder_scope:TextFragment)
  }

  // @@protoc_insertion_point(class_scope:TextFragment)
  private static final net.sf.okapi.proto.textunitflat.TextFragment DEFAULT_INSTANCE;
  static {
    DEFAULT_INSTANCE = new net.sf.okapi.proto.textunitflat.TextFragment();
  }

  public static net.sf.okapi.proto.textunitflat.TextFragment getDefaultInstance() {
    return DEFAULT_INSTANCE;
  }

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

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

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

  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.TextFragment getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy