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

net.sf.okapi.proto.textunitflat.TextUnit 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 TextUnit}
 */
public final class TextUnit extends
    com.google.protobuf.GeneratedMessageV3 implements
    // @@protoc_insertion_point(message_implements:TextUnit)
    TextUnitOrBuilder {
private static final long serialVersionUID = 0L;
  // Use TextUnit.newBuilder() to construct.
  private TextUnit(com.google.protobuf.GeneratedMessageV3.Builder builder) {
    super(builder);
  }
  private TextUnit() {
    id_ = "";
    mimeType_ = "";
    name_ = "";
    tuType_ = "";
    properties_ = java.util.Collections.emptyList();
    notes_ = java.util.Collections.emptyList();
  }

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

  @java.lang.Override
  public final com.google.protobuf.UnknownFieldSet
  getUnknownFields() {
    return this.unknownFields;
  }
  private TextUnit(
      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();

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

            mimeType_ = s;
            break;
          }
          case 26: {
            java.lang.String s = input.readStringRequireUtf8();
            bitField0_ |= 0x00000001;
            name_ = s;
            break;
          }
          case 34: {
            java.lang.String s = input.readStringRequireUtf8();

            tuType_ = s;
            break;
          }
          case 40: {

            translatable_ = input.readBool();
            break;
          }
          case 48: {

            preserveWS_ = input.readBool();
            break;
          }
          case 58: {
            net.sf.okapi.proto.textunitflat.TextContainer.Builder subBuilder = null;
            if (source_ != null) {
              subBuilder = source_.toBuilder();
            }
            source_ = input.readMessage(net.sf.okapi.proto.textunitflat.TextContainer.parser(), extensionRegistry);
            if (subBuilder != null) {
              subBuilder.mergeFrom(source_);
              source_ = subBuilder.buildPartial();
            }

            break;
          }
          case 66: {
            if (!((mutable_bitField0_ & 0x00000002) != 0)) {
              targets_ = com.google.protobuf.MapField.newMapField(
                  TargetsDefaultEntryHolder.defaultEntry);
              mutable_bitField0_ |= 0x00000002;
            }
            com.google.protobuf.MapEntry
            targets__ = input.readMessage(
                TargetsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
            targets_.getMutableMap().put(
                targets__.getKey(), targets__.getValue());
            break;
          }
          case 74: {
            if (!((mutable_bitField0_ & 0x00000004) != 0)) {
              properties_ = new java.util.ArrayList();
              mutable_bitField0_ |= 0x00000004;
            }
            properties_.add(
                input.readMessage(net.sf.okapi.proto.textunitflat.Property.parser(), extensionRegistry));
            break;
          }
          case 82: {
            if (!((mutable_bitField0_ & 0x00000008) != 0)) {
              notes_ = new java.util.ArrayList();
              mutable_bitField0_ |= 0x00000008;
            }
            notes_.add(
                input.readMessage(net.sf.okapi.proto.textunitflat.Note.parser(), extensionRegistry));
            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_ & 0x00000004) != 0)) {
        properties_ = java.util.Collections.unmodifiableList(properties_);
      }
      if (((mutable_bitField0_ & 0x00000008) != 0)) {
        notes_ = java.util.Collections.unmodifiableList(notes_);
      }
      this.unknownFields = unknownFields.build();
      makeExtensionsImmutable();
    }
  }
  public static final com.google.protobuf.Descriptors.Descriptor
      getDescriptor() {
    return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextUnit_descriptor;
  }

  @SuppressWarnings({"rawtypes"})
  @java.lang.Override
  protected com.google.protobuf.MapField internalGetMapField(
      int number) {
    switch (number) {
      case 8:
        return internalGetTargets();
      default:
        throw new RuntimeException(
            "Invalid map field number: " + number);
    }
  }
  @java.lang.Override
  protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
      internalGetFieldAccessorTable() {
    return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextUnit_fieldAccessorTable
        .ensureFieldAccessorsInitialized(
            net.sf.okapi.proto.textunitflat.TextUnit.class, net.sf.okapi.proto.textunitflat.TextUnit.Builder.class);
  }

  private int bitField0_;
  public static final int ID_FIELD_NUMBER = 1;
  private volatile java.lang.Object id_;
  /**
   * string id = 1;
   * @return The id.
   */
  @java.lang.Override
  public java.lang.String getId() {
    java.lang.Object ref = id_;
    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();
      id_ = s;
      return s;
    }
  }
  /**
   * string id = 1;
   * @return The bytes for id.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getIdBytes() {
    java.lang.Object ref = id_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      id_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int MIMETYPE_FIELD_NUMBER = 2;
  private volatile java.lang.Object mimeType_;
  /**
   * string mimeType = 2;
   * @return The mimeType.
   */
  @java.lang.Override
  public java.lang.String getMimeType() {
    java.lang.Object ref = mimeType_;
    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();
      mimeType_ = s;
      return s;
    }
  }
  /**
   * string mimeType = 2;
   * @return The bytes for mimeType.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getMimeTypeBytes() {
    java.lang.Object ref = mimeType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      mimeType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int NAME_FIELD_NUMBER = 3;
  private volatile java.lang.Object name_;
  /**
   * optional string name = 3;
   * @return Whether the name field is set.
   */
  @java.lang.Override
  public boolean hasName() {
    return ((bitField0_ & 0x00000001) != 0);
  }
  /**
   * optional string name = 3;
   * @return The name.
   */
  @java.lang.Override
  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();
      name_ = s;
      return s;
    }
  }
  /**
   * optional string name = 3;
   * @return The bytes for name.
   */
  @java.lang.Override
  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;
    }
  }

  public static final int TUTYPE_FIELD_NUMBER = 4;
  private volatile java.lang.Object tuType_;
  /**
   * string tuType = 4;
   * @return The tuType.
   */
  @java.lang.Override
  public java.lang.String getTuType() {
    java.lang.Object ref = tuType_;
    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();
      tuType_ = s;
      return s;
    }
  }
  /**
   * string tuType = 4;
   * @return The bytes for tuType.
   */
  @java.lang.Override
  public com.google.protobuf.ByteString
      getTuTypeBytes() {
    java.lang.Object ref = tuType_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      tuType_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }

  public static final int TRANSLATABLE_FIELD_NUMBER = 5;
  private boolean translatable_;
  /**
   * bool translatable = 5;
   * @return The translatable.
   */
  @java.lang.Override
  public boolean getTranslatable() {
    return translatable_;
  }

  public static final int PRESERVEWS_FIELD_NUMBER = 6;
  private boolean preserveWS_;
  /**
   * bool preserveWS = 6;
   * @return The preserveWS.
   */
  @java.lang.Override
  public boolean getPreserveWS() {
    return preserveWS_;
  }

  public static final int SOURCE_FIELD_NUMBER = 7;
  private net.sf.okapi.proto.textunitflat.TextContainer source_;
  /**
   * .TextContainer source = 7;
   * @return Whether the source field is set.
   */
  @java.lang.Override
  public boolean hasSource() {
    return source_ != null;
  }
  /**
   * .TextContainer source = 7;
   * @return The source.
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.TextContainer getSource() {
    return source_ == null ? net.sf.okapi.proto.textunitflat.TextContainer.getDefaultInstance() : source_;
  }
  /**
   * .TextContainer source = 7;
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.TextContainerOrBuilder getSourceOrBuilder() {
    return getSource();
  }

  public static final int TARGETS_FIELD_NUMBER = 8;
  private static final class TargetsDefaultEntryHolder {
    static final com.google.protobuf.MapEntry<
        java.lang.String, net.sf.okapi.proto.textunitflat.TextContainer> defaultEntry =
            com.google.protobuf.MapEntry
            .newDefaultInstance(
                net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextUnit_TargetsEntry_descriptor, 
                com.google.protobuf.WireFormat.FieldType.STRING,
                "",
                com.google.protobuf.WireFormat.FieldType.MESSAGE,
                net.sf.okapi.proto.textunitflat.TextContainer.getDefaultInstance());
  }
  private com.google.protobuf.MapField<
      java.lang.String, net.sf.okapi.proto.textunitflat.TextContainer> targets_;
  private com.google.protobuf.MapField
  internalGetTargets() {
    if (targets_ == null) {
      return com.google.protobuf.MapField.emptyMapField(
          TargetsDefaultEntryHolder.defaultEntry);
    }
    return targets_;
  }

  public int getTargetsCount() {
    return internalGetTargets().getMap().size();
  }
  /**
   * map<string, .TextContainer> targets = 8;
   */

  @java.lang.Override
  public boolean containsTargets(
      java.lang.String key) {
    if (key == null) { throw new NullPointerException("map key"); }
    return internalGetTargets().getMap().containsKey(key);
  }
  /**
   * Use {@link #getTargetsMap()} instead.
   */
  @java.lang.Override
  @java.lang.Deprecated
  public java.util.Map getTargets() {
    return getTargetsMap();
  }
  /**
   * map<string, .TextContainer> targets = 8;
   */
  @java.lang.Override

  public java.util.Map getTargetsMap() {
    return internalGetTargets().getMap();
  }
  /**
   * map<string, .TextContainer> targets = 8;
   */
  @java.lang.Override

  public net.sf.okapi.proto.textunitflat.TextContainer getTargetsOrDefault(
      java.lang.String key,
      net.sf.okapi.proto.textunitflat.TextContainer defaultValue) {
    if (key == null) { throw new NullPointerException("map key"); }
    java.util.Map map =
        internalGetTargets().getMap();
    return map.containsKey(key) ? map.get(key) : defaultValue;
  }
  /**
   * map<string, .TextContainer> targets = 8;
   */
  @java.lang.Override

  public net.sf.okapi.proto.textunitflat.TextContainer getTargetsOrThrow(
      java.lang.String key) {
    if (key == null) { throw new NullPointerException("map key"); }
    java.util.Map map =
        internalGetTargets().getMap();
    if (!map.containsKey(key)) {
      throw new java.lang.IllegalArgumentException();
    }
    return map.get(key);
  }

  public static final int PROPERTIES_FIELD_NUMBER = 9;
  private java.util.List properties_;
  /**
   * repeated .Property properties = 9;
   */
  @java.lang.Override
  public java.util.List getPropertiesList() {
    return properties_;
  }
  /**
   * repeated .Property properties = 9;
   */
  @java.lang.Override
  public java.util.List 
      getPropertiesOrBuilderList() {
    return properties_;
  }
  /**
   * repeated .Property properties = 9;
   */
  @java.lang.Override
  public int getPropertiesCount() {
    return properties_.size();
  }
  /**
   * repeated .Property properties = 9;
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.Property getProperties(int index) {
    return properties_.get(index);
  }
  /**
   * repeated .Property properties = 9;
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.PropertyOrBuilder getPropertiesOrBuilder(
      int index) {
    return properties_.get(index);
  }

  public static final int NOTES_FIELD_NUMBER = 10;
  private java.util.List notes_;
  /**
   * repeated .Note notes = 10;
   */
  @java.lang.Override
  public java.util.List getNotesList() {
    return notes_;
  }
  /**
   * repeated .Note notes = 10;
   */
  @java.lang.Override
  public java.util.List 
      getNotesOrBuilderList() {
    return notes_;
  }
  /**
   * repeated .Note notes = 10;
   */
  @java.lang.Override
  public int getNotesCount() {
    return notes_.size();
  }
  /**
   * repeated .Note notes = 10;
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.Note getNotes(int index) {
    return notes_.get(index);
  }
  /**
   * repeated .Note notes = 10;
   */
  @java.lang.Override
  public net.sf.okapi.proto.textunitflat.NoteOrBuilder getNotesOrBuilder(
      int index) {
    return notes_.get(index);
  }

  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(id_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 2, mimeType_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 3, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tuType_)) {
      com.google.protobuf.GeneratedMessageV3.writeString(output, 4, tuType_);
    }
    if (translatable_ != false) {
      output.writeBool(5, translatable_);
    }
    if (preserveWS_ != false) {
      output.writeBool(6, preserveWS_);
    }
    if (source_ != null) {
      output.writeMessage(7, getSource());
    }
    com.google.protobuf.GeneratedMessageV3
      .serializeStringMapTo(
        output,
        internalGetTargets(),
        TargetsDefaultEntryHolder.defaultEntry,
        8);
    for (int i = 0; i < properties_.size(); i++) {
      output.writeMessage(9, properties_.get(i));
    }
    for (int i = 0; i < notes_.size(); i++) {
      output.writeMessage(10, notes_.get(i));
    }
    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(id_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(mimeType_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, mimeType_);
    }
    if (((bitField0_ & 0x00000001) != 0)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, name_);
    }
    if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(tuType_)) {
      size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, tuType_);
    }
    if (translatable_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(5, translatable_);
    }
    if (preserveWS_ != false) {
      size += com.google.protobuf.CodedOutputStream
        .computeBoolSize(6, preserveWS_);
    }
    if (source_ != null) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(7, getSource());
    }
    for (java.util.Map.Entry entry
         : internalGetTargets().getMap().entrySet()) {
      com.google.protobuf.MapEntry
      targets__ = TargetsDefaultEntryHolder.defaultEntry.newBuilderForType()
          .setKey(entry.getKey())
          .setValue(entry.getValue())
          .build();
      size += com.google.protobuf.CodedOutputStream
          .computeMessageSize(8, targets__);
    }
    for (int i = 0; i < properties_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(9, properties_.get(i));
    }
    for (int i = 0; i < notes_.size(); i++) {
      size += com.google.protobuf.CodedOutputStream
        .computeMessageSize(10, notes_.get(i));
    }
    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.TextUnit)) {
      return super.equals(obj);
    }
    net.sf.okapi.proto.textunitflat.TextUnit other = (net.sf.okapi.proto.textunitflat.TextUnit) obj;

    if (!getId()
        .equals(other.getId())) return false;
    if (!getMimeType()
        .equals(other.getMimeType())) return false;
    if (hasName() != other.hasName()) return false;
    if (hasName()) {
      if (!getName()
          .equals(other.getName())) return false;
    }
    if (!getTuType()
        .equals(other.getTuType())) return false;
    if (getTranslatable()
        != other.getTranslatable()) return false;
    if (getPreserveWS()
        != other.getPreserveWS()) return false;
    if (hasSource() != other.hasSource()) return false;
    if (hasSource()) {
      if (!getSource()
          .equals(other.getSource())) return false;
    }
    if (!internalGetTargets().equals(
        other.internalGetTargets())) return false;
    if (!getPropertiesList()
        .equals(other.getPropertiesList())) return false;
    if (!getNotesList()
        .equals(other.getNotesList())) 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) + ID_FIELD_NUMBER;
    hash = (53 * hash) + getId().hashCode();
    hash = (37 * hash) + MIMETYPE_FIELD_NUMBER;
    hash = (53 * hash) + getMimeType().hashCode();
    if (hasName()) {
      hash = (37 * hash) + NAME_FIELD_NUMBER;
      hash = (53 * hash) + getName().hashCode();
    }
    hash = (37 * hash) + TUTYPE_FIELD_NUMBER;
    hash = (53 * hash) + getTuType().hashCode();
    hash = (37 * hash) + TRANSLATABLE_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getTranslatable());
    hash = (37 * hash) + PRESERVEWS_FIELD_NUMBER;
    hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
        getPreserveWS());
    if (hasSource()) {
      hash = (37 * hash) + SOURCE_FIELD_NUMBER;
      hash = (53 * hash) + getSource().hashCode();
    }
    if (!internalGetTargets().getMap().isEmpty()) {
      hash = (37 * hash) + TARGETS_FIELD_NUMBER;
      hash = (53 * hash) + internalGetTargets().hashCode();
    }
    if (getPropertiesCount() > 0) {
      hash = (37 * hash) + PROPERTIES_FIELD_NUMBER;
      hash = (53 * hash) + getPropertiesList().hashCode();
    }
    if (getNotesCount() > 0) {
      hash = (37 * hash) + NOTES_FIELD_NUMBER;
      hash = (53 * hash) + getNotesList().hashCode();
    }
    hash = (29 * hash) + unknownFields.hashCode();
    memoizedHashCode = hash;
    return hash;
  }

  public static net.sf.okapi.proto.textunitflat.TextUnit parseFrom(
      java.nio.ByteBuffer data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static net.sf.okapi.proto.textunitflat.TextUnit 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.TextUnit parseFrom(
      com.google.protobuf.ByteString data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static net.sf.okapi.proto.textunitflat.TextUnit 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.TextUnit parseFrom(byte[] data)
      throws com.google.protobuf.InvalidProtocolBufferException {
    return PARSER.parseFrom(data);
  }
  public static net.sf.okapi.proto.textunitflat.TextUnit 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.TextUnit parseFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseWithIOException(PARSER, input);
  }
  public static net.sf.okapi.proto.textunitflat.TextUnit 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.TextUnit parseDelimitedFrom(java.io.InputStream input)
      throws java.io.IOException {
    return com.google.protobuf.GeneratedMessageV3
        .parseDelimitedWithIOException(PARSER, input);
  }
  public static net.sf.okapi.proto.textunitflat.TextUnit 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.TextUnit 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.TextUnit 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.TextUnit 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 TextUnit}
   */
  public static final class Builder extends
      com.google.protobuf.GeneratedMessageV3.Builder implements
      // @@protoc_insertion_point(builder_implements:TextUnit)
      net.sf.okapi.proto.textunitflat.TextUnitOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor
        getDescriptor() {
      return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextUnit_descriptor;
    }

    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMapField(
        int number) {
      switch (number) {
        case 8:
          return internalGetTargets();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @SuppressWarnings({"rawtypes"})
    protected com.google.protobuf.MapField internalGetMutableMapField(
        int number) {
      switch (number) {
        case 8:
          return internalGetMutableTargets();
        default:
          throw new RuntimeException(
              "Invalid map field number: " + number);
      }
    }
    @java.lang.Override
    protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return net.sf.okapi.proto.textunitflat.OkapiTextUnitFlatProtoMapping.internal_static_TextUnit_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              net.sf.okapi.proto.textunitflat.TextUnit.class, net.sf.okapi.proto.textunitflat.TextUnit.Builder.class);
    }

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

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

      mimeType_ = "";

      name_ = "";
      bitField0_ = (bitField0_ & ~0x00000001);
      tuType_ = "";

      translatable_ = false;

      preserveWS_ = false;

      if (sourceBuilder_ == null) {
        source_ = null;
      } else {
        source_ = null;
        sourceBuilder_ = null;
      }
      internalGetMutableTargets().clear();
      if (propertiesBuilder_ == null) {
        properties_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
      } else {
        propertiesBuilder_.clear();
      }
      if (notesBuilder_ == null) {
        notes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
      } else {
        notesBuilder_.clear();
      }
      return this;
    }

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

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

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

    @java.lang.Override
    public net.sf.okapi.proto.textunitflat.TextUnit buildPartial() {
      net.sf.okapi.proto.textunitflat.TextUnit result = new net.sf.okapi.proto.textunitflat.TextUnit(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      result.id_ = id_;
      result.mimeType_ = mimeType_;
      if (((from_bitField0_ & 0x00000001) != 0)) {
        to_bitField0_ |= 0x00000001;
      }
      result.name_ = name_;
      result.tuType_ = tuType_;
      result.translatable_ = translatable_;
      result.preserveWS_ = preserveWS_;
      if (sourceBuilder_ == null) {
        result.source_ = source_;
      } else {
        result.source_ = sourceBuilder_.build();
      }
      result.targets_ = internalGetTargets();
      result.targets_.makeImmutable();
      if (propertiesBuilder_ == null) {
        if (((bitField0_ & 0x00000004) != 0)) {
          properties_ = java.util.Collections.unmodifiableList(properties_);
          bitField0_ = (bitField0_ & ~0x00000004);
        }
        result.properties_ = properties_;
      } else {
        result.properties_ = propertiesBuilder_.build();
      }
      if (notesBuilder_ == null) {
        if (((bitField0_ & 0x00000008) != 0)) {
          notes_ = java.util.Collections.unmodifiableList(notes_);
          bitField0_ = (bitField0_ & ~0x00000008);
        }
        result.notes_ = notes_;
      } else {
        result.notes_ = notesBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      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.TextUnit) {
        return mergeFrom((net.sf.okapi.proto.textunitflat.TextUnit)other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(net.sf.okapi.proto.textunitflat.TextUnit other) {
      if (other == net.sf.okapi.proto.textunitflat.TextUnit.getDefaultInstance()) return this;
      if (!other.getId().isEmpty()) {
        id_ = other.id_;
        onChanged();
      }
      if (!other.getMimeType().isEmpty()) {
        mimeType_ = other.mimeType_;
        onChanged();
      }
      if (other.hasName()) {
        bitField0_ |= 0x00000001;
        name_ = other.name_;
        onChanged();
      }
      if (!other.getTuType().isEmpty()) {
        tuType_ = other.tuType_;
        onChanged();
      }
      if (other.getTranslatable() != false) {
        setTranslatable(other.getTranslatable());
      }
      if (other.getPreserveWS() != false) {
        setPreserveWS(other.getPreserveWS());
      }
      if (other.hasSource()) {
        mergeSource(other.getSource());
      }
      internalGetMutableTargets().mergeFrom(
          other.internalGetTargets());
      if (propertiesBuilder_ == null) {
        if (!other.properties_.isEmpty()) {
          if (properties_.isEmpty()) {
            properties_ = other.properties_;
            bitField0_ = (bitField0_ & ~0x00000004);
          } else {
            ensurePropertiesIsMutable();
            properties_.addAll(other.properties_);
          }
          onChanged();
        }
      } else {
        if (!other.properties_.isEmpty()) {
          if (propertiesBuilder_.isEmpty()) {
            propertiesBuilder_.dispose();
            propertiesBuilder_ = null;
            properties_ = other.properties_;
            bitField0_ = (bitField0_ & ~0x00000004);
            propertiesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getPropertiesFieldBuilder() : null;
          } else {
            propertiesBuilder_.addAllMessages(other.properties_);
          }
        }
      }
      if (notesBuilder_ == null) {
        if (!other.notes_.isEmpty()) {
          if (notes_.isEmpty()) {
            notes_ = other.notes_;
            bitField0_ = (bitField0_ & ~0x00000008);
          } else {
            ensureNotesIsMutable();
            notes_.addAll(other.notes_);
          }
          onChanged();
        }
      } else {
        if (!other.notes_.isEmpty()) {
          if (notesBuilder_.isEmpty()) {
            notesBuilder_.dispose();
            notesBuilder_ = null;
            notes_ = other.notes_;
            bitField0_ = (bitField0_ & ~0x00000008);
            notesBuilder_ = 
              com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ?
                 getNotesFieldBuilder() : null;
          } else {
            notesBuilder_.addAllMessages(other.notes_);
          }
        }
      }
      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.TextUnit parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (net.sf.okapi.proto.textunitflat.TextUnit) e.getUnfinishedMessage();
        throw e.unwrapIOException();
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }
    private int bitField0_;

    private java.lang.Object id_ = "";
    /**
     * string id = 1;
     * @return The id.
     */
    public java.lang.String getId() {
      java.lang.Object ref = id_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        id_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * string id = 1;
     * @return The bytes for id.
     */
    public com.google.protobuf.ByteString
        getIdBytes() {
      java.lang.Object ref = id_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        id_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * string id = 1;
     * @param value The id to set.
     * @return This builder for chaining.
     */
    public Builder setId(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      id_ = value;
      onChanged();
      return this;
    }
    /**
     * string id = 1;
     * @return This builder for chaining.
     */
    public Builder clearId() {
      
      id_ = getDefaultInstance().getId();
      onChanged();
      return this;
    }
    /**
     * string id = 1;
     * @param value The bytes for id to set.
     * @return This builder for chaining.
     */
    public Builder setIdBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      id_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object mimeType_ = "";
    /**
     * string mimeType = 2;
     * @return The mimeType.
     */
    public java.lang.String getMimeType() {
      java.lang.Object ref = mimeType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        mimeType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * string mimeType = 2;
     * @return The bytes for mimeType.
     */
    public com.google.protobuf.ByteString
        getMimeTypeBytes() {
      java.lang.Object ref = mimeType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        mimeType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * string mimeType = 2;
     * @param value The mimeType to set.
     * @return This builder for chaining.
     */
    public Builder setMimeType(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      mimeType_ = value;
      onChanged();
      return this;
    }
    /**
     * string mimeType = 2;
     * @return This builder for chaining.
     */
    public Builder clearMimeType() {
      
      mimeType_ = getDefaultInstance().getMimeType();
      onChanged();
      return this;
    }
    /**
     * string mimeType = 2;
     * @param value The bytes for mimeType to set.
     * @return This builder for chaining.
     */
    public Builder setMimeTypeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      mimeType_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object name_ = "";
    /**
     * optional string name = 3;
     * @return Whether the name field is set.
     */
    public boolean hasName() {
      return ((bitField0_ & 0x00000001) != 0);
    }
    /**
     * optional string name = 3;
     * @return The name.
     */
    public java.lang.String getName() {
      java.lang.Object ref = name_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        name_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * optional string name = 3;
     * @return The bytes for name.
     */
    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;
      }
    }
    /**
     * optional string name = 3;
     * @param value The name to set.
     * @return This builder for chaining.
     */
    public Builder setName(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  bitField0_ |= 0x00000001;
      name_ = value;
      onChanged();
      return this;
    }
    /**
     * optional string name = 3;
     * @return This builder for chaining.
     */
    public Builder clearName() {
      bitField0_ = (bitField0_ & ~0x00000001);
      name_ = getDefaultInstance().getName();
      onChanged();
      return this;
    }
    /**
     * optional string name = 3;
     * @param value The bytes for name to set.
     * @return This builder for chaining.
     */
    public Builder setNameBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      bitField0_ |= 0x00000001;
      name_ = value;
      onChanged();
      return this;
    }

    private java.lang.Object tuType_ = "";
    /**
     * string tuType = 4;
     * @return The tuType.
     */
    public java.lang.String getTuType() {
      java.lang.Object ref = tuType_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs =
            (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        tuType_ = s;
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * string tuType = 4;
     * @return The bytes for tuType.
     */
    public com.google.protobuf.ByteString
        getTuTypeBytes() {
      java.lang.Object ref = tuType_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b = 
            com.google.protobuf.ByteString.copyFromUtf8(
                (java.lang.String) ref);
        tuType_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * string tuType = 4;
     * @param value The tuType to set.
     * @return This builder for chaining.
     */
    public Builder setTuType(
        java.lang.String value) {
      if (value == null) {
    throw new NullPointerException();
  }
  
      tuType_ = value;
      onChanged();
      return this;
    }
    /**
     * string tuType = 4;
     * @return This builder for chaining.
     */
    public Builder clearTuType() {
      
      tuType_ = getDefaultInstance().getTuType();
      onChanged();
      return this;
    }
    /**
     * string tuType = 4;
     * @param value The bytes for tuType to set.
     * @return This builder for chaining.
     */
    public Builder setTuTypeBytes(
        com.google.protobuf.ByteString value) {
      if (value == null) {
    throw new NullPointerException();
  }
  checkByteStringIsUtf8(value);
      
      tuType_ = value;
      onChanged();
      return this;
    }

    private boolean translatable_ ;
    /**
     * bool translatable = 5;
     * @return The translatable.
     */
    @java.lang.Override
    public boolean getTranslatable() {
      return translatable_;
    }
    /**
     * bool translatable = 5;
     * @param value The translatable to set.
     * @return This builder for chaining.
     */
    public Builder setTranslatable(boolean value) {
      
      translatable_ = value;
      onChanged();
      return this;
    }
    /**
     * bool translatable = 5;
     * @return This builder for chaining.
     */
    public Builder clearTranslatable() {
      
      translatable_ = false;
      onChanged();
      return this;
    }

    private boolean preserveWS_ ;
    /**
     * bool preserveWS = 6;
     * @return The preserveWS.
     */
    @java.lang.Override
    public boolean getPreserveWS() {
      return preserveWS_;
    }
    /**
     * bool preserveWS = 6;
     * @param value The preserveWS to set.
     * @return This builder for chaining.
     */
    public Builder setPreserveWS(boolean value) {
      
      preserveWS_ = value;
      onChanged();
      return this;
    }
    /**
     * bool preserveWS = 6;
     * @return This builder for chaining.
     */
    public Builder clearPreserveWS() {
      
      preserveWS_ = false;
      onChanged();
      return this;
    }

    private net.sf.okapi.proto.textunitflat.TextContainer source_;
    private com.google.protobuf.SingleFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.TextContainer, net.sf.okapi.proto.textunitflat.TextContainer.Builder, net.sf.okapi.proto.textunitflat.TextContainerOrBuilder> sourceBuilder_;
    /**
     * .TextContainer source = 7;
     * @return Whether the source field is set.
     */
    public boolean hasSource() {
      return sourceBuilder_ != null || source_ != null;
    }
    /**
     * .TextContainer source = 7;
     * @return The source.
     */
    public net.sf.okapi.proto.textunitflat.TextContainer getSource() {
      if (sourceBuilder_ == null) {
        return source_ == null ? net.sf.okapi.proto.textunitflat.TextContainer.getDefaultInstance() : source_;
      } else {
        return sourceBuilder_.getMessage();
      }
    }
    /**
     * .TextContainer source = 7;
     */
    public Builder setSource(net.sf.okapi.proto.textunitflat.TextContainer value) {
      if (sourceBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        source_ = value;
        onChanged();
      } else {
        sourceBuilder_.setMessage(value);
      }

      return this;
    }
    /**
     * .TextContainer source = 7;
     */
    public Builder setSource(
        net.sf.okapi.proto.textunitflat.TextContainer.Builder builderForValue) {
      if (sourceBuilder_ == null) {
        source_ = builderForValue.build();
        onChanged();
      } else {
        sourceBuilder_.setMessage(builderForValue.build());
      }

      return this;
    }
    /**
     * .TextContainer source = 7;
     */
    public Builder mergeSource(net.sf.okapi.proto.textunitflat.TextContainer value) {
      if (sourceBuilder_ == null) {
        if (source_ != null) {
          source_ =
            net.sf.okapi.proto.textunitflat.TextContainer.newBuilder(source_).mergeFrom(value).buildPartial();
        } else {
          source_ = value;
        }
        onChanged();
      } else {
        sourceBuilder_.mergeFrom(value);
      }

      return this;
    }
    /**
     * .TextContainer source = 7;
     */
    public Builder clearSource() {
      if (sourceBuilder_ == null) {
        source_ = null;
        onChanged();
      } else {
        source_ = null;
        sourceBuilder_ = null;
      }

      return this;
    }
    /**
     * .TextContainer source = 7;
     */
    public net.sf.okapi.proto.textunitflat.TextContainer.Builder getSourceBuilder() {
      
      onChanged();
      return getSourceFieldBuilder().getBuilder();
    }
    /**
     * .TextContainer source = 7;
     */
    public net.sf.okapi.proto.textunitflat.TextContainerOrBuilder getSourceOrBuilder() {
      if (sourceBuilder_ != null) {
        return sourceBuilder_.getMessageOrBuilder();
      } else {
        return source_ == null ?
            net.sf.okapi.proto.textunitflat.TextContainer.getDefaultInstance() : source_;
      }
    }
    /**
     * .TextContainer source = 7;
     */
    private com.google.protobuf.SingleFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.TextContainer, net.sf.okapi.proto.textunitflat.TextContainer.Builder, net.sf.okapi.proto.textunitflat.TextContainerOrBuilder> 
        getSourceFieldBuilder() {
      if (sourceBuilder_ == null) {
        sourceBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
            net.sf.okapi.proto.textunitflat.TextContainer, net.sf.okapi.proto.textunitflat.TextContainer.Builder, net.sf.okapi.proto.textunitflat.TextContainerOrBuilder>(
                getSource(),
                getParentForChildren(),
                isClean());
        source_ = null;
      }
      return sourceBuilder_;
    }

    private com.google.protobuf.MapField<
        java.lang.String, net.sf.okapi.proto.textunitflat.TextContainer> targets_;
    private com.google.protobuf.MapField
    internalGetTargets() {
      if (targets_ == null) {
        return com.google.protobuf.MapField.emptyMapField(
            TargetsDefaultEntryHolder.defaultEntry);
      }
      return targets_;
    }
    private com.google.protobuf.MapField
    internalGetMutableTargets() {
      onChanged();;
      if (targets_ == null) {
        targets_ = com.google.protobuf.MapField.newMapField(
            TargetsDefaultEntryHolder.defaultEntry);
      }
      if (!targets_.isMutable()) {
        targets_ = targets_.copy();
      }
      return targets_;
    }

    public int getTargetsCount() {
      return internalGetTargets().getMap().size();
    }
    /**
     * map<string, .TextContainer> targets = 8;
     */

    @java.lang.Override
    public boolean containsTargets(
        java.lang.String key) {
      if (key == null) { throw new NullPointerException("map key"); }
      return internalGetTargets().getMap().containsKey(key);
    }
    /**
     * Use {@link #getTargetsMap()} instead.
     */
    @java.lang.Override
    @java.lang.Deprecated
    public java.util.Map getTargets() {
      return getTargetsMap();
    }
    /**
     * map<string, .TextContainer> targets = 8;
     */
    @java.lang.Override

    public java.util.Map getTargetsMap() {
      return internalGetTargets().getMap();
    }
    /**
     * map<string, .TextContainer> targets = 8;
     */
    @java.lang.Override

    public net.sf.okapi.proto.textunitflat.TextContainer getTargetsOrDefault(
        java.lang.String key,
        net.sf.okapi.proto.textunitflat.TextContainer defaultValue) {
      if (key == null) { throw new NullPointerException("map key"); }
      java.util.Map map =
          internalGetTargets().getMap();
      return map.containsKey(key) ? map.get(key) : defaultValue;
    }
    /**
     * map<string, .TextContainer> targets = 8;
     */
    @java.lang.Override

    public net.sf.okapi.proto.textunitflat.TextContainer getTargetsOrThrow(
        java.lang.String key) {
      if (key == null) { throw new NullPointerException("map key"); }
      java.util.Map map =
          internalGetTargets().getMap();
      if (!map.containsKey(key)) {
        throw new java.lang.IllegalArgumentException();
      }
      return map.get(key);
    }

    public Builder clearTargets() {
      internalGetMutableTargets().getMutableMap()
          .clear();
      return this;
    }
    /**
     * map<string, .TextContainer> targets = 8;
     */

    public Builder removeTargets(
        java.lang.String key) {
      if (key == null) { throw new NullPointerException("map key"); }
      internalGetMutableTargets().getMutableMap()
          .remove(key);
      return this;
    }
    /**
     * Use alternate mutation accessors instead.
     */
    @java.lang.Deprecated
    public java.util.Map
    getMutableTargets() {
      return internalGetMutableTargets().getMutableMap();
    }
    /**
     * map<string, .TextContainer> targets = 8;
     */
    public Builder putTargets(
        java.lang.String key,
        net.sf.okapi.proto.textunitflat.TextContainer value) {
      if (key == null) { throw new NullPointerException("map key"); }
      if (value == null) {
  throw new NullPointerException("map value");
}

      internalGetMutableTargets().getMutableMap()
          .put(key, value);
      return this;
    }
    /**
     * map<string, .TextContainer> targets = 8;
     */

    public Builder putAllTargets(
        java.util.Map values) {
      internalGetMutableTargets().getMutableMap()
          .putAll(values);
      return this;
    }

    private java.util.List properties_ =
      java.util.Collections.emptyList();
    private void ensurePropertiesIsMutable() {
      if (!((bitField0_ & 0x00000004) != 0)) {
        properties_ = new java.util.ArrayList(properties_);
        bitField0_ |= 0x00000004;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.Property, net.sf.okapi.proto.textunitflat.Property.Builder, net.sf.okapi.proto.textunitflat.PropertyOrBuilder> propertiesBuilder_;

    /**
     * repeated .Property properties = 9;
     */
    public java.util.List getPropertiesList() {
      if (propertiesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(properties_);
      } else {
        return propertiesBuilder_.getMessageList();
      }
    }
    /**
     * repeated .Property properties = 9;
     */
    public int getPropertiesCount() {
      if (propertiesBuilder_ == null) {
        return properties_.size();
      } else {
        return propertiesBuilder_.getCount();
      }
    }
    /**
     * repeated .Property properties = 9;
     */
    public net.sf.okapi.proto.textunitflat.Property getProperties(int index) {
      if (propertiesBuilder_ == null) {
        return properties_.get(index);
      } else {
        return propertiesBuilder_.getMessage(index);
      }
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder setProperties(
        int index, net.sf.okapi.proto.textunitflat.Property value) {
      if (propertiesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePropertiesIsMutable();
        properties_.set(index, value);
        onChanged();
      } else {
        propertiesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder setProperties(
        int index, net.sf.okapi.proto.textunitflat.Property.Builder builderForValue) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.set(index, builderForValue.build());
        onChanged();
      } else {
        propertiesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder addProperties(net.sf.okapi.proto.textunitflat.Property value) {
      if (propertiesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePropertiesIsMutable();
        properties_.add(value);
        onChanged();
      } else {
        propertiesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder addProperties(
        int index, net.sf.okapi.proto.textunitflat.Property value) {
      if (propertiesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensurePropertiesIsMutable();
        properties_.add(index, value);
        onChanged();
      } else {
        propertiesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder addProperties(
        net.sf.okapi.proto.textunitflat.Property.Builder builderForValue) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.add(builderForValue.build());
        onChanged();
      } else {
        propertiesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder addProperties(
        int index, net.sf.okapi.proto.textunitflat.Property.Builder builderForValue) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.add(index, builderForValue.build());
        onChanged();
      } else {
        propertiesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder addAllProperties(
        java.lang.Iterable values) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, properties_);
        onChanged();
      } else {
        propertiesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder clearProperties() {
      if (propertiesBuilder_ == null) {
        properties_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000004);
        onChanged();
      } else {
        propertiesBuilder_.clear();
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public Builder removeProperties(int index) {
      if (propertiesBuilder_ == null) {
        ensurePropertiesIsMutable();
        properties_.remove(index);
        onChanged();
      } else {
        propertiesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * repeated .Property properties = 9;
     */
    public net.sf.okapi.proto.textunitflat.Property.Builder getPropertiesBuilder(
        int index) {
      return getPropertiesFieldBuilder().getBuilder(index);
    }
    /**
     * repeated .Property properties = 9;
     */
    public net.sf.okapi.proto.textunitflat.PropertyOrBuilder getPropertiesOrBuilder(
        int index) {
      if (propertiesBuilder_ == null) {
        return properties_.get(index);  } else {
        return propertiesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * repeated .Property properties = 9;
     */
    public java.util.List 
         getPropertiesOrBuilderList() {
      if (propertiesBuilder_ != null) {
        return propertiesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(properties_);
      }
    }
    /**
     * repeated .Property properties = 9;
     */
    public net.sf.okapi.proto.textunitflat.Property.Builder addPropertiesBuilder() {
      return getPropertiesFieldBuilder().addBuilder(
          net.sf.okapi.proto.textunitflat.Property.getDefaultInstance());
    }
    /**
     * repeated .Property properties = 9;
     */
    public net.sf.okapi.proto.textunitflat.Property.Builder addPropertiesBuilder(
        int index) {
      return getPropertiesFieldBuilder().addBuilder(
          index, net.sf.okapi.proto.textunitflat.Property.getDefaultInstance());
    }
    /**
     * repeated .Property properties = 9;
     */
    public java.util.List 
         getPropertiesBuilderList() {
      return getPropertiesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.Property, net.sf.okapi.proto.textunitflat.Property.Builder, net.sf.okapi.proto.textunitflat.PropertyOrBuilder> 
        getPropertiesFieldBuilder() {
      if (propertiesBuilder_ == null) {
        propertiesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            net.sf.okapi.proto.textunitflat.Property, net.sf.okapi.proto.textunitflat.Property.Builder, net.sf.okapi.proto.textunitflat.PropertyOrBuilder>(
                properties_,
                ((bitField0_ & 0x00000004) != 0),
                getParentForChildren(),
                isClean());
        properties_ = null;
      }
      return propertiesBuilder_;
    }

    private java.util.List notes_ =
      java.util.Collections.emptyList();
    private void ensureNotesIsMutable() {
      if (!((bitField0_ & 0x00000008) != 0)) {
        notes_ = new java.util.ArrayList(notes_);
        bitField0_ |= 0x00000008;
       }
    }

    private com.google.protobuf.RepeatedFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.Note, net.sf.okapi.proto.textunitflat.Note.Builder, net.sf.okapi.proto.textunitflat.NoteOrBuilder> notesBuilder_;

    /**
     * repeated .Note notes = 10;
     */
    public java.util.List getNotesList() {
      if (notesBuilder_ == null) {
        return java.util.Collections.unmodifiableList(notes_);
      } else {
        return notesBuilder_.getMessageList();
      }
    }
    /**
     * repeated .Note notes = 10;
     */
    public int getNotesCount() {
      if (notesBuilder_ == null) {
        return notes_.size();
      } else {
        return notesBuilder_.getCount();
      }
    }
    /**
     * repeated .Note notes = 10;
     */
    public net.sf.okapi.proto.textunitflat.Note getNotes(int index) {
      if (notesBuilder_ == null) {
        return notes_.get(index);
      } else {
        return notesBuilder_.getMessage(index);
      }
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder setNotes(
        int index, net.sf.okapi.proto.textunitflat.Note value) {
      if (notesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNotesIsMutable();
        notes_.set(index, value);
        onChanged();
      } else {
        notesBuilder_.setMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder setNotes(
        int index, net.sf.okapi.proto.textunitflat.Note.Builder builderForValue) {
      if (notesBuilder_ == null) {
        ensureNotesIsMutable();
        notes_.set(index, builderForValue.build());
        onChanged();
      } else {
        notesBuilder_.setMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder addNotes(net.sf.okapi.proto.textunitflat.Note value) {
      if (notesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNotesIsMutable();
        notes_.add(value);
        onChanged();
      } else {
        notesBuilder_.addMessage(value);
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder addNotes(
        int index, net.sf.okapi.proto.textunitflat.Note value) {
      if (notesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        ensureNotesIsMutable();
        notes_.add(index, value);
        onChanged();
      } else {
        notesBuilder_.addMessage(index, value);
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder addNotes(
        net.sf.okapi.proto.textunitflat.Note.Builder builderForValue) {
      if (notesBuilder_ == null) {
        ensureNotesIsMutable();
        notes_.add(builderForValue.build());
        onChanged();
      } else {
        notesBuilder_.addMessage(builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder addNotes(
        int index, net.sf.okapi.proto.textunitflat.Note.Builder builderForValue) {
      if (notesBuilder_ == null) {
        ensureNotesIsMutable();
        notes_.add(index, builderForValue.build());
        onChanged();
      } else {
        notesBuilder_.addMessage(index, builderForValue.build());
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder addAllNotes(
        java.lang.Iterable values) {
      if (notesBuilder_ == null) {
        ensureNotesIsMutable();
        com.google.protobuf.AbstractMessageLite.Builder.addAll(
            values, notes_);
        onChanged();
      } else {
        notesBuilder_.addAllMessages(values);
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder clearNotes() {
      if (notesBuilder_ == null) {
        notes_ = java.util.Collections.emptyList();
        bitField0_ = (bitField0_ & ~0x00000008);
        onChanged();
      } else {
        notesBuilder_.clear();
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public Builder removeNotes(int index) {
      if (notesBuilder_ == null) {
        ensureNotesIsMutable();
        notes_.remove(index);
        onChanged();
      } else {
        notesBuilder_.remove(index);
      }
      return this;
    }
    /**
     * repeated .Note notes = 10;
     */
    public net.sf.okapi.proto.textunitflat.Note.Builder getNotesBuilder(
        int index) {
      return getNotesFieldBuilder().getBuilder(index);
    }
    /**
     * repeated .Note notes = 10;
     */
    public net.sf.okapi.proto.textunitflat.NoteOrBuilder getNotesOrBuilder(
        int index) {
      if (notesBuilder_ == null) {
        return notes_.get(index);  } else {
        return notesBuilder_.getMessageOrBuilder(index);
      }
    }
    /**
     * repeated .Note notes = 10;
     */
    public java.util.List 
         getNotesOrBuilderList() {
      if (notesBuilder_ != null) {
        return notesBuilder_.getMessageOrBuilderList();
      } else {
        return java.util.Collections.unmodifiableList(notes_);
      }
    }
    /**
     * repeated .Note notes = 10;
     */
    public net.sf.okapi.proto.textunitflat.Note.Builder addNotesBuilder() {
      return getNotesFieldBuilder().addBuilder(
          net.sf.okapi.proto.textunitflat.Note.getDefaultInstance());
    }
    /**
     * repeated .Note notes = 10;
     */
    public net.sf.okapi.proto.textunitflat.Note.Builder addNotesBuilder(
        int index) {
      return getNotesFieldBuilder().addBuilder(
          index, net.sf.okapi.proto.textunitflat.Note.getDefaultInstance());
    }
    /**
     * repeated .Note notes = 10;
     */
    public java.util.List 
         getNotesBuilderList() {
      return getNotesFieldBuilder().getBuilderList();
    }
    private com.google.protobuf.RepeatedFieldBuilderV3<
        net.sf.okapi.proto.textunitflat.Note, net.sf.okapi.proto.textunitflat.Note.Builder, net.sf.okapi.proto.textunitflat.NoteOrBuilder> 
        getNotesFieldBuilder() {
      if (notesBuilder_ == null) {
        notesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3<
            net.sf.okapi.proto.textunitflat.Note, net.sf.okapi.proto.textunitflat.Note.Builder, net.sf.okapi.proto.textunitflat.NoteOrBuilder>(
                notes_,
                ((bitField0_ & 0x00000008) != 0),
                getParentForChildren(),
                isClean());
        notes_ = null;
      }
      return notesBuilder_;
    }
    @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:TextUnit)
  }

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

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

  private static final com.google.protobuf.Parser
      PARSER = new com.google.protobuf.AbstractParser() {
    @java.lang.Override
    public TextUnit parsePartialFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws com.google.protobuf.InvalidProtocolBufferException {
      return new TextUnit(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.TextUnit getDefaultInstanceForType() {
    return DEFAULT_INSTANCE;
  }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy