diff --git a/layoutparser-service/layoutparser-service-internal-api/build.gradle.kts b/layoutparser-service/layoutparser-service-internal-api/build.gradle.kts index d31934a..540de00 100644 --- a/layoutparser-service/layoutparser-service-internal-api/build.gradle.kts +++ b/layoutparser-service/layoutparser-service-internal-api/build.gradle.kts @@ -7,5 +7,5 @@ description = "layoutparser-service-internal-api" dependencies { implementation("io.swagger.core.v3:swagger-annotations:2.2.15") - implementation("com.google.protobuf:protobuf-java-util:4.27.1") + api("com.google.protobuf:protobuf-java-util:4.28.3") } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPageProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPageProto.java index 58f2e1d..14df3f9 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPageProto.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPageProto.java @@ -1,1816 +1,1545 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: DocumentPage.proto -// Protobuf Java Version: 4.27.1 -@SuppressWarnings("all") +// Protobuf Java Version: 4.28.3 + +package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; + public final class DocumentPageProto { + private DocumentPageProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentPageProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private DocumentPageProto() {} - + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface AllDocumentPagesOrBuilder extends + // @@protoc_insertion_point(interface_extends:AllDocumentPages) + com.google.protobuf.MessageOrBuilder { + /** + * repeated .DocumentPage documentPages = 1; + */ + java.util.List + getDocumentPagesList(); + /** + * repeated .DocumentPage documentPages = 1; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage getDocumentPages(int index); + /** + * repeated .DocumentPage documentPages = 1; + */ + int getDocumentPagesCount(); + /** + * repeated .DocumentPage documentPages = 1; + */ + java.util.List + getDocumentPagesOrBuilderList(); + /** + * repeated .DocumentPage documentPages = 1; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPageOrBuilder getDocumentPagesOrBuilder( + int index); + } + /** + * Protobuf type {@code AllDocumentPages} + */ + public static final class AllDocumentPages extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:AllDocumentPages) + AllDocumentPagesOrBuilder { + private static final long serialVersionUID = 0L; static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentPageProto.class.getName()); + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AllDocumentPages.class.getName()); + } + // Use AllDocumentPages.newBuilder() to construct. + private AllDocumentPages(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AllDocumentPages() { + documentPages_ = java.util.Collections.emptyList(); } - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_AllDocumentPages_descriptor; } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_AllDocumentPages_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages.Builder.class); } - - public interface AllDocumentPagesOrBuilder extends - // @@protoc_insertion_point(interface_extends:AllDocumentPages) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .DocumentPage documentPages = 1; - */ - java.util.List getDocumentPagesList(); - - - /** - * repeated .DocumentPage documentPages = 1; - */ - DocumentPageProto.DocumentPage getDocumentPages(int index); - - - /** - * repeated .DocumentPage documentPages = 1; - */ - int getDocumentPagesCount(); - - - /** - * repeated .DocumentPage documentPages = 1; - */ - java.util.List getDocumentPagesOrBuilderList(); - - - /** - * repeated .DocumentPage documentPages = 1; - */ - DocumentPageProto.DocumentPageOrBuilder getDocumentPagesOrBuilder(int index); - + public static final int DOCUMENTPAGES_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List documentPages_; + /** + * repeated .DocumentPage documentPages = 1; + */ + @java.lang.Override + public java.util.List getDocumentPagesList() { + return documentPages_; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + @java.lang.Override + public java.util.List + getDocumentPagesOrBuilderList() { + return documentPages_; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + @java.lang.Override + public int getDocumentPagesCount() { + return documentPages_.size(); + } + /** + * repeated .DocumentPage documentPages = 1; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage getDocumentPages(int index) { + return documentPages_.get(index); + } + /** + * repeated .DocumentPage documentPages = 1; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPageOrBuilder getDocumentPagesOrBuilder( + int index) { + return documentPages_.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 { + for (int i = 0; i < documentPages_.size(); i++) { + output.writeMessage(1, documentPages_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documentPages_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, documentPages_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages) obj; + + if (!getDocumentPagesList() + .equals(other.getDocumentPagesList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentPagesCount() > 0) { + hash = (37 * hash) + DOCUMENTPAGES_FIELD_NUMBER; + hash = (53 * hash) + getDocumentPagesList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code AllDocumentPages} */ - public static final class AllDocumentPages extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:AllDocumentPages) - AllDocumentPagesOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:AllDocumentPages) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPagesOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_AllDocumentPages_descriptor; + } - private static final long serialVersionUID = 0L; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_AllDocumentPages_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages.Builder.class); + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", AllDocumentPages.class.getName()); + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (documentPagesBuilder_ == null) { + documentPages_ = java.util.Collections.emptyList(); + } else { + documentPages_ = null; + documentPagesBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } - // Use AllDocumentPages.newBuilder() to construct. - private AllDocumentPages(com.google.protobuf.GeneratedMessage.Builder builder) { + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_AllDocumentPages_descriptor; + } - super(builder); + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages.getDefaultInstance(); + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } - private AllDocumentPages() { - - documentPages_ = java.util.Collections.emptyList(); - } - - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPageProto.internal_static_AllDocumentPages_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPageProto.internal_static_AllDocumentPages_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPageProto.AllDocumentPages.class, - DocumentPageProto.AllDocumentPages.Builder.class); - } - - - public static final int DOCUMENTPAGES_FIELD_NUMBER = 1; - @SuppressWarnings("serial") - private java.util.List documentPages_; - - - /** - * repeated .DocumentPage documentPages = 1; - */ - @java.lang.Override - public java.util.List getDocumentPagesList() { - - return documentPages_; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - @java.lang.Override - public java.util.List getDocumentPagesOrBuilderList() { - - return documentPages_; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - @java.lang.Override - public int getDocumentPagesCount() { - - return documentPages_.size(); - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - @java.lang.Override - public DocumentPageProto.DocumentPage getDocumentPages(int index) { - - return documentPages_.get(index); - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - @java.lang.Override - public DocumentPageProto.DocumentPageOrBuilder getDocumentPagesOrBuilder(int index) { - - return documentPages_.get(index); - } - - - private byte memoizedIsInitialized = -1; - - - @java.lang.Override - public final boolean isInitialized() { - - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; + private void buildPartialRepeatedFields(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages result) { + if (documentPagesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documentPages_ = java.util.Collections.unmodifiableList(documentPages_); + bitField0_ = (bitField0_ & ~0x00000001); } - if (isInitialized == 0) { - return false; + result.documentPages_ = documentPages_; + } else { + result.documentPages_ = documentPagesBuilder_.build(); + } + } + + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages.getDefaultInstance()) return this; + if (documentPagesBuilder_ == null) { + if (!other.documentPages_.isEmpty()) { + if (documentPages_.isEmpty()) { + documentPages_ = other.documentPages_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentPagesIsMutable(); + documentPages_.addAll(other.documentPages_); + } + onChanged(); } - - memoizedIsInitialized = 1; - return true; - } - - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - for (int i = 0; i < documentPages_.size(); i++) { - output.writeMessage(1, documentPages_.get(i)); + } else { + if (!other.documentPages_.isEmpty()) { + if (documentPagesBuilder_.isEmpty()) { + documentPagesBuilder_.dispose(); + documentPagesBuilder_ = null; + documentPages_ = other.documentPages_; + bitField0_ = (bitField0_ & ~0x00000001); + documentPagesBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDocumentPagesFieldBuilder() : null; + } else { + documentPagesBuilder_.addAllMessages(other.documentPages_); } - getUnknownFields().writeTo(output); - } - - - @java.lang.Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; } - - size = 0; - for (int i = 0; i < documentPages_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documentPages_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - @java.lang.Override - public boolean equals(final java.lang.Object obj) { + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage m = + input.readMessage( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.parser(), + extensionRegistry); + if (documentPagesBuilder_ == null) { + ensureDocumentPagesIsMutable(); + documentPages_.add(m); + } else { + documentPagesBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; - if (obj == this) { - return true; - } - if (!(obj instanceof DocumentPageProto.AllDocumentPages)) { - return super.equals(obj); - } - DocumentPageProto.AllDocumentPages other = (DocumentPageProto.AllDocumentPages) obj; + private java.util.List documentPages_ = + java.util.Collections.emptyList(); + private void ensureDocumentPagesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documentPages_ = new java.util.ArrayList(documentPages_); + bitField0_ |= 0x00000001; + } + } - if (!getDocumentPagesList().equals(other.getDocumentPagesList())) { - return false; + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPageOrBuilder> documentPagesBuilder_; + + /** + * repeated .DocumentPage documentPages = 1; + */ + public java.util.List getDocumentPagesList() { + if (documentPagesBuilder_ == null) { + return java.util.Collections.unmodifiableList(documentPages_); + } else { + return documentPagesBuilder_.getMessageList(); + } + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public int getDocumentPagesCount() { + if (documentPagesBuilder_ == null) { + return documentPages_.size(); + } else { + return documentPagesBuilder_.getCount(); + } + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage getDocumentPages(int index) { + if (documentPagesBuilder_ == null) { + return documentPages_.get(index); + } else { + return documentPagesBuilder_.getMessage(index); + } + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder setDocumentPages( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage value) { + if (documentPagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; + ensureDocumentPagesIsMutable(); + documentPages_.set(index, value); + onChanged(); + } else { + documentPagesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder setDocumentPages( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder builderForValue) { + if (documentPagesBuilder_ == null) { + ensureDocumentPagesIsMutable(); + documentPages_.set(index, builderForValue.build()); + onChanged(); + } else { + documentPagesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder addDocumentPages(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage value) { + if (documentPagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } - return true; + ensureDocumentPagesIsMutable(); + documentPages_.add(value); + onChanged(); + } else { + documentPagesBuilder_.addMessage(value); } - - - @java.lang.Override - public int hashCode() { - - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getDocumentPagesCount() > 0) { - hash = (37 * hash) + DOCUMENTPAGES_FIELD_NUMBER; - hash = (53 * hash) + getDocumentPagesList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder addDocumentPages( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage value) { + if (documentPagesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentPagesIsMutable(); + documentPages_.add(index, value); + onChanged(); + } else { + documentPagesBuilder_.addMessage(index, value); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder addDocumentPages( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder builderForValue) { + if (documentPagesBuilder_ == null) { + ensureDocumentPagesIsMutable(); + documentPages_.add(builderForValue.build()); + onChanged(); + } else { + documentPagesBuilder_.addMessage(builderForValue.build()); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder addDocumentPages( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder builderForValue) { + if (documentPagesBuilder_ == null) { + ensureDocumentPagesIsMutable(); + documentPages_.add(index, builderForValue.build()); + onChanged(); + } else { + documentPagesBuilder_.addMessage(index, builderForValue.build()); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder addAllDocumentPages( + java.lang.Iterable values) { + if (documentPagesBuilder_ == null) { + ensureDocumentPagesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, documentPages_); + onChanged(); + } else { + documentPagesBuilder_.addAllMessages(values); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder clearDocumentPages() { + if (documentPagesBuilder_ == null) { + documentPages_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentPagesBuilder_.clear(); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public Builder removeDocumentPages(int index) { + if (documentPagesBuilder_ == null) { + ensureDocumentPagesIsMutable(); + documentPages_.remove(index); + onChanged(); + } else { + documentPagesBuilder_.remove(index); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); + return this; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder getDocumentPagesBuilder( + int index) { + return getDocumentPagesFieldBuilder().getBuilder(index); + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPageOrBuilder getDocumentPagesOrBuilder( + int index) { + if (documentPagesBuilder_ == null) { + return documentPages_.get(index); } else { + return documentPagesBuilder_.getMessageOrBuilder(index); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public java.util.List + getDocumentPagesOrBuilderList() { + if (documentPagesBuilder_ != null) { + return documentPagesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documentPages_); } - - - public static DocumentPageProto.AllDocumentPages parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPageProto.AllDocumentPages parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static DocumentPageProto.AllDocumentPages parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPageProto.AllDocumentPages parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentPageProto.AllDocumentPages parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @java.lang.Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(DocumentPageProto.AllDocumentPages 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.GeneratedMessage.BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - * Protobuf type {@code AllDocumentPages} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:AllDocumentPages) - DocumentPageProto.AllDocumentPagesOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPageProto.internal_static_AllDocumentPages_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPageProto.internal_static_AllDocumentPages_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPageProto.AllDocumentPages.class, - DocumentPageProto.AllDocumentPages.Builder.class); - } - - - // Construct using DocumentPageOuterClass.AllDocumentPages.newBuilder() - private Builder() { - - } - - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - - super(parent); - - } - - - @java.lang.Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - if (documentPagesBuilder_ == null) { - documentPages_ = java.util.Collections.emptyList(); - } else { - documentPages_ = null; - documentPagesBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentPageProto.internal_static_AllDocumentPages_descriptor; - } - - - @java.lang.Override - public DocumentPageProto.AllDocumentPages getDefaultInstanceForType() { - - return DocumentPageProto.AllDocumentPages.getDefaultInstance(); - } - - - @java.lang.Override - public DocumentPageProto.AllDocumentPages build() { - - DocumentPageProto.AllDocumentPages result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @java.lang.Override - public DocumentPageProto.AllDocumentPages buildPartial() { - - DocumentPageProto.AllDocumentPages result = new DocumentPageProto.AllDocumentPages(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartialRepeatedFields(DocumentPageProto.AllDocumentPages result) { - - if (documentPagesBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - documentPages_ = java.util.Collections.unmodifiableList(documentPages_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.documentPages_ = documentPages_; - } else { - result.documentPages_ = documentPagesBuilder_.build(); - } - } - - - private void buildPartial0(DocumentPageProto.AllDocumentPages result) { - - int from_bitField0_ = bitField0_; - } - - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof DocumentPageProto.AllDocumentPages) { - return mergeFrom((DocumentPageProto.AllDocumentPages) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(DocumentPageProto.AllDocumentPages other) { - - if (other == DocumentPageProto.AllDocumentPages.getDefaultInstance()) { - return this; - } - if (documentPagesBuilder_ == null) { - if (!other.documentPages_.isEmpty()) { - if (documentPages_.isEmpty()) { - documentPages_ = other.documentPages_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDocumentPagesIsMutable(); - documentPages_.addAll(other.documentPages_); - } - onChanged(); - } - } else { - if (!other.documentPages_.isEmpty()) { - if (documentPagesBuilder_.isEmpty()) { - documentPagesBuilder_.dispose(); - documentPagesBuilder_ = null; - documentPages_ = other.documentPages_; - bitField0_ = (bitField0_ & ~0x00000001); - documentPagesBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getDocumentPagesFieldBuilder() : null; - } else { - documentPagesBuilder_.addAllMessages(other.documentPages_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - DocumentPageProto.DocumentPage m = input.readMessage(DocumentPageProto.DocumentPage.parser(), extensionRegistry); - if (documentPagesBuilder_ == null) { - ensureDocumentPagesIsMutable(); - documentPages_.add(m); - } else { - documentPagesBuilder_.addMessage(m); - } - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private java.util.List documentPages_ = java.util.Collections.emptyList(); - - - private void ensureDocumentPagesIsMutable() { - - if (!((bitField0_ & 0x00000001) != 0)) { - documentPages_ = new java.util.ArrayList(documentPages_); - bitField0_ |= 0x00000001; - } - } - - - private com.google.protobuf.RepeatedFieldBuilder documentPagesBuilder_; - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public java.util.List getDocumentPagesList() { - - if (documentPagesBuilder_ == null) { - return java.util.Collections.unmodifiableList(documentPages_); - } else { - return documentPagesBuilder_.getMessageList(); - } - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public int getDocumentPagesCount() { - - if (documentPagesBuilder_ == null) { - return documentPages_.size(); - } else { - return documentPagesBuilder_.getCount(); - } - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public DocumentPageProto.DocumentPage getDocumentPages(int index) { - - if (documentPagesBuilder_ == null) { - return documentPages_.get(index); - } else { - return documentPagesBuilder_.getMessage(index); - } - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder setDocumentPages(int index, DocumentPageProto.DocumentPage value) { - - if (documentPagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentPagesIsMutable(); - documentPages_.set(index, value); - onChanged(); - } else { - documentPagesBuilder_.setMessage(index, value); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder setDocumentPages(int index, DocumentPageProto.DocumentPage.Builder builderForValue) { - - if (documentPagesBuilder_ == null) { - ensureDocumentPagesIsMutable(); - documentPages_.set(index, builderForValue.build()); - onChanged(); - } else { - documentPagesBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder addDocumentPages(DocumentPageProto.DocumentPage value) { - - if (documentPagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentPagesIsMutable(); - documentPages_.add(value); - onChanged(); - } else { - documentPagesBuilder_.addMessage(value); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder addDocumentPages(int index, DocumentPageProto.DocumentPage value) { - - if (documentPagesBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentPagesIsMutable(); - documentPages_.add(index, value); - onChanged(); - } else { - documentPagesBuilder_.addMessage(index, value); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder addDocumentPages(DocumentPageProto.DocumentPage.Builder builderForValue) { - - if (documentPagesBuilder_ == null) { - ensureDocumentPagesIsMutable(); - documentPages_.add(builderForValue.build()); - onChanged(); - } else { - documentPagesBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder addDocumentPages(int index, DocumentPageProto.DocumentPage.Builder builderForValue) { - - if (documentPagesBuilder_ == null) { - ensureDocumentPagesIsMutable(); - documentPages_.add(index, builderForValue.build()); - onChanged(); - } else { - documentPagesBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder addAllDocumentPages(java.lang.Iterable values) { - - if (documentPagesBuilder_ == null) { - ensureDocumentPagesIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentPages_); - onChanged(); - } else { - documentPagesBuilder_.addAllMessages(values); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder clearDocumentPages() { - - if (documentPagesBuilder_ == null) { - documentPages_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - documentPagesBuilder_.clear(); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public Builder removeDocumentPages(int index) { - - if (documentPagesBuilder_ == null) { - ensureDocumentPagesIsMutable(); - documentPages_.remove(index); - onChanged(); - } else { - documentPagesBuilder_.remove(index); - } - return this; - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public DocumentPageProto.DocumentPage.Builder getDocumentPagesBuilder(int index) { - - return getDocumentPagesFieldBuilder().getBuilder(index); - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public DocumentPageProto.DocumentPageOrBuilder getDocumentPagesOrBuilder(int index) { - - if (documentPagesBuilder_ == null) { - return documentPages_.get(index); - } else { - return documentPagesBuilder_.getMessageOrBuilder(index); - } - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public java.util.List getDocumentPagesOrBuilderList() { - - if (documentPagesBuilder_ != null) { - return documentPagesBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(documentPages_); - } - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public DocumentPageProto.DocumentPage.Builder addDocumentPagesBuilder() { - - return getDocumentPagesFieldBuilder().addBuilder(DocumentPageProto.DocumentPage.getDefaultInstance()); - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public DocumentPageProto.DocumentPage.Builder addDocumentPagesBuilder(int index) { - - return getDocumentPagesFieldBuilder().addBuilder(index, DocumentPageProto.DocumentPage.getDefaultInstance()); - } - - - /** - * repeated .DocumentPage documentPages = 1; - */ - public java.util.List getDocumentPagesBuilderList() { - - return getDocumentPagesFieldBuilder().getBuilderList(); - } - - - private com.google.protobuf.RepeatedFieldBuilder getDocumentPagesFieldBuilder() { - - if (documentPagesBuilder_ == null) { - documentPagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder( - documentPages_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - documentPages_ = null; - } - return documentPagesBuilder_; - } - - // @@protoc_insertion_point(builder_scope:AllDocumentPages) - } - - // @@protoc_insertion_point(class_scope:AllDocumentPages) - private static final DocumentPageProto.AllDocumentPages DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new DocumentPageProto.AllDocumentPages(); - } - - public static DocumentPageProto.AllDocumentPages getDefaultInstance() { - - return DEFAULT_INSTANCE; - } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AllDocumentPages parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - - public static com.google.protobuf.Parser parser() { - - return PARSER; - } - - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - - return PARSER; - } - - - @java.lang.Override - public DocumentPageProto.AllDocumentPages getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder addDocumentPagesBuilder() { + return getDocumentPagesFieldBuilder().addBuilder( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.getDefaultInstance()); + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder addDocumentPagesBuilder( + int index) { + return getDocumentPagesFieldBuilder().addBuilder( + index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.getDefaultInstance()); + } + /** + * repeated .DocumentPage documentPages = 1; + */ + public java.util.List + getDocumentPagesBuilderList() { + return getDocumentPagesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPageOrBuilder> + getDocumentPagesFieldBuilder() { + if (documentPagesBuilder_ == null) { + documentPagesBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPageOrBuilder>( + documentPages_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + documentPages_ = null; } + return documentPagesBuilder_; + } + // @@protoc_insertion_point(builder_scope:AllDocumentPages) } - public interface DocumentPageOrBuilder extends - // @@protoc_insertion_point(interface_extends:DocumentPage) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * The page number, starting with 1.
-         * 
- * - * int32 number = 1; - * - * @return The number. - */ - int getNumber(); - - - /** - *
-         * The page height in PDF user units.
-         * 
- * - * int32 height = 2; - * - * @return The height. - */ - int getHeight(); - - - /** - *
-         * The page width in PDF user units.
-         * 
- * - * int32 width = 3; - * - * @return The width. - */ - int getWidth(); - - - /** - *
-         * The page rotation as specified by the PDF.
-         * 
- * - * int32 rotation = 4; - * - * @return The rotation. - */ - int getRotation(); - + // @@protoc_insertion_point(class_scope:AllDocumentPages) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages(); } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllDocumentPages parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DocumentPageOrBuilder extends + // @@protoc_insertion_point(interface_extends:DocumentPage) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The page number, starting with 1.
+     * 
+ * + * int32 number = 1; + * @return The number. + */ + int getNumber(); + + /** + *
+     * The page height in PDF user units.
+     * 
+ * + * int32 height = 2; + * @return The height. + */ + int getHeight(); + + /** + *
+     * The page width in PDF user units.
+     * 
+ * + * int32 width = 3; + * @return The width. + */ + int getWidth(); + + /** + *
+     * The page rotation as specified by the PDF.
+     * 
+ * + * int32 rotation = 4; + * @return The rotation. + */ + int getRotation(); + } + /** + * Protobuf type {@code DocumentPage} + */ + public static final class DocumentPage extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:DocumentPage) + DocumentPageOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentPage.class.getName()); + } + // Use DocumentPage.newBuilder() to construct. + private DocumentPage(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DocumentPage() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_DocumentPage_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_DocumentPage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder.class); + } + + public static final int NUMBER_FIELD_NUMBER = 1; + private int number_ = 0; + /** + *
+     * The page number, starting with 1.
+     * 
+ * + * int32 number = 1; + * @return The number. + */ + @java.lang.Override + public int getNumber() { + return number_; + } + + public static final int HEIGHT_FIELD_NUMBER = 2; + private int height_ = 0; + /** + *
+     * The page height in PDF user units.
+     * 
+ * + * int32 height = 2; + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + + public static final int WIDTH_FIELD_NUMBER = 3; + private int width_ = 0; + /** + *
+     * The page width in PDF user units.
+     * 
+ * + * int32 width = 3; + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + + public static final int ROTATION_FIELD_NUMBER = 4; + private int rotation_ = 0; + /** + *
+     * The page rotation as specified by the PDF.
+     * 
+ * + * int32 rotation = 4; + * @return The rotation. + */ + @java.lang.Override + public int getRotation() { + return rotation_; + } + + 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 (number_ != 0) { + output.writeInt32(1, number_); + } + if (height_ != 0) { + output.writeInt32(2, height_); + } + if (width_ != 0) { + output.writeInt32(3, width_); + } + if (rotation_ != 0) { + output.writeInt32(4, rotation_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (number_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, number_); + } + if (height_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, height_); + } + if (width_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, width_); + } + if (rotation_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, rotation_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage) obj; + + if (getNumber() + != other.getNumber()) return false; + if (getHeight() + != other.getHeight()) return false; + if (getWidth() + != other.getWidth()) return false; + if (getRotation() + != other.getRotation()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + NUMBER_FIELD_NUMBER; + hash = (53 * hash) + getNumber(); + hash = (37 * hash) + HEIGHT_FIELD_NUMBER; + hash = (53 * hash) + getHeight(); + hash = (37 * hash) + WIDTH_FIELD_NUMBER; + hash = (53 * hash) + getWidth(); + hash = (37 * hash) + ROTATION_FIELD_NUMBER; + hash = (53 * hash) + getRotation(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code DocumentPage} */ - public static final class DocumentPage extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:DocumentPage) - DocumentPageOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:DocumentPage) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPageOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_DocumentPage_descriptor; + } - private static final long serialVersionUID = 0L; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_DocumentPage_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.Builder.class); + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentPage.class.getName()); + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + number_ = 0; + height_ = 0; + width_ = 0; + rotation_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_DocumentPage_descriptor; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.getDefaultInstance(); + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // Use DocumentPage.newBuilder() to construct. - private DocumentPage(com.google.protobuf.GeneratedMessage.Builder builder) { + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } - super(builder); + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.number_ = number_; } - - - private DocumentPage() { - + if (((from_bitField0_ & 0x00000002) != 0)) { + result.height_ = height_; } - - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPageProto.internal_static_DocumentPage_descriptor; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.width_ = width_; } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPageProto.internal_static_DocumentPage_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPageProto.DocumentPage.class, - DocumentPageProto.DocumentPage.Builder.class); + if (((from_bitField0_ & 0x00000008) != 0)) { + result.rotation_ = rotation_; } + } - - public static final int NUMBER_FIELD_NUMBER = 1; - private int number_ = 0; - - - /** - *
-         * The page number, starting with 1.
-         * 
- * - * int32 number = 1; - * - * @return The number. - */ - @java.lang.Override - public int getNumber() { - - return number_; + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage)other); + } else { + super.mergeFrom(other); + return this; } + } - - public static final int HEIGHT_FIELD_NUMBER = 2; - private int height_ = 0; - - - /** - *
-         * The page height in PDF user units.
-         * 
- * - * int32 height = 2; - * - * @return The height. - */ - @java.lang.Override - public int getHeight() { - - return height_; + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage.getDefaultInstance()) return this; + if (other.getNumber() != 0) { + setNumber(other.getNumber()); } - - - public static final int WIDTH_FIELD_NUMBER = 3; - private int width_ = 0; - - - /** - *
-         * The page width in PDF user units.
-         * 
- * - * int32 width = 3; - * - * @return The width. - */ - @java.lang.Override - public int getWidth() { - - return width_; + if (other.getHeight() != 0) { + setHeight(other.getHeight()); } - - - public static final int ROTATION_FIELD_NUMBER = 4; - private int rotation_ = 0; - - - /** - *
-         * The page rotation as specified by the PDF.
-         * 
- * - * int32 rotation = 4; - * - * @return The rotation. - */ - @java.lang.Override - public int getRotation() { - - return rotation_; + if (other.getWidth() != 0) { + setWidth(other.getWidth()); } - - - 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; + if (other.getRotation() != 0) { + setRotation(other.getRotation()); } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - if (number_ != 0) { - output.writeInt32(1, number_); - } - if (height_ != 0) { - output.writeInt32(2, height_); - } - if (width_ != 0) { - output.writeInt32(3, width_); - } - if (rotation_ != 0) { - output.writeInt32(4, rotation_); - } - getUnknownFields().writeTo(output); + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - - - @java.lang.Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - if (number_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, number_); - } - if (height_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(2, height_); - } - if (width_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(3, width_); - } - if (rotation_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, rotation_); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof DocumentPageProto.DocumentPage)) { - return super.equals(obj); - } - DocumentPageProto.DocumentPage other = (DocumentPageProto.DocumentPage) obj; - - if (getNumber() != other.getNumber()) { - return false; - } - if (getHeight() != other.getHeight()) { - return false; - } - if (getWidth() != other.getWidth()) { - return false; - } - if (getRotation() != other.getRotation()) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - 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) + NUMBER_FIELD_NUMBER; - hash = (53 * hash) + getNumber(); - hash = (37 * hash) + HEIGHT_FIELD_NUMBER; - hash = (53 * hash) + getHeight(); - hash = (37 * hash) + WIDTH_FIELD_NUMBER; - hash = (53 * hash) + getWidth(); - hash = (37 * hash) + ROTATION_FIELD_NUMBER; - hash = (53 * hash) + getRotation(); - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - - public static DocumentPageProto.DocumentPage parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPageProto.DocumentPage parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPageProto.DocumentPage parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPageProto.DocumentPage parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPageProto.DocumentPage parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPageProto.DocumentPage parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPageProto.DocumentPage parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentPageProto.DocumentPage parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPageProto.DocumentPage parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static DocumentPageProto.DocumentPage parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPageProto.DocumentPage parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentPageProto.DocumentPage parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @java.lang.Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(DocumentPageProto.DocumentPage 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.GeneratedMessage.BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - * Protobuf type {@code DocumentPage} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:DocumentPage) - DocumentPageProto.DocumentPageOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPageProto.internal_static_DocumentPage_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPageProto.internal_static_DocumentPage_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPageProto.DocumentPage.class, - DocumentPageProto.DocumentPage.Builder.class); - } - - - // Construct using DocumentPageOuterClass.DocumentPage.newBuilder() - private Builder() { - - } - - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - - super(parent); - - } - - - @java.lang.Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - number_ = 0; - height_ = 0; - width_ = 0; - rotation_ = 0; - return this; - } - - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentPageProto.internal_static_DocumentPage_descriptor; - } - - - @java.lang.Override - public DocumentPageProto.DocumentPage getDefaultInstanceForType() { - - return DocumentPageProto.DocumentPage.getDefaultInstance(); - } - - - @java.lang.Override - public DocumentPageProto.DocumentPage build() { - - DocumentPageProto.DocumentPage result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @java.lang.Override - public DocumentPageProto.DocumentPage buildPartial() { - - DocumentPageProto.DocumentPage result = new DocumentPageProto.DocumentPage(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartial0(DocumentPageProto.DocumentPage result) { - - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.number_ = number_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.height_ = height_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.width_ = width_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.rotation_ = rotation_; - } - } - - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof DocumentPageProto.DocumentPage) { - return mergeFrom((DocumentPageProto.DocumentPage) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(DocumentPageProto.DocumentPage other) { - - if (other == DocumentPageProto.DocumentPage.getDefaultInstance()) { - return this; - } - if (other.getNumber() != 0) { - setNumber(other.getNumber()); - } - if (other.getHeight() != 0) { - setHeight(other.getHeight()); - } - if (other.getWidth() != 0) { - setWidth(other.getWidth()); - } - if (other.getRotation() != 0) { - setRotation(other.getRotation()); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - number_ = input.readInt32(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - height_ = input.readInt32(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 24: { - width_ = input.readInt32(); - bitField0_ |= 0x00000004; - break; - } // case 24 - case 32: { - rotation_ = input.readInt32(); - bitField0_ |= 0x00000008; - break; - } // case 32 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private int number_; - - - /** - *
-             * The page number, starting with 1.
-             * 
- * - * int32 number = 1; - * - * @return The number. - */ - @java.lang.Override - public int getNumber() { - - return number_; - } - - - /** - *
-             * The page number, starting with 1.
-             * 
- * - * int32 number = 1; - * - * @param value The number to set. - * @return This builder for chaining. - */ - public Builder setNumber(int value) { - - number_ = value; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + number_ = input.readInt32(); bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - *
-             * The page number, starting with 1.
-             * 
- * - * int32 number = 1; - * - * @return This builder for chaining. - */ - public Builder clearNumber() { - - bitField0_ = (bitField0_ & ~0x00000001); - number_ = 0; - onChanged(); - return this; - } - - - private int height_; - - - /** - *
-             * The page height in PDF user units.
-             * 
- * - * int32 height = 2; - * - * @return The height. - */ - @java.lang.Override - public int getHeight() { - - return height_; - } - - - /** - *
-             * The page height in PDF user units.
-             * 
- * - * int32 height = 2; - * - * @param value The height to set. - * @return This builder for chaining. - */ - public Builder setHeight(int value) { - - height_ = value; + break; + } // case 8 + case 16: { + height_ = input.readInt32(); bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * The page height in PDF user units.
-             * 
- * - * int32 height = 2; - * - * @return This builder for chaining. - */ - public Builder clearHeight() { - - bitField0_ = (bitField0_ & ~0x00000002); - height_ = 0; - onChanged(); - return this; - } - - - private int width_; - - - /** - *
-             * The page width in PDF user units.
-             * 
- * - * int32 width = 3; - * - * @return The width. - */ - @java.lang.Override - public int getWidth() { - - return width_; - } - - - /** - *
-             * The page width in PDF user units.
-             * 
- * - * int32 width = 3; - * - * @param value The width to set. - * @return This builder for chaining. - */ - public Builder setWidth(int value) { - - width_ = value; + break; + } // case 16 + case 24: { + width_ = input.readInt32(); bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - - /** - *
-             * The page width in PDF user units.
-             * 
- * - * int32 width = 3; - * - * @return This builder for chaining. - */ - public Builder clearWidth() { - - bitField0_ = (bitField0_ & ~0x00000004); - width_ = 0; - onChanged(); - return this; - } - - - private int rotation_; - - - /** - *
-             * The page rotation as specified by the PDF.
-             * 
- * - * int32 rotation = 4; - * - * @return The rotation. - */ - @java.lang.Override - public int getRotation() { - - return rotation_; - } - - - /** - *
-             * The page rotation as specified by the PDF.
-             * 
- * - * int32 rotation = 4; - * - * @param value The rotation to set. - * @return This builder for chaining. - */ - public Builder setRotation(int value) { - - rotation_ = value; + break; + } // case 24 + case 32: { + rotation_ = input.readInt32(); bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - - /** - *
-             * The page rotation as specified by the PDF.
-             * 
- * - * int32 rotation = 4; - * - * @return This builder for chaining. - */ - public Builder clearRotation() { - - bitField0_ = (bitField0_ & ~0x00000008); - rotation_ = 0; - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:DocumentPage) - } - - // @@protoc_insertion_point(class_scope:DocumentPage) - private static final DocumentPageProto.DocumentPage DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new DocumentPageProto.DocumentPage(); - } - - public static DocumentPageProto.DocumentPage getDefaultInstance() { - - return DEFAULT_INSTANCE; - } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DocumentPage parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); + break; + } // case 32 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag } - return builder.buildPartial(); - } - }; + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + private int number_ ; + /** + *
+       * The page number, starting with 1.
+       * 
+ * + * int32 number = 1; + * @return The number. + */ + @java.lang.Override + public int getNumber() { + return number_; + } + /** + *
+       * The page number, starting with 1.
+       * 
+ * + * int32 number = 1; + * @param value The number to set. + * @return This builder for chaining. + */ + public Builder setNumber(int value) { - public static com.google.protobuf.Parser parser() { + number_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * The page number, starting with 1.
+       * 
+ * + * int32 number = 1; + * @return This builder for chaining. + */ + public Builder clearNumber() { + bitField0_ = (bitField0_ & ~0x00000001); + number_ = 0; + onChanged(); + return this; + } - return PARSER; - } + private int height_ ; + /** + *
+       * The page height in PDF user units.
+       * 
+ * + * int32 height = 2; + * @return The height. + */ + @java.lang.Override + public int getHeight() { + return height_; + } + /** + *
+       * The page height in PDF user units.
+       * 
+ * + * int32 height = 2; + * @param value The height to set. + * @return This builder for chaining. + */ + public Builder setHeight(int value) { + height_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * The page height in PDF user units.
+       * 
+ * + * int32 height = 2; + * @return This builder for chaining. + */ + public Builder clearHeight() { + bitField0_ = (bitField0_ & ~0x00000002); + height_ = 0; + onChanged(); + return this; + } - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { + private int width_ ; + /** + *
+       * The page width in PDF user units.
+       * 
+ * + * int32 width = 3; + * @return The width. + */ + @java.lang.Override + public int getWidth() { + return width_; + } + /** + *
+       * The page width in PDF user units.
+       * 
+ * + * int32 width = 3; + * @param value The width to set. + * @return This builder for chaining. + */ + public Builder setWidth(int value) { - return PARSER; - } + width_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * The page width in PDF user units.
+       * 
+ * + * int32 width = 3; + * @return This builder for chaining. + */ + public Builder clearWidth() { + bitField0_ = (bitField0_ & ~0x00000004); + width_ = 0; + onChanged(); + return this; + } + private int rotation_ ; + /** + *
+       * The page rotation as specified by the PDF.
+       * 
+ * + * int32 rotation = 4; + * @return The rotation. + */ + @java.lang.Override + public int getRotation() { + return rotation_; + } + /** + *
+       * The page rotation as specified by the PDF.
+       * 
+ * + * int32 rotation = 4; + * @param value The rotation to set. + * @return This builder for chaining. + */ + public Builder setRotation(int value) { - @java.lang.Override - public DocumentPageProto.DocumentPage getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; - } + rotation_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * The page rotation as specified by the PDF.
+       * 
+ * + * int32 rotation = 4; + * @return This builder for chaining. + */ + public Builder clearRotation() { + bitField0_ = (bitField0_ & ~0x00000008); + rotation_ = 0; + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:DocumentPage) } - private static final com.google.protobuf.Descriptors.Descriptor internal_static_AllDocumentPages_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_AllDocumentPages_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_DocumentPage_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_DocumentPage_fieldAccessorTable; - - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - - return descriptor; - } - - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - + // @@protoc_insertion_point(class_scope:DocumentPage) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage DEFAULT_INSTANCE; static { - java.lang.String[] descriptorData = {"\n\022DocumentPage.proto\"8\n\020AllDocumentPages" - + "\022$\n\rdocumentPages\030\001 \003(\0132\r.DocumentPage\"O" - + "\n\014DocumentPage\022\016\n\006number\030\001 \001(\005\022\016\n\006height" - + "\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\022\020\n\010rotation\030\004 \001(\005b" - + "\006proto3"}; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[]{}); - internal_static_AllDocumentPages_descriptor = getDescriptor().getMessageTypes() - .get(0); - internal_static_AllDocumentPages_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_AllDocumentPages_descriptor, - new java.lang.String[]{"DocumentPages",}); - internal_static_DocumentPage_descriptor = getDescriptor().getMessageTypes() - .get(1); - internal_static_DocumentPage_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_DocumentPage_descriptor, - new java.lang.String[]{"Number", "Height", "Width", "Rotation",}); - descriptor.resolveAllFeaturesImmutable(); + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage(); } - // @@protoc_insertion_point(outer_class_scope) + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentPage parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_AllDocumentPages_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_AllDocumentPages_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DocumentPage_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DocumentPage_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\022DocumentPage.proto\"8\n\020AllDocumentPages" + + "\022$\n\rdocumentPages\030\001 \003(\0132\r.DocumentPage\"O" + + "\n\014DocumentPage\022\016\n\006number\030\001 \001(\005\022\016\n\006height" + + "\030\002 \001(\005\022\r\n\005width\030\003 \001(\005\022\020\n\010rotation\030\004 \001(\005B" + + "[\nFcom.knecon.fforesight.service.layoutp" + + "arser.internal.api.data.redactionB\021Docum" + + "entPageProtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_AllDocumentPages_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_AllDocumentPages_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_AllDocumentPages_descriptor, + new java.lang.String[] { "DocumentPages", }); + internal_static_DocumentPage_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_DocumentPage_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_DocumentPage_descriptor, + new java.lang.String[] { "Number", "Height", "Width", "Rotation", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPositionDataProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPositionDataProto.java index 890afd1..2848ea4 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPositionDataProto.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPositionDataProto.java @@ -1,3086 +1,2653 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: DocumentPositionData.proto -// Protobuf Java Version: 4.27.1 -@SuppressWarnings("all") +// Protobuf Java Version: 4.28.3 + +package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; + public final class DocumentPositionDataProto { + private DocumentPositionDataProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentPositionDataProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private DocumentPositionDataProto() {} - + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface AllDocumentPositionDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:AllDocumentPositionData) + com.google.protobuf.MessageOrBuilder { + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + java.util.List + getDocumentPositionDataList(); + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDocumentPositionData(int index); + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + int getDocumentPositionDataCount(); + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + java.util.List + getDocumentPositionDataOrBuilderList(); + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionDataOrBuilder getDocumentPositionDataOrBuilder( + int index); + } + /** + * Protobuf type {@code AllDocumentPositionData} + */ + public static final class AllDocumentPositionData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:AllDocumentPositionData) + AllDocumentPositionDataOrBuilder { + private static final long serialVersionUID = 0L; static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentPositionDataProto.class.getName()); + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AllDocumentPositionData.class.getName()); + } + // Use AllDocumentPositionData.newBuilder() to construct. + private AllDocumentPositionData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AllDocumentPositionData() { + documentPositionData_ = java.util.Collections.emptyList(); } - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_AllDocumentPositionData_descriptor; } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_AllDocumentPositionData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData.Builder.class); } - - public interface AllDocumentPositionDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:AllDocumentPositionData) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - java.util.List getDocumentPositionDataList(); - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - DocumentPositionData getDocumentPositionData(int index); - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - int getDocumentPositionDataCount(); - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - java.util.List getDocumentPositionDataOrBuilderList(); - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - DocumentPositionDataOrBuilder getDocumentPositionDataOrBuilder(int index); - + public static final int DOCUMENTPOSITIONDATA_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List documentPositionData_; + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + @java.lang.Override + public java.util.List getDocumentPositionDataList() { + return documentPositionData_; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + @java.lang.Override + public java.util.List + getDocumentPositionDataOrBuilderList() { + return documentPositionData_; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + @java.lang.Override + public int getDocumentPositionDataCount() { + return documentPositionData_.size(); + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDocumentPositionData(int index) { + return documentPositionData_.get(index); + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionDataOrBuilder getDocumentPositionDataOrBuilder( + int index) { + return documentPositionData_.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 { + for (int i = 0; i < documentPositionData_.size(); i++) { + output.writeMessage(1, documentPositionData_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documentPositionData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, documentPositionData_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData) obj; + + if (!getDocumentPositionDataList() + .equals(other.getDocumentPositionDataList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentPositionDataCount() > 0) { + hash = (37 * hash) + DOCUMENTPOSITIONDATA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentPositionDataList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code AllDocumentPositionData} */ - public static final class AllDocumentPositionData extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:AllDocumentPositionData) - AllDocumentPositionDataOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:AllDocumentPositionData) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_AllDocumentPositionData_descriptor; + } - private static final long serialVersionUID = 0L; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_AllDocumentPositionData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData.Builder.class); + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", AllDocumentPositionData.class.getName()); + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (documentPositionDataBuilder_ == null) { + documentPositionData_ = java.util.Collections.emptyList(); + } else { + documentPositionData_ = null; + documentPositionDataBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } - // Use AllDocumentPositionData.newBuilder() to construct. - private AllDocumentPositionData(com.google.protobuf.GeneratedMessage.Builder builder) { + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_AllDocumentPositionData_descriptor; + } - super(builder); + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData.getDefaultInstance(); + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } - private AllDocumentPositionData() { - - documentPositionData_ = java.util.Collections.emptyList(); + private void buildPartialRepeatedFields(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData result) { + if (documentPositionDataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documentPositionData_ = java.util.Collections.unmodifiableList(documentPositionData_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.documentPositionData_ = documentPositionData_; + } else { + result.documentPositionData_ = documentPositionDataBuilder_.build(); } + } + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData result) { + int from_bitField0_ = bitField0_; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPositionDataProto.internal_static_AllDocumentPositionData_descriptor; + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData)other); + } else { + super.mergeFrom(other); + return this; } + } + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData.getDefaultInstance()) return this; + if (documentPositionDataBuilder_ == null) { + if (!other.documentPositionData_.isEmpty()) { + if (documentPositionData_.isEmpty()) { + documentPositionData_ = other.documentPositionData_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentPositionDataIsMutable(); + documentPositionData_.addAll(other.documentPositionData_); + } + onChanged(); + } + } else { + if (!other.documentPositionData_.isEmpty()) { + if (documentPositionDataBuilder_.isEmpty()) { + documentPositionDataBuilder_.dispose(); + documentPositionDataBuilder_ = null; + documentPositionData_ = other.documentPositionData_; + bitField0_ = (bitField0_ & ~0x00000001); + documentPositionDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDocumentPositionDataFieldBuilder() : null; + } else { + documentPositionDataBuilder_.addAllMessages(other.documentPositionData_); + } + } + } + this.mergeUnknownFields(other.getUnknownFields()); + 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 { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData m = + input.readMessage( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.parser(), + extensionRegistry); + if (documentPositionDataBuilder_ == null) { + ensureDocumentPositionDataIsMutable(); + documentPositionData_.add(m); + } else { + documentPositionDataBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.util.List documentPositionData_ = + java.util.Collections.emptyList(); + private void ensureDocumentPositionDataIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documentPositionData_ = new java.util.ArrayList(documentPositionData_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionDataOrBuilder> documentPositionDataBuilder_; + + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public java.util.List getDocumentPositionDataList() { + if (documentPositionDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(documentPositionData_); + } else { + return documentPositionDataBuilder_.getMessageList(); + } + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public int getDocumentPositionDataCount() { + if (documentPositionDataBuilder_ == null) { + return documentPositionData_.size(); + } else { + return documentPositionDataBuilder_.getCount(); + } + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDocumentPositionData(int index) { + if (documentPositionDataBuilder_ == null) { + return documentPositionData_.get(index); + } else { + return documentPositionDataBuilder_.getMessage(index); + } + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder setDocumentPositionData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData value) { + if (documentPositionDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentPositionDataIsMutable(); + documentPositionData_.set(index, value); + onChanged(); + } else { + documentPositionDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder setDocumentPositionData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder builderForValue) { + if (documentPositionDataBuilder_ == null) { + ensureDocumentPositionDataIsMutable(); + documentPositionData_.set(index, builderForValue.build()); + onChanged(); + } else { + documentPositionDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder addDocumentPositionData(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData value) { + if (documentPositionDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentPositionDataIsMutable(); + documentPositionData_.add(value); + onChanged(); + } else { + documentPositionDataBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder addDocumentPositionData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData value) { + if (documentPositionDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentPositionDataIsMutable(); + documentPositionData_.add(index, value); + onChanged(); + } else { + documentPositionDataBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder addDocumentPositionData( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder builderForValue) { + if (documentPositionDataBuilder_ == null) { + ensureDocumentPositionDataIsMutable(); + documentPositionData_.add(builderForValue.build()); + onChanged(); + } else { + documentPositionDataBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder addDocumentPositionData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder builderForValue) { + if (documentPositionDataBuilder_ == null) { + ensureDocumentPositionDataIsMutable(); + documentPositionData_.add(index, builderForValue.build()); + onChanged(); + } else { + documentPositionDataBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder addAllDocumentPositionData( + java.lang.Iterable values) { + if (documentPositionDataBuilder_ == null) { + ensureDocumentPositionDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, documentPositionData_); + onChanged(); + } else { + documentPositionDataBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder clearDocumentPositionData() { + if (documentPositionDataBuilder_ == null) { + documentPositionData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentPositionDataBuilder_.clear(); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public Builder removeDocumentPositionData(int index) { + if (documentPositionDataBuilder_ == null) { + ensureDocumentPositionDataIsMutable(); + documentPositionData_.remove(index); + onChanged(); + } else { + documentPositionDataBuilder_.remove(index); + } + return this; + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder getDocumentPositionDataBuilder( + int index) { + return getDocumentPositionDataFieldBuilder().getBuilder(index); + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionDataOrBuilder getDocumentPositionDataOrBuilder( + int index) { + if (documentPositionDataBuilder_ == null) { + return documentPositionData_.get(index); } else { + return documentPositionDataBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public java.util.List + getDocumentPositionDataOrBuilderList() { + if (documentPositionDataBuilder_ != null) { + return documentPositionDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documentPositionData_); + } + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder addDocumentPositionDataBuilder() { + return getDocumentPositionDataFieldBuilder().addBuilder( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.getDefaultInstance()); + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder addDocumentPositionDataBuilder( + int index) { + return getDocumentPositionDataFieldBuilder().addBuilder( + index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.getDefaultInstance()); + } + /** + * repeated .DocumentPositionData documentPositionData = 1; + */ + public java.util.List + getDocumentPositionDataBuilderList() { + return getDocumentPositionDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionDataOrBuilder> + getDocumentPositionDataFieldBuilder() { + if (documentPositionDataBuilder_ == null) { + documentPositionDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionDataOrBuilder>( + documentPositionData_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + documentPositionData_ = null; + } + return documentPositionDataBuilder_; + } + + // @@protoc_insertion_point(builder_scope:AllDocumentPositionData) + } + + // @@protoc_insertion_point(class_scope:AllDocumentPositionData) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData(); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllDocumentPositionData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DocumentPositionDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:DocumentPositionData) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Identifier of the text block.
+     * 
+ * + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
+     * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+     * This is required due to the text and position coordinates not being equal.
+     * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @return A list containing the stringIdxToPositionIdx. + */ + java.util.List getStringIdxToPositionIdxList(); + /** + *
+     * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+     * This is required due to the text and position coordinates not being equal.
+     * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @return The count of stringIdxToPositionIdx. + */ + int getStringIdxToPositionIdxCount(); + /** + *
+     * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+     * This is required due to the text and position coordinates not being equal.
+     * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @param index The index of the element to return. + * @return The stringIdxToPositionIdx at the given index. + */ + int getStringIdxToPositionIdx(int index); + + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + java.util.List + getPositionsList(); + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getPositions(int index); + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + int getPositionsCount(); + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + java.util.List + getPositionsOrBuilderList(); + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder getPositionsOrBuilder( + int index); + } + /** + * Protobuf type {@code DocumentPositionData} + */ + public static final class DocumentPositionData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:DocumentPositionData) + DocumentPositionDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentPositionData.class.getName()); + } + // Use DocumentPositionData.newBuilder() to construct. + private DocumentPositionData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DocumentPositionData() { + stringIdxToPositionIdx_ = emptyIntList(); + positions_ = java.util.Collections.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder.class); + } + + public interface PositionOrBuilder extends + // @@protoc_insertion_point(interface_extends:DocumentPositionData.Position) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated float value = 1; + * @return A list containing the value. + */ + java.util.List getValueList(); + /** + * repeated float value = 1; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated float value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + float getValue(int index); + } + /** + *
+     * Definition of a BoundingBox that contains x, y, width, and height.
+     * 
+ * + * Protobuf type {@code DocumentPositionData.Position} + */ + public static final class Position extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:DocumentPositionData.Position) + PositionOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + Position.class.getName()); + } + // Use Position.newBuilder() to construct. + private Position(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Position() { + value_ = emptyFloatList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.FloatList value_ = + emptyFloatList(); + /** + * repeated float value = 1; + * @return A list containing the value. + */ + @java.lang.Override + public java.util.List + getValueList() { + return value_; + } + /** + * repeated float value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated float value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public float getValue(int index) { + return value_.getFloat(index); + } + private int valueMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (getValueList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valueMemoizedSerializedSize); + } + for (int i = 0; i < value_.size(); i++) { + output.writeFloatNoTag(value_.getFloat(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 4 * getValueList().size(); + size += dataSize; + if (!getValueList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valueMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+       * Definition of a BoundingBox that contains x, y, width, and height.
+       * 
+ * + * Protobuf type {@code DocumentPositionData.Position} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:DocumentPositionData.Position) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor; + } @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPositionDataProto.internal_static_AllDocumentPositionData_fieldAccessorTable.ensureFieldAccessorsInitialized(AllDocumentPositionData.class, - AllDocumentPositionData.Builder.class); + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder.class); } + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.newBuilder() + private Builder() { - public static final int DOCUMENTPOSITIONDATA_FIELD_NUMBER = 1; - @SuppressWarnings("serial") - private java.util.List documentPositionData_; + } + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ + } @java.lang.Override - public java.util.List getDocumentPositionDataList() { - - return documentPositionData_; + public Builder clear() { + super.clear(); + bitField0_ = 0; + value_ = emptyFloatList(); + return this; } - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ @java.lang.Override - public java.util.List getDocumentPositionDataOrBuilderList() { - - return documentPositionData_; + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor; } - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ @java.lang.Override - public int getDocumentPositionDataCount() { - - return documentPositionData_.size(); + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.getDefaultInstance(); } - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ @java.lang.Override - public DocumentPositionData getDocumentPositionData(int index) { - - return documentPositionData_.get(index); + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; } - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ @java.lang.Override - public DocumentPositionDataOrBuilder getDocumentPositionDataOrBuilder(int index) { - - return documentPositionData_.get(index); + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; } + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + value_.makeImmutable(); + result.value_ = value_; + } + } - private byte memoizedIsInitialized = -1; + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position)other); + } else { + super.mergeFrom(other); + return this; + } + } + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + value_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } @java.lang.Override public final boolean isInitialized() { + return true; + } - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - if (isInitialized == 0) { - return false; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 13: { + float v = input.readFloat(); + ensureValueIsMutable(); + value_.addFloat(v); + break; + } // case 13 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + int alloc = length > 4096 ? 4096 : length; + ensureValueIsMutable(alloc / 4); + while (input.getBytesUntilLimit() > 0) { + value_.addFloat(input.readFloat()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); + private void ensureValueIsMutable() { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_); } - - memoizedIsInitialized = 1; - return true; + bitField0_ |= 0x00000001; } - - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - for (int i = 0; i < documentPositionData_.size(); i++) { - output.writeMessage(1, documentPositionData_.get(i)); - } - getUnknownFields().writeTo(output); - } - - - @java.lang.Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; + private void ensureValueIsMutable(int capacity) { + if (!value_.isModifiable()) { + value_ = makeMutableCopy(value_, capacity); } - - size = 0; - for (int i = 0; i < documentPositionData_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documentPositionData_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; + bitField0_ |= 0x00000001; } - - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof AllDocumentPositionData)) { - return super.equals(obj); - } - AllDocumentPositionData other = (AllDocumentPositionData) obj; - - if (!getDocumentPositionDataList().equals(other.getDocumentPositionDataList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - - @java.lang.Override - public int hashCode() { - - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getDocumentPositionDataCount() > 0) { - hash = (37 * hash) + DOCUMENTPOSITIONDATA_FIELD_NUMBER; - hash = (53 * hash) + getDocumentPositionDataList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - - public static AllDocumentPositionData parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static AllDocumentPositionData parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static AllDocumentPositionData parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static AllDocumentPositionData parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static AllDocumentPositionData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static AllDocumentPositionData parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static AllDocumentPositionData parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static AllDocumentPositionData parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static AllDocumentPositionData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static AllDocumentPositionData parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static AllDocumentPositionData parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static AllDocumentPositionData parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @java.lang.Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(AllDocumentPositionData 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.GeneratedMessage.BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - /** - * Protobuf type {@code AllDocumentPositionData} + * repeated float value = 1; + * @return A list containing the value. */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:AllDocumentPositionData) - AllDocumentPositionDataOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPositionDataProto.internal_static_AllDocumentPositionData_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPositionDataProto.internal_static_AllDocumentPositionData_fieldAccessorTable.ensureFieldAccessorsInitialized(AllDocumentPositionData.class, - AllDocumentPositionData.Builder.class); - } - - - // Construct using AllDocumentPositionData.newBuilder() - private Builder() { - - } - - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - - super(parent); - - } - - - @java.lang.Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - if (documentPositionDataBuilder_ == null) { - documentPositionData_ = java.util.Collections.emptyList(); - } else { - documentPositionData_ = null; - documentPositionDataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentPositionDataProto.internal_static_AllDocumentPositionData_descriptor; - } - - - @java.lang.Override - public AllDocumentPositionData getDefaultInstanceForType() { - - return AllDocumentPositionData.getDefaultInstance(); - } - - - @java.lang.Override - public AllDocumentPositionData build() { - - AllDocumentPositionData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @java.lang.Override - public AllDocumentPositionData buildPartial() { - - AllDocumentPositionData result = new AllDocumentPositionData(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartialRepeatedFields(AllDocumentPositionData result) { - - if (documentPositionDataBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - documentPositionData_ = java.util.Collections.unmodifiableList(documentPositionData_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.documentPositionData_ = documentPositionData_; - } else { - result.documentPositionData_ = documentPositionDataBuilder_.build(); - } - } - - - private void buildPartial0(AllDocumentPositionData result) { - - int from_bitField0_ = bitField0_; - } - - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof AllDocumentPositionData) { - return mergeFrom((AllDocumentPositionData) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(AllDocumentPositionData other) { - - if (other == AllDocumentPositionData.getDefaultInstance()) { - return this; - } - if (documentPositionDataBuilder_ == null) { - if (!other.documentPositionData_.isEmpty()) { - if (documentPositionData_.isEmpty()) { - documentPositionData_ = other.documentPositionData_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDocumentPositionDataIsMutable(); - documentPositionData_.addAll(other.documentPositionData_); - } - onChanged(); - } - } else { - if (!other.documentPositionData_.isEmpty()) { - if (documentPositionDataBuilder_.isEmpty()) { - documentPositionDataBuilder_.dispose(); - documentPositionDataBuilder_ = null; - documentPositionData_ = other.documentPositionData_; - bitField0_ = (bitField0_ & ~0x00000001); - documentPositionDataBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getDocumentPositionDataFieldBuilder() : null; - } else { - documentPositionDataBuilder_.addAllMessages(other.documentPositionData_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - DocumentPositionData m = input.readMessage(DocumentPositionData.parser(), extensionRegistry); - if (documentPositionDataBuilder_ == null) { - ensureDocumentPositionDataIsMutable(); - documentPositionData_.add(m); - } else { - documentPositionDataBuilder_.addMessage(m); - } - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private java.util.List documentPositionData_ = java.util.Collections.emptyList(); - - - private void ensureDocumentPositionDataIsMutable() { - - if (!((bitField0_ & 0x00000001) != 0)) { - documentPositionData_ = new java.util.ArrayList(documentPositionData_); - bitField0_ |= 0x00000001; - } - } - - - private com.google.protobuf.RepeatedFieldBuilder documentPositionDataBuilder_; - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public java.util.List getDocumentPositionDataList() { - - if (documentPositionDataBuilder_ == null) { - return java.util.Collections.unmodifiableList(documentPositionData_); - } else { - return documentPositionDataBuilder_.getMessageList(); - } - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public int getDocumentPositionDataCount() { - - if (documentPositionDataBuilder_ == null) { - return documentPositionData_.size(); - } else { - return documentPositionDataBuilder_.getCount(); - } - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public DocumentPositionData getDocumentPositionData(int index) { - - if (documentPositionDataBuilder_ == null) { - return documentPositionData_.get(index); - } else { - return documentPositionDataBuilder_.getMessage(index); - } - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder setDocumentPositionData(int index, DocumentPositionData value) { - - if (documentPositionDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentPositionDataIsMutable(); - documentPositionData_.set(index, value); - onChanged(); - } else { - documentPositionDataBuilder_.setMessage(index, value); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder setDocumentPositionData(int index, DocumentPositionData.Builder builderForValue) { - - if (documentPositionDataBuilder_ == null) { - ensureDocumentPositionDataIsMutable(); - documentPositionData_.set(index, builderForValue.build()); - onChanged(); - } else { - documentPositionDataBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder addDocumentPositionData(DocumentPositionData value) { - - if (documentPositionDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentPositionDataIsMutable(); - documentPositionData_.add(value); - onChanged(); - } else { - documentPositionDataBuilder_.addMessage(value); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder addDocumentPositionData(int index, DocumentPositionData value) { - - if (documentPositionDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentPositionDataIsMutable(); - documentPositionData_.add(index, value); - onChanged(); - } else { - documentPositionDataBuilder_.addMessage(index, value); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder addDocumentPositionData(DocumentPositionData.Builder builderForValue) { - - if (documentPositionDataBuilder_ == null) { - ensureDocumentPositionDataIsMutable(); - documentPositionData_.add(builderForValue.build()); - onChanged(); - } else { - documentPositionDataBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder addDocumentPositionData(int index, DocumentPositionData.Builder builderForValue) { - - if (documentPositionDataBuilder_ == null) { - ensureDocumentPositionDataIsMutable(); - documentPositionData_.add(index, builderForValue.build()); - onChanged(); - } else { - documentPositionDataBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder addAllDocumentPositionData(java.lang.Iterable values) { - - if (documentPositionDataBuilder_ == null) { - ensureDocumentPositionDataIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentPositionData_); - onChanged(); - } else { - documentPositionDataBuilder_.addAllMessages(values); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder clearDocumentPositionData() { - - if (documentPositionDataBuilder_ == null) { - documentPositionData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - documentPositionDataBuilder_.clear(); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public Builder removeDocumentPositionData(int index) { - - if (documentPositionDataBuilder_ == null) { - ensureDocumentPositionDataIsMutable(); - documentPositionData_.remove(index); - onChanged(); - } else { - documentPositionDataBuilder_.remove(index); - } - return this; - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public DocumentPositionData.Builder getDocumentPositionDataBuilder(int index) { - - return getDocumentPositionDataFieldBuilder().getBuilder(index); - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public DocumentPositionDataOrBuilder getDocumentPositionDataOrBuilder(int index) { - - if (documentPositionDataBuilder_ == null) { - return documentPositionData_.get(index); - } else { - return documentPositionDataBuilder_.getMessageOrBuilder(index); - } - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public java.util.List getDocumentPositionDataOrBuilderList() { - - if (documentPositionDataBuilder_ != null) { - return documentPositionDataBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(documentPositionData_); - } - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public DocumentPositionData.Builder addDocumentPositionDataBuilder() { - - return getDocumentPositionDataFieldBuilder().addBuilder(DocumentPositionData.getDefaultInstance()); - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public DocumentPositionData.Builder addDocumentPositionDataBuilder(int index) { - - return getDocumentPositionDataFieldBuilder().addBuilder(index, DocumentPositionData.getDefaultInstance()); - } - - - /** - * repeated .DocumentPositionData documentPositionData = 1; - */ - public java.util.List getDocumentPositionDataBuilderList() { - - return getDocumentPositionDataFieldBuilder().getBuilderList(); - } - - - private com.google.protobuf.RepeatedFieldBuilder getDocumentPositionDataFieldBuilder() { - - if (documentPositionDataBuilder_ == null) { - documentPositionDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder( - documentPositionData_, - ((bitField0_ & 0x00000001) != 0), - getParentForChildren(), - isClean()); - documentPositionData_ = null; - } - return documentPositionDataBuilder_; - } - - // @@protoc_insertion_point(builder_scope:AllDocumentPositionData) + public java.util.List + getValueList() { + value_.makeImmutable(); + return value_; } - - // @@protoc_insertion_point(class_scope:AllDocumentPositionData) - private static final AllDocumentPositionData DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new AllDocumentPositionData(); - } - - public static AllDocumentPositionData getDefaultInstance() { - - return DEFAULT_INSTANCE; - } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public AllDocumentPositionData parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - - public static com.google.protobuf.Parser parser() { - - return PARSER; - } - - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - - return PARSER; - } - - - @java.lang.Override - public AllDocumentPositionData getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; - } - - } - - public interface DocumentPositionDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:DocumentPositionData) - com.google.protobuf.MessageOrBuilder { - /** - *
-         * Identifier of the text block.
-         * 
- * - * int64 id = 1; - * - * @return The id. + * repeated float value = 1; + * @return The count of value. */ - long getId(); - - + public int getValueCount() { + return value_.size(); + } /** - *
-         * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-         * This is required due to the text and position coordinates not being equal.
-         * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @return A list containing the stringIdxToPositionIdx. - */ - java.util.List getStringIdxToPositionIdxList(); - - - /** - *
-         * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-         * This is required due to the text and position coordinates not being equal.
-         * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @return The count of stringIdxToPositionIdx. - */ - int getStringIdxToPositionIdxCount(); - - - /** - *
-         * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-         * This is required due to the text and position coordinates not being equal.
-         * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * + * repeated float value = 1; * @param index The index of the element to return. - * @return The stringIdxToPositionIdx at the given index. + * @return The value at the given index. */ - int getStringIdxToPositionIdx(int index); - - + public float getValue(int index) { + return value_.getFloat(index); + } /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; + * repeated float value = 1; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. */ - java.util.List getPositionsList(); - + public Builder setValue( + int index, float value) { + ensureValueIsMutable(); + value_.setFloat(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; + * repeated float value = 1; + * @param value The value to add. + * @return This builder for chaining. */ - DocumentPositionData.Position getPositions(int index); - + public Builder addValue(float value) { + ensureValueIsMutable(); + value_.addFloat(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; + * repeated float value = 1; + * @param values The value to add. + * @return This builder for chaining. */ - int getPositionsCount(); - - + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; + * repeated float value = 1; + * @return This builder for chaining. */ - java.util.List getPositionsOrBuilderList(); + public Builder clearValue() { + value_ = emptyFloatList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + // @@protoc_insertion_point(builder_scope:DocumentPositionData.Position) + } - /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - DocumentPositionData.PositionOrBuilder getPositionsOrBuilder(int index); + // @@protoc_insertion_point(class_scope:DocumentPositionData.Position) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position(); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Position parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } } + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + *
+     * Identifier of the text block.
+     * 
+ * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int STRINGIDXTOPOSITIONIDX_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList stringIdxToPositionIdx_ = + emptyIntList(); + /** + *
+     * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+     * This is required due to the text and position coordinates not being equal.
+     * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @return A list containing the stringIdxToPositionIdx. + */ + @java.lang.Override + public java.util.List + getStringIdxToPositionIdxList() { + return stringIdxToPositionIdx_; + } + /** + *
+     * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+     * This is required due to the text and position coordinates not being equal.
+     * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @return The count of stringIdxToPositionIdx. + */ + public int getStringIdxToPositionIdxCount() { + return stringIdxToPositionIdx_.size(); + } + /** + *
+     * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+     * This is required due to the text and position coordinates not being equal.
+     * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @param index The index of the element to return. + * @return The stringIdxToPositionIdx at the given index. + */ + public int getStringIdxToPositionIdx(int index) { + return stringIdxToPositionIdx_.getInt(index); + } + private int stringIdxToPositionIdxMemoizedSerializedSize = -1; + + public static final int POSITIONS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private java.util.List positions_; + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + @java.lang.Override + public java.util.List getPositionsList() { + return positions_; + } + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + @java.lang.Override + public java.util.List + getPositionsOrBuilderList() { + return positions_; + } + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + @java.lang.Override + public int getPositionsCount() { + return positions_.size(); + } + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getPositions(int index) { + return positions_.get(index); + } + /** + *
+     * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+     * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+     * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+     * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder getPositionsOrBuilder( + int index) { + return positions_.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 { + getSerializedSize(); + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (getStringIdxToPositionIdxList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(stringIdxToPositionIdxMemoizedSerializedSize); + } + for (int i = 0; i < stringIdxToPositionIdx_.size(); i++) { + output.writeInt32NoTag(stringIdxToPositionIdx_.getInt(i)); + } + for (int i = 0; i < positions_.size(); i++) { + output.writeMessage(3, positions_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + { + int dataSize = 0; + for (int i = 0; i < stringIdxToPositionIdx_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(stringIdxToPositionIdx_.getInt(i)); + } + size += dataSize; + if (!getStringIdxToPositionIdxList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + stringIdxToPositionIdxMemoizedSerializedSize = dataSize; + } + for (int i = 0; i < positions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, positions_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData) obj; + + if (getId() + != other.getId()) return false; + if (!getStringIdxToPositionIdxList() + .equals(other.getStringIdxToPositionIdxList())) return false; + if (!getPositionsList() + .equals(other.getPositionsList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + com.google.protobuf.Internal.hashLong( + getId()); + if (getStringIdxToPositionIdxCount() > 0) { + hash = (37 * hash) + STRINGIDXTOPOSITIONIDX_FIELD_NUMBER; + hash = (53 * hash) + getStringIdxToPositionIdxList().hashCode(); + } + if (getPositionsCount() > 0) { + hash = (37 * hash) + POSITIONS_FIELD_NUMBER; + hash = (53 * hash) + getPositionsList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code DocumentPositionData} */ - public static final class DocumentPositionData extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:DocumentPositionData) - DocumentPositionDataOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:DocumentPositionData) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_descriptor; + } - private static final long serialVersionUID = 0L; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Builder.class); + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentPositionData.class.getName()); + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + stringIdxToPositionIdx_ = emptyIntList(); + if (positionsBuilder_ == null) { + positions_ = java.util.Collections.emptyList(); + } else { + positions_ = null; + positionsBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } - // Use DocumentPositionData.newBuilder() to construct. - private DocumentPositionData(com.google.protobuf.GeneratedMessage.Builder builder) { + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_descriptor; + } - super(builder); + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.getDefaultInstance(); + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - - - private DocumentPositionData() { - - stringIdxToPositionIdx_ = emptyIntList(); - positions_ = java.util.Collections.emptyList(); - } - - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPositionData.class, - DocumentPositionData.Builder.class); - } - - - public interface PositionOrBuilder extends - // @@protoc_insertion_point(interface_extends:DocumentPositionData.Position) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated float value = 1; - * - * @return A list containing the value. - */ - java.util.List getValueList(); - - - /** - * repeated float value = 1; - * - * @return The count of value. - */ - int getValueCount(); - - - /** - * repeated float value = 1; - * - * @param index The index of the element to return. - * @return The value at the given index. - */ - float getValue(int index); - - } - - /** - *
-         * Definition of a BoundingBox that contains x, y, width, and height.
-         * 
- *

- * Protobuf type {@code DocumentPositionData.Position} - */ - public static final class Position extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:DocumentPositionData.Position) - PositionOrBuilder { - - private static final long serialVersionUID = 0L; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", Position.class.getName()); - } - - // Use Position.newBuilder() to construct. - private Position(com.google.protobuf.GeneratedMessage.Builder builder) { - - super(builder); - } - - - private Position() { - - value_ = emptyFloatList(); - } - - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_Position_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPositionData.Position.class, - DocumentPositionData.Position.Builder.class); - } - - - public static final int VALUE_FIELD_NUMBER = 1; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); - - - /** - * repeated float value = 1; - * - * @return A list containing the value. - */ - @java.lang.Override - public java.util.List getValueList() { - - return value_; - } - - - /** - * repeated float value = 1; - * - * @return The count of value. - */ - public int getValueCount() { - - return value_.size(); - } - - - /** - * repeated float value = 1; - * - * @param index The index of the element to return. - * @return The value at the given index. - */ - public float getValue(int index) { - - return value_.getFloat(index); - } - - - private int valueMemoizedSerializedSize = -1; - - 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 { - - getSerializedSize(); - if (getValueList().size() > 0) { - output.writeUInt32NoTag(10); - output.writeUInt32NoTag(valueMemoizedSerializedSize); - } - for (int i = 0; i < value_.size(); i++) { - output.writeFloatNoTag(value_.getFloat(i)); - } - getUnknownFields().writeTo(output); - } - - - @java.lang.Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - { - int dataSize = 0; - dataSize = 4 * getValueList().size(); - size += dataSize; - if (!getValueList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); - } - valueMemoizedSerializedSize = dataSize; - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof DocumentPositionData.Position)) { - return super.equals(obj); - } - DocumentPositionData.Position other = (DocumentPositionData.Position) obj; - - if (!getValueList().equals(other.getValueList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - - @java.lang.Override - public int hashCode() { - - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getValueCount() > 0) { - hash = (37 * hash) + VALUE_FIELD_NUMBER; - hash = (53 * hash) + getValueList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - - public static DocumentPositionData.Position parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPositionData.Position parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPositionData.Position parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPositionData.Position parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPositionData.Position parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPositionData.Position parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPositionData.Position parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentPositionData.Position parseFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPositionData.Position parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static DocumentPositionData.Position parseDelimitedFrom(java.io.InputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPositionData.Position parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentPositionData.Position parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @java.lang.Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(DocumentPositionData.Position 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.GeneratedMessage.BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - *

-             * Definition of a BoundingBox that contains x, y, width, and height.
-             * 
- *

- * Protobuf type {@code DocumentPositionData.Position} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:DocumentPositionData.Position) - DocumentPositionData.PositionOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_Position_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPositionData.Position.class, - DocumentPositionData.Position.Builder.class); - } - - - // Construct using DocumentPositionData.Position.newBuilder() - private Builder() { - - } - - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - - super(parent); - - } - - - @java.lang.Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - value_ = emptyFloatList(); - return this; - } - - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor; - } - - - @java.lang.Override - public DocumentPositionData.Position getDefaultInstanceForType() { - - return DocumentPositionData.Position.getDefaultInstance(); - } - - - @java.lang.Override - public DocumentPositionData.Position build() { - - DocumentPositionData.Position result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @java.lang.Override - public DocumentPositionData.Position buildPartial() { - - DocumentPositionData.Position result = new DocumentPositionData.Position(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartial0(DocumentPositionData.Position result) { - - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - value_.makeImmutable(); - result.value_ = value_; - } - } - - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof DocumentPositionData.Position) { - return mergeFrom((DocumentPositionData.Position) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(DocumentPositionData.Position other) { - - if (other == DocumentPositionData.Position.getDefaultInstance()) { - return this; - } - if (!other.value_.isEmpty()) { - if (value_.isEmpty()) { - value_ = other.value_; - value_.makeImmutable(); - bitField0_ |= 0x00000001; - } else { - ensureValueIsMutable(); - value_.addAll(other.value_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 13: { - float v = input.readFloat(); - ensureValueIsMutable(); - value_.addFloat(v); - break; - } // case 13 - case 10: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - int alloc = length > 4096 ? 4096 : length; - ensureValueIsMutable(alloc / 4); - while (input.getBytesUntilLimit() > 0) { - value_.addFloat(input.readFloat()); - } - input.popLimit(limit); - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private com.google.protobuf.Internal.FloatList value_ = emptyFloatList(); - - - private void ensureValueIsMutable() { - - if (!value_.isModifiable()) { - value_ = makeMutableCopy(value_); - } - bitField0_ |= 0x00000001; - } - - - private void ensureValueIsMutable(int capacity) { - - if (!value_.isModifiable()) { - value_ = makeMutableCopy(value_, capacity); - } - bitField0_ |= 0x00000001; - } - - - /** - * repeated float value = 1; - * - * @return A list containing the value. - */ - public java.util.List getValueList() { - - value_.makeImmutable(); - return value_; - } - - - /** - * repeated float value = 1; - * - * @return The count of value. - */ - public int getValueCount() { - - return value_.size(); - } - - - /** - * repeated float value = 1; - * - * @param index The index of the element to return. - * @return The value at the given index. - */ - public float getValue(int index) { - - return value_.getFloat(index); - } - - - /** - * repeated float value = 1; - * - * @param index The index to set the value at. - * @param value The value to set. - * @return This builder for chaining. - */ - public Builder setValue(int index, float value) { - - ensureValueIsMutable(); - value_.setFloat(index, value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - * repeated float value = 1; - * - * @param value The value to add. - * @return This builder for chaining. - */ - public Builder addValue(float value) { - - ensureValueIsMutable(); - value_.addFloat(value); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - * repeated float value = 1; - * - * @param values The value to add. - * @return This builder for chaining. - */ - public Builder addAllValue(java.lang.Iterable values) { - - ensureValueIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, value_); - bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - * repeated float value = 1; - * - * @return This builder for chaining. - */ - public Builder clearValue() { - - value_ = emptyFloatList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:DocumentPositionData.Position) - } - - // @@protoc_insertion_point(class_scope:DocumentPositionData.Position) - private static final DocumentPositionData.Position DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new DocumentPositionData.Position(); - } - - public static DocumentPositionData.Position getDefaultInstance() { - - return DEFAULT_INSTANCE; - } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public Position parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - - public static com.google.protobuf.Parser parser() { - - return PARSER; - } - - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - - return PARSER; - } - - - @java.lang.Override - public DocumentPositionData.Position getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; - } - - } - - public static final int ID_FIELD_NUMBER = 1; - private long id_ = 0L; - - - /** - *

-         * Identifier of the text block.
-         * 
- * - * int64 id = 1; - * - * @return The id. - */ - @java.lang.Override - public long getId() { - - return id_; - } - - - public static final int STRINGIDXTOPOSITIONIDX_FIELD_NUMBER = 2; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.IntList stringIdxToPositionIdx_ = emptyIntList(); - - - /** - *
-         * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-         * This is required due to the text and position coordinates not being equal.
-         * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @return A list containing the stringIdxToPositionIdx. - */ - @java.lang.Override - public java.util.List getStringIdxToPositionIdxList() { - - return stringIdxToPositionIdx_; - } - - - /** - *
-         * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-         * This is required due to the text and position coordinates not being equal.
-         * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @return The count of stringIdxToPositionIdx. - */ - public int getStringIdxToPositionIdxCount() { - - return stringIdxToPositionIdx_.size(); - } - - - /** - *
-         * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-         * This is required due to the text and position coordinates not being equal.
-         * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @param index The index of the element to return. - * @return The stringIdxToPositionIdx at the given index. - */ - public int getStringIdxToPositionIdx(int index) { - - return stringIdxToPositionIdx_.getInt(index); - } - - - private int stringIdxToPositionIdxMemoizedSerializedSize = -1; - - public static final int POSITIONS_FIELD_NUMBER = 3; - @SuppressWarnings("serial") - private java.util.List positions_; - - - /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - @java.lang.Override - public java.util.List getPositionsList() { - - return positions_; - } - - - /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - @java.lang.Override - public java.util.List getPositionsOrBuilderList() { - - return positions_; - } - - - /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - @java.lang.Override - public int getPositionsCount() { - - return positions_.size(); - } - - - /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - @java.lang.Override - public DocumentPositionData.Position getPositions(int index) { - - return positions_.get(index); - } - - - /** - *
-         * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-         * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-         * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-         * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - @java.lang.Override - public DocumentPositionData.PositionOrBuilder getPositionsOrBuilder(int index) { - - return positions_.get(index); - } - - - private byte memoizedIsInitialized = -1; - - - @java.lang.Override - public final boolean isInitialized() { - - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; + return result; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData result) { + if (positionsBuilder_ == null) { + if (((bitField0_ & 0x00000004) != 0)) { + positions_ = java.util.Collections.unmodifiableList(positions_); + bitField0_ = (bitField0_ & ~0x00000004); } - if (isInitialized == 0) { - return false; + result.positions_ = positions_; + } else { + result.positions_ = positionsBuilder_.build(); + } + } + + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + stringIdxToPositionIdx_.makeImmutable(); + result.stringIdxToPositionIdx_ = stringIdxToPositionIdx_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); + } + if (!other.stringIdxToPositionIdx_.isEmpty()) { + if (stringIdxToPositionIdx_.isEmpty()) { + stringIdxToPositionIdx_ = other.stringIdxToPositionIdx_; + stringIdxToPositionIdx_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureStringIdxToPositionIdxIsMutable(); + stringIdxToPositionIdx_.addAll(other.stringIdxToPositionIdx_); } - - memoizedIsInitialized = 1; - return true; + onChanged(); } - - - @java.lang.Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - getSerializedSize(); - if (id_ != 0L) { - output.writeInt64(1, id_); + if (positionsBuilder_ == null) { + if (!other.positions_.isEmpty()) { + if (positions_.isEmpty()) { + positions_ = other.positions_; + bitField0_ = (bitField0_ & ~0x00000004); + } else { + ensurePositionsIsMutable(); + positions_.addAll(other.positions_); } - if (getStringIdxToPositionIdxList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(stringIdxToPositionIdxMemoizedSerializedSize); - } - for (int i = 0; i < stringIdxToPositionIdx_.size(); i++) { - output.writeInt32NoTag(stringIdxToPositionIdx_.getInt(i)); - } - for (int i = 0; i < positions_.size(); i++) { - output.writeMessage(3, positions_.get(i)); - } - getUnknownFields().writeTo(output); - } - - - @java.lang.Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; + onChanged(); } - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id_); + } else { + if (!other.positions_.isEmpty()) { + if (positionsBuilder_.isEmpty()) { + positionsBuilder_.dispose(); + positionsBuilder_ = null; + positions_ = other.positions_; + bitField0_ = (bitField0_ & ~0x00000004); + positionsBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getPositionsFieldBuilder() : null; + } else { + positionsBuilder_.addAllMessages(other.positions_); } - { - int dataSize = 0; - for (int i = 0; i < stringIdxToPositionIdx_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(stringIdxToPositionIdx_.getInt(i)); - } - size += dataSize; - if (!getStringIdxToPositionIdxList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); - } - stringIdxToPositionIdxMemoizedSerializedSize = dataSize; - } - for (int i = 0; i < positions_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, positions_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - - @java.lang.Override - public boolean equals(final java.lang.Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof DocumentPositionData)) { - return super.equals(obj); - } - DocumentPositionData other = (DocumentPositionData) obj; - - if (getId() != other.getId()) { - return false; } - if (!getStringIdxToPositionIdxList().equals(other.getStringIdxToPositionIdxList())) { - return false; - } - if (!getPositionsList().equals(other.getPositionsList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + @java.lang.Override + public final boolean isInitialized() { + 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) + com.google.protobuf.Internal.hashLong(getId()); - if (getStringIdxToPositionIdxCount() > 0) { - hash = (37 * hash) + STRINGIDXTOPOSITIONIDX_FIELD_NUMBER; - hash = (53 * hash) + getStringIdxToPositionIdxList().hashCode(); - } - if (getPositionsCount() > 0) { - hash = (37 * hash) + POSITIONS_FIELD_NUMBER; - hash = (53 * hash) + getPositionsList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - - - public static DocumentPositionData parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPositionData parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPositionData parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPositionData parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPositionData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentPositionData parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentPositionData parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentPositionData parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPositionData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static DocumentPositionData parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentPositionData parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentPositionData parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @java.lang.Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(DocumentPositionData 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.GeneratedMessage.BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - * Protobuf type {@code DocumentPositionData} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:DocumentPositionData) - DocumentPositionDataOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_descriptor; - } - - - @java.lang.Override - protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentPositionData.class, - DocumentPositionData.Builder.class); - } - - - // Construct using DocumentPositionData.newBuilder() - private Builder() { - - } - - - private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { - - super(parent); - - } - - - @java.lang.Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - id_ = 0L; - stringIdxToPositionIdx_ = emptyIntList(); - if (positionsBuilder_ == null) { - positions_ = java.util.Collections.emptyList(); - } else { - positions_ = null; - positionsBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - - @java.lang.Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentPositionDataProto.internal_static_DocumentPositionData_descriptor; - } - - - @java.lang.Override - public DocumentPositionData getDefaultInstanceForType() { - - return DocumentPositionData.getDefaultInstance(); - } - - - @java.lang.Override - public DocumentPositionData build() { - - DocumentPositionData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @java.lang.Override - public DocumentPositionData buildPartial() { - - DocumentPositionData result = new DocumentPositionData(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartialRepeatedFields(DocumentPositionData result) { - - if (positionsBuilder_ == null) { - if (((bitField0_ & 0x00000004) != 0)) { - positions_ = java.util.Collections.unmodifiableList(positions_); - bitField0_ = (bitField0_ & ~0x00000004); - } - result.positions_ = positions_; - } else { - result.positions_ = positionsBuilder_.build(); - } - } - - - private void buildPartial0(DocumentPositionData result) { - - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.id_ = id_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - stringIdxToPositionIdx_.makeImmutable(); - result.stringIdxToPositionIdx_ = stringIdxToPositionIdx_; - } - } - - - @java.lang.Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof DocumentPositionData) { - return mergeFrom((DocumentPositionData) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(DocumentPositionData other) { - - if (other == DocumentPositionData.getDefaultInstance()) { - return this; - } - if (other.getId() != 0L) { - setId(other.getId()); - } - if (!other.stringIdxToPositionIdx_.isEmpty()) { - if (stringIdxToPositionIdx_.isEmpty()) { - stringIdxToPositionIdx_ = other.stringIdxToPositionIdx_; - stringIdxToPositionIdx_.makeImmutable(); - bitField0_ |= 0x00000002; - } else { - ensureStringIdxToPositionIdxIsMutable(); - stringIdxToPositionIdx_.addAll(other.stringIdxToPositionIdx_); - } - onChanged(); - } - if (positionsBuilder_ == null) { - if (!other.positions_.isEmpty()) { - if (positions_.isEmpty()) { - positions_ = other.positions_; - bitField0_ = (bitField0_ & ~0x00000004); - } else { - ensurePositionsIsMutable(); - positions_.addAll(other.positions_); - } - onChanged(); - } - } else { - if (!other.positions_.isEmpty()) { - if (positionsBuilder_.isEmpty()) { - positionsBuilder_.dispose(); - positionsBuilder_ = null; - positions_ = other.positions_; - bitField0_ = (bitField0_ & ~0x00000004); - positionsBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getPositionsFieldBuilder() : null; - } else { - positionsBuilder_.addAllMessages(other.positions_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - 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 { - - if (extensionRegistry == null) { - throw new java.lang.NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - id_ = input.readInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - int v = input.readInt32(); - ensureStringIdxToPositionIdxIsMutable(); - stringIdxToPositionIdx_.addInt(v); - break; - } // case 16 - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureStringIdxToPositionIdxIsMutable(); - while (input.getBytesUntilLimit() > 0) { - stringIdxToPositionIdx_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } // case 18 - case 26: { - DocumentPositionData.Position m = input.readMessage(DocumentPositionData.Position.parser(), extensionRegistry); - if (positionsBuilder_ == null) { - ensurePositionsIsMutable(); - positions_.add(m); - } else { - positionsBuilder_.addMessage(m); - } - break; - } // case 26 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private long id_; - - - /** - *
-             * Identifier of the text block.
-             * 
- * - * int64 id = 1; - * - * @return The id. - */ - @java.lang.Override - public long getId() { - - return id_; - } - - - /** - *
-             * Identifier of the text block.
-             * 
- * - * int64 id = 1; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(long value) { - - id_ = value; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - *
-             * Identifier of the text block.
-             * 
- * - * int64 id = 1; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - bitField0_ = (bitField0_ & ~0x00000001); - id_ = 0L; - onChanged(); - return this; - } - - - private com.google.protobuf.Internal.IntList stringIdxToPositionIdx_ = emptyIntList(); - - - private void ensureStringIdxToPositionIdxIsMutable() { - - if (!stringIdxToPositionIdx_.isModifiable()) { - stringIdxToPositionIdx_ = makeMutableCopy(stringIdxToPositionIdx_); - } - bitField0_ |= 0x00000002; - } - - - /** - *
-             * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-             * This is required due to the text and position coordinates not being equal.
-             * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @return A list containing the stringIdxToPositionIdx. - */ - public java.util.List getStringIdxToPositionIdxList() { - - stringIdxToPositionIdx_.makeImmutable(); - return stringIdxToPositionIdx_; - } - - - /** - *
-             * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-             * This is required due to the text and position coordinates not being equal.
-             * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @return The count of stringIdxToPositionIdx. - */ - public int getStringIdxToPositionIdxCount() { - - return stringIdxToPositionIdx_.size(); - } - - - /** - *
-             * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-             * This is required due to the text and position coordinates not being equal.
-             * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @param index The index of the element to return. - * @return The stringIdxToPositionIdx at the given index. - */ - public int getStringIdxToPositionIdx(int index) { - - return stringIdxToPositionIdx_.getInt(index); - } - - - /** - *
-             * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-             * This is required due to the text and position coordinates not being equal.
-             * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @param index The index to set the value at. - * @param value The stringIdxToPositionIdx to set. - * @return This builder for chaining. - */ - public Builder setStringIdxToPositionIdx(int index, int value) { - + break; + } // case 8 + case 16: { + int v = input.readInt32(); ensureStringIdxToPositionIdxIsMutable(); - stringIdxToPositionIdx_.setInt(index, value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-             * This is required due to the text and position coordinates not being equal.
-             * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @param value The stringIdxToPositionIdx to add. - * @return This builder for chaining. - */ - public Builder addStringIdxToPositionIdx(int value) { - + stringIdxToPositionIdx_.addInt(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); ensureStringIdxToPositionIdxIsMutable(); - stringIdxToPositionIdx_.addInt(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-             * This is required due to the text and position coordinates not being equal.
-             * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @param values The stringIdxToPositionIdx to add. - * @return This builder for chaining. - */ - public Builder addAllStringIdxToPositionIdx(java.lang.Iterable values) { - - ensureStringIdxToPositionIdxIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, stringIdxToPositionIdx_); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
-             * This is required due to the text and position coordinates not being equal.
-             * 
- * - * repeated int32 stringIdxToPositionIdx = 2; - * - * @return This builder for chaining. - */ - public Builder clearStringIdxToPositionIdx() { - - stringIdxToPositionIdx_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - - private java.util.List positions_ = java.util.Collections.emptyList(); - - - private void ensurePositionsIsMutable() { - - if (!((bitField0_ & 0x00000004) != 0)) { - positions_ = new java.util.ArrayList(positions_); - bitField0_ |= 0x00000004; + while (input.getBytesUntilLimit() > 0) { + stringIdxToPositionIdx_.addInt(input.readInt32()); } - } - - - private com.google.protobuf.RepeatedFieldBuilder positionsBuilder_; - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public java.util.List getPositionsList() { - + input.popLimit(limit); + break; + } // case 18 + case 26: { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position m = + input.readMessage( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.parser(), + extensionRegistry); if (positionsBuilder_ == null) { - return java.util.Collections.unmodifiableList(positions_); + ensurePositionsIsMutable(); + positions_.add(m); } else { - return positionsBuilder_.getMessageList(); + positionsBuilder_.addMessage(m); } - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public int getPositionsCount() { - - if (positionsBuilder_ == null) { - return positions_.size(); - } else { - return positionsBuilder_.getCount(); + break; + } // case 26 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag } - } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + private long id_ ; + /** + *
+       * Identifier of the text block.
+       * 
+ * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + *
+       * Identifier of the text block.
+       * 
+ * + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public DocumentPositionData.Position getPositions(int index) { + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * Identifier of the text block.
+       * 
+ * + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } - if (positionsBuilder_ == null) { - return positions_.get(index); - } else { - return positionsBuilder_.getMessage(index); - } - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder setPositions(int index, DocumentPositionData.Position value) { - - if (positionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePositionsIsMutable(); - positions_.set(index, value); - onChanged(); - } else { - positionsBuilder_.setMessage(index, value); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder setPositions(int index, DocumentPositionData.Position.Builder builderForValue) { - - if (positionsBuilder_ == null) { - ensurePositionsIsMutable(); - positions_.set(index, builderForValue.build()); - onChanged(); - } else { - positionsBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder addPositions(DocumentPositionData.Position value) { - - if (positionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePositionsIsMutable(); - positions_.add(value); - onChanged(); - } else { - positionsBuilder_.addMessage(value); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder addPositions(int index, DocumentPositionData.Position value) { - - if (positionsBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensurePositionsIsMutable(); - positions_.add(index, value); - onChanged(); - } else { - positionsBuilder_.addMessage(index, value); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder addPositions(DocumentPositionData.Position.Builder builderForValue) { - - if (positionsBuilder_ == null) { - ensurePositionsIsMutable(); - positions_.add(builderForValue.build()); - onChanged(); - } else { - positionsBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder addPositions(int index, DocumentPositionData.Position.Builder builderForValue) { - - if (positionsBuilder_ == null) { - ensurePositionsIsMutable(); - positions_.add(index, builderForValue.build()); - onChanged(); - } else { - positionsBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder addAllPositions(java.lang.Iterable values) { - - if (positionsBuilder_ == null) { - ensurePositionsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, positions_); - onChanged(); - } else { - positionsBuilder_.addAllMessages(values); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder clearPositions() { - - if (positionsBuilder_ == null) { - positions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - } else { - positionsBuilder_.clear(); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public Builder removePositions(int index) { - - if (positionsBuilder_ == null) { - ensurePositionsIsMutable(); - positions_.remove(index); - onChanged(); - } else { - positionsBuilder_.remove(index); - } - return this; - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public DocumentPositionData.Position.Builder getPositionsBuilder(int index) { - - return getPositionsFieldBuilder().getBuilder(index); - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public DocumentPositionData.PositionOrBuilder getPositionsOrBuilder(int index) { - - if (positionsBuilder_ == null) { - return positions_.get(index); - } else { - return positionsBuilder_.getMessageOrBuilder(index); - } - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public java.util.List getPositionsOrBuilderList() { - - if (positionsBuilder_ != null) { - return positionsBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(positions_); - } - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public DocumentPositionData.Position.Builder addPositionsBuilder() { - - return getPositionsFieldBuilder().addBuilder(DocumentPositionData.Position.getDefaultInstance()); - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public DocumentPositionData.Position.Builder addPositionsBuilder(int index) { - - return getPositionsFieldBuilder().addBuilder(index, DocumentPositionData.Position.getDefaultInstance()); - } - - - /** - *
-             * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
-             * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
-             * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
-             * 
- * - * repeated .DocumentPositionData.Position positions = 3; - */ - public java.util.List getPositionsBuilderList() { - - return getPositionsFieldBuilder().getBuilderList(); - } - - - private com.google.protobuf.RepeatedFieldBuilder getPositionsFieldBuilder() { - - if (positionsBuilder_ == null) { - positionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder( - positions_, - ((bitField0_ & 0x00000004) != 0), - getParentForChildren(), - isClean()); - positions_ = null; - } - return positionsBuilder_; - } - - // @@protoc_insertion_point(builder_scope:DocumentPositionData) + private com.google.protobuf.Internal.IntList stringIdxToPositionIdx_ = emptyIntList(); + private void ensureStringIdxToPositionIdxIsMutable() { + if (!stringIdxToPositionIdx_.isModifiable()) { + stringIdxToPositionIdx_ = makeMutableCopy(stringIdxToPositionIdx_); } + bitField0_ |= 0x00000002; + } + /** + *
+       * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+       * This is required due to the text and position coordinates not being equal.
+       * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @return A list containing the stringIdxToPositionIdx. + */ + public java.util.List + getStringIdxToPositionIdxList() { + stringIdxToPositionIdx_.makeImmutable(); + return stringIdxToPositionIdx_; + } + /** + *
+       * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+       * This is required due to the text and position coordinates not being equal.
+       * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @return The count of stringIdxToPositionIdx. + */ + public int getStringIdxToPositionIdxCount() { + return stringIdxToPositionIdx_.size(); + } + /** + *
+       * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+       * This is required due to the text and position coordinates not being equal.
+       * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @param index The index of the element to return. + * @return The stringIdxToPositionIdx at the given index. + */ + public int getStringIdxToPositionIdx(int index) { + return stringIdxToPositionIdx_.getInt(index); + } + /** + *
+       * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+       * This is required due to the text and position coordinates not being equal.
+       * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @param index The index to set the value at. + * @param value The stringIdxToPositionIdx to set. + * @return This builder for chaining. + */ + public Builder setStringIdxToPositionIdx( + int index, int value) { - // @@protoc_insertion_point(class_scope:DocumentPositionData) - private static final DocumentPositionData DEFAULT_INSTANCE; + ensureStringIdxToPositionIdxIsMutable(); + stringIdxToPositionIdx_.setInt(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+       * This is required due to the text and position coordinates not being equal.
+       * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @param value The stringIdxToPositionIdx to add. + * @return This builder for chaining. + */ + public Builder addStringIdxToPositionIdx(int value) { - static { - DEFAULT_INSTANCE = new DocumentPositionData(); + ensureStringIdxToPositionIdxIsMutable(); + stringIdxToPositionIdx_.addInt(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+       * This is required due to the text and position coordinates not being equal.
+       * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @param values The stringIdxToPositionIdx to add. + * @return This builder for chaining. + */ + public Builder addAllStringIdxToPositionIdx( + java.lang.Iterable values) { + ensureStringIdxToPositionIdxIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, stringIdxToPositionIdx_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * For each string coordinate in the search text of the text block, the array contains an entry relating the string coordinate to the position coordinate.
+       * This is required due to the text and position coordinates not being equal.
+       * 
+ * + * repeated int32 stringIdxToPositionIdx = 2; + * @return This builder for chaining. + */ + public Builder clearStringIdxToPositionIdx() { + stringIdxToPositionIdx_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private java.util.List positions_ = + java.util.Collections.emptyList(); + private void ensurePositionsIsMutable() { + if (!((bitField0_ & 0x00000004) != 0)) { + positions_ = new java.util.ArrayList(positions_); + bitField0_ |= 0x00000004; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder> positionsBuilder_; + + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public java.util.List getPositionsList() { + if (positionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(positions_); + } else { + return positionsBuilder_.getMessageList(); } - - public static DocumentPositionData getDefaultInstance() { - - return DEFAULT_INSTANCE; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public int getPositionsCount() { + if (positionsBuilder_ == null) { + return positions_.size(); + } else { + return positionsBuilder_.getCount(); } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @java.lang.Override - public DocumentPositionData parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - - public static com.google.protobuf.Parser parser() { - - return PARSER; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position getPositions(int index) { + if (positionsBuilder_ == null) { + return positions_.get(index); + } else { + return positionsBuilder_.getMessage(index); } - - - @java.lang.Override - public com.google.protobuf.Parser getParserForType() { - - return PARSER; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder setPositions( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position value) { + if (positionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositionsIsMutable(); + positions_.set(index, value); + onChanged(); + } else { + positionsBuilder_.setMessage(index, value); } - - - @java.lang.Override - public DocumentPositionData getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder setPositions( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder builderForValue) { + if (positionsBuilder_ == null) { + ensurePositionsIsMutable(); + positions_.set(index, builderForValue.build()); + onChanged(); + } else { + positionsBuilder_.setMessage(index, builderForValue.build()); } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder addPositions(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position value) { + if (positionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositionsIsMutable(); + positions_.add(value); + onChanged(); + } else { + positionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder addPositions( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position value) { + if (positionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensurePositionsIsMutable(); + positions_.add(index, value); + onChanged(); + } else { + positionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder addPositions( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder builderForValue) { + if (positionsBuilder_ == null) { + ensurePositionsIsMutable(); + positions_.add(builderForValue.build()); + onChanged(); + } else { + positionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder addPositions( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder builderForValue) { + if (positionsBuilder_ == null) { + ensurePositionsIsMutable(); + positions_.add(index, builderForValue.build()); + onChanged(); + } else { + positionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder addAllPositions( + java.lang.Iterable values) { + if (positionsBuilder_ == null) { + ensurePositionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, positions_); + onChanged(); + } else { + positionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder clearPositions() { + if (positionsBuilder_ == null) { + positions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + } else { + positionsBuilder_.clear(); + } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public Builder removePositions(int index) { + if (positionsBuilder_ == null) { + ensurePositionsIsMutable(); + positions_.remove(index); + onChanged(); + } else { + positionsBuilder_.remove(index); + } + return this; + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder getPositionsBuilder( + int index) { + return getPositionsFieldBuilder().getBuilder(index); + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder getPositionsOrBuilder( + int index) { + if (positionsBuilder_ == null) { + return positions_.get(index); } else { + return positionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public java.util.List + getPositionsOrBuilderList() { + if (positionsBuilder_ != null) { + return positionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(positions_); + } + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder addPositionsBuilder() { + return getPositionsFieldBuilder().addBuilder( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.getDefaultInstance()); + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder addPositionsBuilder( + int index) { + return getPositionsFieldBuilder().addBuilder( + index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.getDefaultInstance()); + } + /** + *
+       * The bounding box for each glyph as a rectangle. This matrix is of size (n,4), where n is the number of glyphs in the text block.
+       * The second dimension specifies the rectangle with the value x, y, width, height, with x, y specifying the lower left corner.
+       * In order to access this information, the stringIdxToPositionIdx array must be used to transform the coordinates.
+       * 
+ * + * repeated .DocumentPositionData.Position positions = 3; + */ + public java.util.List + getPositionsBuilderList() { + return getPositionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder> + getPositionsFieldBuilder() { + if (positionsBuilder_ == null) { + positionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.PositionOrBuilder>( + positions_, + ((bitField0_ & 0x00000004) != 0), + getParentForChildren(), + isClean()); + positions_ = null; + } + return positionsBuilder_; + } + // @@protoc_insertion_point(builder_scope:DocumentPositionData) } - private static final com.google.protobuf.Descriptors.Descriptor internal_static_AllDocumentPositionData_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_AllDocumentPositionData_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_DocumentPositionData_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_DocumentPositionData_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_DocumentPositionData_Position_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_DocumentPositionData_Position_fieldAccessorTable; - - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - - return descriptor; - } - - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - + // @@protoc_insertion_point(class_scope:DocumentPositionData) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData DEFAULT_INSTANCE; static { - java.lang.String[] descriptorData = {"\n\032DocumentPositionData.proto\"N\n\027AllDocum" - + "entPositionData\0223\n\024documentPositionData\030" - + "\001 \003(\0132\025.DocumentPositionData\"\220\001\n\024Documen" - + "tPositionData\022\n\n\002id\030\001 \001(\003\022\036\n\026stringIdxTo" - + "PositionIdx\030\002 \003(\005\0221\n\tpositions\030\003 \003(\0132\036.D" - + "ocumentPositionData.Position\032\031\n\010Position" - + "\022\r\n\005value\030\001 \003(\002b\006proto3"}; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[]{}); - internal_static_AllDocumentPositionData_descriptor = getDescriptor().getMessageTypes() - .get(0); - internal_static_AllDocumentPositionData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_AllDocumentPositionData_descriptor, - new java.lang.String[]{"DocumentPositionData",}); - internal_static_DocumentPositionData_descriptor = getDescriptor().getMessageTypes() - .get(1); - internal_static_DocumentPositionData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_DocumentPositionData_descriptor, - new java.lang.String[]{"Id", "StringIdxToPositionIdx", "Positions",}); - internal_static_DocumentPositionData_Position_descriptor = internal_static_DocumentPositionData_descriptor.getNestedTypes() - .get(0); - internal_static_DocumentPositionData_Position_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_DocumentPositionData_Position_descriptor, - new java.lang.String[]{"Value",}); - descriptor.resolveAllFeaturesImmutable(); + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData(); } - // @@protoc_insertion_point(outer_class_scope) + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentPositionData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_AllDocumentPositionData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_AllDocumentPositionData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DocumentPositionData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DocumentPositionData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DocumentPositionData_Position_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DocumentPositionData_Position_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\032DocumentPositionData.proto\"N\n\027AllDocum" + + "entPositionData\0223\n\024documentPositionData\030" + + "\001 \003(\0132\025.DocumentPositionData\"\220\001\n\024Documen" + + "tPositionData\022\n\n\002id\030\001 \001(\003\022\036\n\026stringIdxTo" + + "PositionIdx\030\002 \003(\005\0221\n\tpositions\030\003 \003(\0132\036.D" + + "ocumentPositionData.Position\032\031\n\010Position" + + "\022\r\n\005value\030\001 \003(\002Bc\nFcom.knecon.fforesight" + + ".service.layoutparser.internal.api.data." + + "redactionB\031DocumentPositionDataProtob\006pr" + + "oto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_AllDocumentPositionData_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_AllDocumentPositionData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_AllDocumentPositionData_descriptor, + new java.lang.String[] { "DocumentPositionData", }); + internal_static_DocumentPositionData_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_DocumentPositionData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_DocumentPositionData_descriptor, + new java.lang.String[] { "Id", "StringIdxToPositionIdx", "Positions", }); + internal_static_DocumentPositionData_Position_descriptor = + internal_static_DocumentPositionData_descriptor.getNestedTypes().get(0); + internal_static_DocumentPositionData_Position_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_DocumentPositionData_Position_descriptor, + new java.lang.String[] { "Value", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java index d99d5db..7604748 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java @@ -1,799 +1,694 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: DocumentStructure.proto -// Protobuf Java Version: 4.27.1 -@SuppressWarnings("all") +// Protobuf Java Version: 4.28.3 + +package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; + public final class DocumentStructureProto { + private DocumentStructureProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentStructureProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private DocumentStructureProto() {} - + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface DocumentStructureOrBuilder extends + // @@protoc_insertion_point(interface_extends:DocumentStructure) + com.google.protobuf.MessageOrBuilder { + /** + *
+     * The root EntryData represents the Document.
+     * 
+ * + * .EntryData root = 1; + * @return Whether the root field is set. + */ + boolean hasRoot(); + /** + *
+     * The root EntryData represents the Document.
+     * 
+ * + * .EntryData root = 1; + * @return The root. + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getRoot(); + /** + *
+     * The root EntryData represents the Document.
+     * 
+ * + * .EntryData root = 1; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder getRootOrBuilder(); + } + /** + * Protobuf type {@code DocumentStructure} + */ + public static final class DocumentStructure extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:DocumentStructure) + DocumentStructureOrBuilder { + private static final long serialVersionUID = 0L; static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentStructureProto.class.getName()); + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentStructure.class.getName()); + } + // Use DocumentStructure.newBuilder() to construct. + private DocumentStructure(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DocumentStructure() { } - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.internal_static_DocumentStructure_descriptor; } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.internal_static_DocumentStructure_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure.Builder.class); } - - public interface DocumentStructureOrBuilder extends - // @@protoc_insertion_point(interface_extends:DocumentStructure) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * The root EntryData represents the Document.
-         * 
- * - * .EntryData root = 1; - * - * @return Whether the root field is set. - */ - boolean hasRoot(); - - - /** - *
-         * The root EntryData represents the Document.
-         * 
- * - * .EntryData root = 1; - * - * @return The root. - */ - EntryDataProto.EntryData getRoot(); - - - /** - *
-         * The root EntryData represents the Document.
-         * 
- * - * .EntryData root = 1; - */ - EntryDataProto.EntryDataOrBuilder getRootOrBuilder(); - + private int bitField0_; + public static final int ROOT_FIELD_NUMBER = 1; + private com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData root_; + /** + *
+     * The root EntryData represents the Document.
+     * 
+ * + * .EntryData root = 1; + * @return Whether the root field is set. + */ + @java.lang.Override + public boolean hasRoot() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+     * The root EntryData represents the Document.
+     * 
+ * + * .EntryData root = 1; + * @return The root. + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getRoot() { + return root_ == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance() : root_; + } + /** + *
+     * The root EntryData represents the Document.
+     * 
+ * + * .EntryData root = 1; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder getRootOrBuilder() { + return root_ == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance() : root_; } + 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 (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getRoot()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRoot()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure) obj; + + if (hasRoot() != other.hasRoot()) return false; + if (hasRoot()) { + if (!getRoot() + .equals(other.getRoot())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRoot()) { + hash = (37 * hash) + ROOT_FIELD_NUMBER; + hash = (53 * hash) + getRoot().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code DocumentStructure} */ - public static final class DocumentStructure extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:DocumentStructure) - DocumentStructureOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:DocumentStructure) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructureOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.internal_static_DocumentStructure_descriptor; + } - private static final long serialVersionUID = 0L; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.internal_static_DocumentStructure_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure.Builder.class); + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentStructure.class.getName()); + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + getRootFieldBuilder(); } - - // Use DocumentStructure.newBuilder() to construct. - private DocumentStructure(com.google.protobuf.GeneratedMessage.Builder builder) { - - super(builder); + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + root_ = null; + if (rootBuilder_ != null) { + rootBuilder_.dispose(); + rootBuilder_ = null; } + return this; + } + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.internal_static_DocumentStructure_descriptor; + } - private DocumentStructure() { + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure.getDefaultInstance(); + } + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentStructureProto.internal_static_DocumentStructure_descriptor; + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.root_ = rootBuilder_ == null + ? root_ + : rootBuilder_.build(); + to_bitField0_ |= 0x00000001; } + result.bitField0_ |= to_bitField0_; + } - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentStructureProto.internal_static_DocumentStructure_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentStructure.class, Builder.class); + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure)other); + } else { + super.mergeFrom(other); + return this; } + } - - private int bitField0_; - public static final int ROOT_FIELD_NUMBER = 1; - private EntryDataProto.EntryData root_; - - - /** - *
-         * The root EntryData represents the Document.
-         * 
- * - * .EntryData root = 1; - * - * @return Whether the root field is set. - */ - @Override - public boolean hasRoot() { - - return ((bitField0_ & 0x00000001) != 0); + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure.getDefaultInstance()) return this; + if (other.hasRoot()) { + mergeRoot(other.getRoot()); } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - /** - *
-         * The root EntryData represents the Document.
-         * 
- * - * .EntryData root = 1; - * - * @return The root. - */ - @Override - public EntryDataProto.EntryData getRoot() { - - return root_ == null ? EntryDataProto.EntryData.getDefaultInstance() : root_; + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - - - /** - *
-         * The root EntryData represents the Document.
-         * 
- * - * .EntryData root = 1; - */ - @Override - public EntryDataProto.EntryDataOrBuilder getRootOrBuilder() { - - return root_ == null ? EntryDataProto.EntryData.getDefaultInstance() : root_; - } - - - private byte memoizedIsInitialized = -1; - - - @Override - public final boolean isInitialized() { - - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; - } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; - } - - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - if (((bitField0_ & 0x00000001) != 0)) { - output.writeMessage(1, getRoot()); - } - getUnknownFields().writeTo(output); - } - - - @Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - if (((bitField0_ & 0x00000001) != 0)) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getRoot()); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - - @Override - public boolean equals(final Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof DocumentStructure)) { - return super.equals(obj); - } - DocumentStructure other = (DocumentStructure) obj; - - if (hasRoot() != other.hasRoot()) { - return false; - } - if (hasRoot()) { - if (!getRoot().equals(other.getRoot())) { - return false; - } - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - - @Override - public int hashCode() { - - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (hasRoot()) { - hash = (37 * hash) + ROOT_FIELD_NUMBER; - hash = (53 * hash) + getRoot().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - - public static DocumentStructure parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentStructure parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentStructure parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentStructure parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentStructure parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentStructure parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentStructure parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentStructure parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentStructure parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static DocumentStructure parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentStructure parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentStructure parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(DocumentStructure prototype) { - - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - - @Override - public Builder toBuilder() { - - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - - @Override - protected Builder newBuilderForType(BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - * Protobuf type {@code DocumentStructure} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:DocumentStructure) - DocumentStructureOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentStructureProto.internal_static_DocumentStructure_descriptor; - } - - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentStructureProto.internal_static_DocumentStructure_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentStructure.class, Builder.class); - } - - - // Construct using DocumentStructureOuterClass.DocumentStructure.newBuilder() - private Builder() { - - maybeForceBuilderInitialization(); - } - - - private Builder(BuilderParent parent) { - - super(parent); - maybeForceBuilderInitialization(); - } - - - private void maybeForceBuilderInitialization() { - - if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { - getRootFieldBuilder(); - } - } - - - @Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - root_ = null; - if (rootBuilder_ != null) { - rootBuilder_.dispose(); - rootBuilder_ = null; - } - return this; - } - - - @Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentStructureProto.internal_static_DocumentStructure_descriptor; - } - - - @Override - public DocumentStructure getDefaultInstanceForType() { - - return DocumentStructure.getDefaultInstance(); - } - - - @Override - public DocumentStructure build() { - - DocumentStructure result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @Override - public DocumentStructure buildPartial() { - - DocumentStructure result = new DocumentStructure(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartial0(DocumentStructure result) { - - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.root_ = rootBuilder_ == null ? root_ : rootBuilder_.build(); - to_bitField0_ |= 0x00000001; - } - result.bitField0_ |= to_bitField0_; - } - - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof DocumentStructure) { - return mergeFrom((DocumentStructure) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(DocumentStructure other) { - - if (other == DocumentStructure.getDefaultInstance()) { - return this; - } - if (other.hasRoot()) { - mergeRoot(other.getRoot()); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - - @Override - public final boolean isInitialized() { - - return true; - } - - - @Override - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - if (extensionRegistry == null) { - throw new NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - input.readMessage(getRootFieldBuilder().getBuilder(), extensionRegistry); - bitField0_ |= 0x00000001; - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private EntryDataProto.EntryData root_; - private com.google.protobuf.SingleFieldBuilder rootBuilder_; - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - * - * @return Whether the root field is set. - */ - public boolean hasRoot() { - - return ((bitField0_ & 0x00000001) != 0); - } - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - * - * @return The root. - */ - public EntryDataProto.EntryData getRoot() { - - if (rootBuilder_ == null) { - return root_ == null ? EntryDataProto.EntryData.getDefaultInstance() : root_; - } else { - return rootBuilder_.getMessage(); - } - } - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - */ - public Builder setRoot(EntryDataProto.EntryData value) { - - if (rootBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - root_ = value; - } else { - rootBuilder_.setMessage(value); - } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getRootFieldBuilder().getBuilder(), + extensionRegistry); bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - */ - public Builder setRoot(EntryDataProto.EntryData.Builder builderForValue) { - - if (rootBuilder_ == null) { - root_ = builderForValue.build(); - } else { - rootBuilder_.setMessage(builderForValue.build()); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag } - bitField0_ |= 0x00000001; - onChanged(); - return this; - } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - */ - public Builder mergeRoot(EntryDataProto.EntryData value) { - - if (rootBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0) && root_ != null && root_ != EntryDataProto.EntryData.getDefaultInstance()) { - getRootBuilder().mergeFrom(value); - } else { - root_ = value; - } - } else { - rootBuilder_.mergeFrom(value); - } - if (root_ != null) { - bitField0_ |= 0x00000001; - onChanged(); - } - return this; - } - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - */ - public Builder clearRoot() { - - bitField0_ = (bitField0_ & ~0x00000001); - root_ = null; - if (rootBuilder_ != null) { - rootBuilder_.dispose(); - rootBuilder_ = null; - } - onChanged(); - return this; - } - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - */ - public EntryDataProto.EntryData.Builder getRootBuilder() { - - bitField0_ |= 0x00000001; - onChanged(); - return getRootFieldBuilder().getBuilder(); - } - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - */ - public EntryDataProto.EntryDataOrBuilder getRootOrBuilder() { - - if (rootBuilder_ != null) { - return rootBuilder_.getMessageOrBuilder(); - } else { - return root_ == null ? EntryDataProto.EntryData.getDefaultInstance() : root_; - } - } - - - /** - *
-             * The root EntryData represents the Document.
-             * 
- * - * .EntryData root = 1; - */ - private com.google.protobuf.SingleFieldBuilder getRootFieldBuilder() { - - if (rootBuilder_ == null) { - rootBuilder_ = new com.google.protobuf.SingleFieldBuilder(getRoot(), - getParentForChildren(), - isClean()); - root_ = null; - } - return rootBuilder_; - } - - // @@protoc_insertion_point(builder_scope:DocumentStructure) + private com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData root_; + private com.google.protobuf.SingleFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder> rootBuilder_; + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + * @return Whether the root field is set. + */ + public boolean hasRoot() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + * @return The root. + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getRoot() { + if (rootBuilder_ == null) { + return root_ == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance() : root_; + } else { + return rootBuilder_.getMessage(); } - - // @@protoc_insertion_point(class_scope:DocumentStructure) - private static final DocumentStructure DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new DocumentStructure(); + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + */ + public Builder setRoot(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData value) { + if (rootBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + root_ = value; + } else { + rootBuilder_.setMessage(value); } - - public static DocumentStructure getDefaultInstance() { - - return DEFAULT_INSTANCE; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + */ + public Builder setRoot( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder builderForValue) { + if (rootBuilder_ == null) { + root_ = builderForValue.build(); + } else { + rootBuilder_.setMessage(builderForValue.build()); } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @Override - public DocumentStructure parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - - public static com.google.protobuf.Parser parser() { - - return PARSER; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + */ + public Builder mergeRoot(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData value) { + if (rootBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + root_ != null && + root_ != com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance()) { + getRootBuilder().mergeFrom(value); + } else { + root_ = value; + } + } else { + rootBuilder_.mergeFrom(value); } - - - @Override - public com.google.protobuf.Parser getParserForType() { - - return PARSER; + if (root_ != null) { + bitField0_ |= 0x00000001; + onChanged(); } - - - @Override - public DocumentStructure getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; + return this; + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + */ + public Builder clearRoot() { + bitField0_ = (bitField0_ & ~0x00000001); + root_ = null; + if (rootBuilder_ != null) { + rootBuilder_.dispose(); + rootBuilder_ = null; } + onChanged(); + return this; + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder getRootBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getRootFieldBuilder().getBuilder(); + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder getRootOrBuilder() { + if (rootBuilder_ != null) { + return rootBuilder_.getMessageOrBuilder(); + } else { + return root_ == null ? + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance() : root_; + } + } + /** + *
+       * The root EntryData represents the Document.
+       * 
+ * + * .EntryData root = 1; + */ + private com.google.protobuf.SingleFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder> + getRootFieldBuilder() { + if (rootBuilder_ == null) { + rootBuilder_ = new com.google.protobuf.SingleFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder>( + getRoot(), + getParentForChildren(), + isClean()); + root_ = null; + } + return rootBuilder_; + } + // @@protoc_insertion_point(builder_scope:DocumentStructure) } - private static final com.google.protobuf.Descriptors.Descriptor internal_static_DocumentStructure_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_DocumentStructure_fieldAccessorTable; - - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - - return descriptor; - } - - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - + // @@protoc_insertion_point(class_scope:DocumentStructure) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure DEFAULT_INSTANCE; static { - String[] descriptorData = {"\n\027DocumentStructure.proto\032\017EntryData.pro" - + "to\"-\n\021DocumentStructure\022\030\n\004root\030\001 \001(\0132\n." - + "EntryDatab\006proto3"}; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{EntryDataProto.getDescriptor(),}); - internal_static_DocumentStructure_descriptor = getDescriptor().getMessageTypes() - .get(0); - internal_static_DocumentStructure_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_DocumentStructure_descriptor, - new String[]{"Root",}); - descriptor.resolveAllFeaturesImmutable(); - EntryDataProto.getDescriptor(); + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure(); } - // @@protoc_insertion_point(outer_class_scope) + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentStructure parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DocumentStructure_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DocumentStructure_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\027DocumentStructure.proto\032\017EntryData.pro" + + "to\"-\n\021DocumentStructure\022\030\n\004root\030\001 \001(\0132\n." + + "EntryDataB`\nFcom.knecon.fforesight.servi" + + "ce.layoutparser.internal.api.data.redact" + + "ionB\026DocumentStructureProtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.getDescriptor(), + }); + internal_static_DocumentStructure_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_DocumentStructure_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_DocumentStructure_descriptor, + new java.lang.String[] { "Root", }); + descriptor.resolveAllFeaturesImmutable(); + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureWrapper.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureWrapper.java index 79a3ad3..98a65a5 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureWrapper.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureWrapper.java @@ -1,16 +1,14 @@ package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; import static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure; +import static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; import java.awt.geom.Rectangle2D; -import java.io.ObjectStreamException; import java.io.Serializable; import java.util.Arrays; import java.util.List; import java.util.stream.Stream; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; - import io.swagger.v3.oas.annotations.media.Schema; import lombok.AllArgsConstructor; import lombok.Getter; diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextDataProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextDataProto.java index 0f36219..81e57d9 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextDataProto.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextDataProto.java @@ -1,2424 +1,2069 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: DocumentTextData.proto -// Protobuf Java Version: 4.27.1 -@SuppressWarnings("all") +// Protobuf Java Version: 4.28.3 + +package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; + public final class DocumentTextDataProto { + private DocumentTextDataProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentTextDataProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private DocumentTextDataProto() {} - + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface AllDocumentTextDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:AllDocumentTextData) + com.google.protobuf.MessageOrBuilder { + /** + * repeated .DocumentTextData documentTextData = 1; + */ + java.util.List + getDocumentTextDataList(); + /** + * repeated .DocumentTextData documentTextData = 1; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData getDocumentTextData(int index); + /** + * repeated .DocumentTextData documentTextData = 1; + */ + int getDocumentTextDataCount(); + /** + * repeated .DocumentTextData documentTextData = 1; + */ + java.util.List + getDocumentTextDataOrBuilderList(); + /** + * repeated .DocumentTextData documentTextData = 1; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextDataOrBuilder getDocumentTextDataOrBuilder( + int index); + } + /** + * Protobuf type {@code AllDocumentTextData} + */ + public static final class AllDocumentTextData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:AllDocumentTextData) + AllDocumentTextDataOrBuilder { + private static final long serialVersionUID = 0L; static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentTextDataProto.class.getName()); + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + AllDocumentTextData.class.getName()); + } + // Use AllDocumentTextData.newBuilder() to construct. + private AllDocumentTextData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private AllDocumentTextData() { + documentTextData_ = java.util.Collections.emptyList(); } - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { - + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_AllDocumentTextData_descriptor; } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_AllDocumentTextData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData.Builder.class); } - - public interface AllDocumentTextDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:AllDocumentTextData) - com.google.protobuf.MessageOrBuilder { - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - java.util.List getDocumentTextDataList(); - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - DocumentTextData getDocumentTextData(int index); - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - int getDocumentTextDataCount(); - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - java.util.List getDocumentTextDataOrBuilderList(); - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - DocumentTextDataOrBuilder getDocumentTextDataOrBuilder(int index); - + public static final int DOCUMENTTEXTDATA_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private java.util.List documentTextData_; + /** + * repeated .DocumentTextData documentTextData = 1; + */ + @java.lang.Override + public java.util.List getDocumentTextDataList() { + return documentTextData_; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + @java.lang.Override + public java.util.List + getDocumentTextDataOrBuilderList() { + return documentTextData_; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + @java.lang.Override + public int getDocumentTextDataCount() { + return documentTextData_.size(); + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData getDocumentTextData(int index) { + return documentTextData_.get(index); + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextDataOrBuilder getDocumentTextDataOrBuilder( + int index) { + return documentTextData_.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 { + for (int i = 0; i < documentTextData_.size(); i++) { + output.writeMessage(1, documentTextData_.get(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < documentTextData_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, documentTextData_.get(i)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData) obj; + + if (!getDocumentTextDataList() + .equals(other.getDocumentTextDataList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDocumentTextDataCount() > 0) { + hash = (37 * hash) + DOCUMENTTEXTDATA_FIELD_NUMBER; + hash = (53 * hash) + getDocumentTextDataList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code AllDocumentTextData} */ - public static final class AllDocumentTextData extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:AllDocumentTextData) - AllDocumentTextDataOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:AllDocumentTextData) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_AllDocumentTextData_descriptor; + } - private static final long serialVersionUID = 0L; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_AllDocumentTextData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData.Builder.class); + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", AllDocumentTextData.class.getName()); + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (documentTextDataBuilder_ == null) { + documentTextData_ = java.util.Collections.emptyList(); + } else { + documentTextData_ = null; + documentTextDataBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } - // Use AllDocumentTextData.newBuilder() to construct. - private AllDocumentTextData(com.google.protobuf.GeneratedMessage.Builder builder) { + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_AllDocumentTextData_descriptor; + } - super(builder); + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData.getDefaultInstance(); + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } - private AllDocumentTextData() { - - documentTextData_ = java.util.Collections.emptyList(); - } - - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentTextDataProto.internal_static_AllDocumentTextData_descriptor; - } - - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentTextDataProto.internal_static_AllDocumentTextData_fieldAccessorTable.ensureFieldAccessorsInitialized(AllDocumentTextData.class, Builder.class); - } - - - public static final int DOCUMENTTEXTDATA_FIELD_NUMBER = 1; - @SuppressWarnings("serial") - private java.util.List documentTextData_; - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - @Override - public java.util.List getDocumentTextDataList() { - - return documentTextData_; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - @Override - public java.util.List getDocumentTextDataOrBuilderList() { - - return documentTextData_; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - @Override - public int getDocumentTextDataCount() { - - return documentTextData_.size(); - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - @Override - public DocumentTextData getDocumentTextData(int index) { - - return documentTextData_.get(index); - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - @Override - public DocumentTextDataOrBuilder getDocumentTextDataOrBuilder(int index) { - - return documentTextData_.get(index); - } - - - private byte memoizedIsInitialized = -1; - - - @Override - public final boolean isInitialized() { - - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; + private void buildPartialRepeatedFields(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData result) { + if (documentTextDataBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + documentTextData_ = java.util.Collections.unmodifiableList(documentTextData_); + bitField0_ = (bitField0_ & ~0x00000001); } - if (isInitialized == 0) { - return false; + result.documentTextData_ = documentTextData_; + } else { + result.documentTextData_ = documentTextDataBuilder_.build(); + } + } + + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData result) { + int from_bitField0_ = bitField0_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData.getDefaultInstance()) return this; + if (documentTextDataBuilder_ == null) { + if (!other.documentTextData_.isEmpty()) { + if (documentTextData_.isEmpty()) { + documentTextData_ = other.documentTextData_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDocumentTextDataIsMutable(); + documentTextData_.addAll(other.documentTextData_); + } + onChanged(); } - - memoizedIsInitialized = 1; - return true; - } - - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - for (int i = 0; i < documentTextData_.size(); i++) { - output.writeMessage(1, documentTextData_.get(i)); + } else { + if (!other.documentTextData_.isEmpty()) { + if (documentTextDataBuilder_.isEmpty()) { + documentTextDataBuilder_.dispose(); + documentTextDataBuilder_ = null; + documentTextData_ = other.documentTextData_; + bitField0_ = (bitField0_ & ~0x00000001); + documentTextDataBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getDocumentTextDataFieldBuilder() : null; + } else { + documentTextDataBuilder_.addAllMessages(other.documentTextData_); } - getUnknownFields().writeTo(output); - } - - - @Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; } - - size = 0; - for (int i = 0; i < documentTextData_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, documentTextData_.get(i)); - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - @Override - public boolean equals(final Object obj) { + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData m = + input.readMessage( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.parser(), + extensionRegistry); + if (documentTextDataBuilder_ == null) { + ensureDocumentTextDataIsMutable(); + documentTextData_.add(m); + } else { + documentTextDataBuilder_.addMessage(m); + } + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; - if (obj == this) { - return true; - } - if (!(obj instanceof AllDocumentTextData)) { - return super.equals(obj); - } - AllDocumentTextData other = (AllDocumentTextData) obj; + private java.util.List documentTextData_ = + java.util.Collections.emptyList(); + private void ensureDocumentTextDataIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + documentTextData_ = new java.util.ArrayList(documentTextData_); + bitField0_ |= 0x00000001; + } + } - if (!getDocumentTextDataList().equals(other.getDocumentTextDataList())) { - return false; + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextDataOrBuilder> documentTextDataBuilder_; + + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public java.util.List getDocumentTextDataList() { + if (documentTextDataBuilder_ == null) { + return java.util.Collections.unmodifiableList(documentTextData_); + } else { + return documentTextDataBuilder_.getMessageList(); + } + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public int getDocumentTextDataCount() { + if (documentTextDataBuilder_ == null) { + return documentTextData_.size(); + } else { + return documentTextDataBuilder_.getCount(); + } + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData getDocumentTextData(int index) { + if (documentTextDataBuilder_ == null) { + return documentTextData_.get(index); + } else { + return documentTextDataBuilder_.getMessage(index); + } + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder setDocumentTextData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData value) { + if (documentTextDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; + ensureDocumentTextDataIsMutable(); + documentTextData_.set(index, value); + onChanged(); + } else { + documentTextDataBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder setDocumentTextData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder builderForValue) { + if (documentTextDataBuilder_ == null) { + ensureDocumentTextDataIsMutable(); + documentTextData_.set(index, builderForValue.build()); + onChanged(); + } else { + documentTextDataBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder addDocumentTextData(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData value) { + if (documentTextDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); } - return true; + ensureDocumentTextDataIsMutable(); + documentTextData_.add(value); + onChanged(); + } else { + documentTextDataBuilder_.addMessage(value); } - - - @Override - public int hashCode() { - - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - if (getDocumentTextDataCount() > 0) { - hash = (37 * hash) + DOCUMENTTEXTDATA_FIELD_NUMBER; - hash = (53 * hash) + getDocumentTextDataList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder addDocumentTextData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData value) { + if (documentTextDataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureDocumentTextDataIsMutable(); + documentTextData_.add(index, value); + onChanged(); + } else { + documentTextDataBuilder_.addMessage(index, value); } - - - public static AllDocumentTextData parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder addDocumentTextData( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder builderForValue) { + if (documentTextDataBuilder_ == null) { + ensureDocumentTextDataIsMutable(); + documentTextData_.add(builderForValue.build()); + onChanged(); + } else { + documentTextDataBuilder_.addMessage(builderForValue.build()); } - - - public static AllDocumentTextData parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder addDocumentTextData( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder builderForValue) { + if (documentTextDataBuilder_ == null) { + ensureDocumentTextDataIsMutable(); + documentTextData_.add(index, builderForValue.build()); + onChanged(); + } else { + documentTextDataBuilder_.addMessage(index, builderForValue.build()); } - - - public static AllDocumentTextData parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder addAllDocumentTextData( + java.lang.Iterable values) { + if (documentTextDataBuilder_ == null) { + ensureDocumentTextDataIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, documentTextData_); + onChanged(); + } else { + documentTextDataBuilder_.addAllMessages(values); } - - - public static AllDocumentTextData parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder clearDocumentTextData() { + if (documentTextDataBuilder_ == null) { + documentTextData_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + documentTextDataBuilder_.clear(); } - - - public static AllDocumentTextData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public Builder removeDocumentTextData(int index) { + if (documentTextDataBuilder_ == null) { + ensureDocumentTextDataIsMutable(); + documentTextData_.remove(index); + onChanged(); + } else { + documentTextDataBuilder_.remove(index); } - - - public static AllDocumentTextData parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); + return this; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder getDocumentTextDataBuilder( + int index) { + return getDocumentTextDataFieldBuilder().getBuilder(index); + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextDataOrBuilder getDocumentTextDataOrBuilder( + int index) { + if (documentTextDataBuilder_ == null) { + return documentTextData_.get(index); } else { + return documentTextDataBuilder_.getMessageOrBuilder(index); } - - - public static AllDocumentTextData parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public java.util.List + getDocumentTextDataOrBuilderList() { + if (documentTextDataBuilder_ != null) { + return documentTextDataBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(documentTextData_); } - - - public static AllDocumentTextData parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static AllDocumentTextData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static AllDocumentTextData parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static AllDocumentTextData parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static AllDocumentTextData parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(AllDocumentTextData prototype) { - - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - - @Override - public Builder toBuilder() { - - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - - @Override - protected Builder newBuilderForType(BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - * Protobuf type {@code AllDocumentTextData} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:AllDocumentTextData) - AllDocumentTextDataOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentTextDataProto.internal_static_AllDocumentTextData_descriptor; - } - - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentTextDataProto.internal_static_AllDocumentTextData_fieldAccessorTable.ensureFieldAccessorsInitialized(AllDocumentTextData.class, Builder.class); - } - - - // Construct using DocumentTextDataOuterClass.AllDocumentTextData.newBuilder() - private Builder() { - - } - - - private Builder(BuilderParent parent) { - - super(parent); - - } - - - @Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - if (documentTextDataBuilder_ == null) { - documentTextData_ = java.util.Collections.emptyList(); - } else { - documentTextData_ = null; - documentTextDataBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000001); - return this; - } - - - @Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentTextDataProto.internal_static_AllDocumentTextData_descriptor; - } - - - @Override - public AllDocumentTextData getDefaultInstanceForType() { - - return AllDocumentTextData.getDefaultInstance(); - } - - - @Override - public AllDocumentTextData build() { - - AllDocumentTextData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @Override - public AllDocumentTextData buildPartial() { - - AllDocumentTextData result = new AllDocumentTextData(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartialRepeatedFields(AllDocumentTextData result) { - - if (documentTextDataBuilder_ == null) { - if (((bitField0_ & 0x00000001) != 0)) { - documentTextData_ = java.util.Collections.unmodifiableList(documentTextData_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.documentTextData_ = documentTextData_; - } else { - result.documentTextData_ = documentTextDataBuilder_.build(); - } - } - - - private void buildPartial0(AllDocumentTextData result) { - - int from_bitField0_ = bitField0_; - } - - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof AllDocumentTextData) { - return mergeFrom((AllDocumentTextData) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(AllDocumentTextData other) { - - if (other == AllDocumentTextData.getDefaultInstance()) { - return this; - } - if (documentTextDataBuilder_ == null) { - if (!other.documentTextData_.isEmpty()) { - if (documentTextData_.isEmpty()) { - documentTextData_ = other.documentTextData_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureDocumentTextDataIsMutable(); - documentTextData_.addAll(other.documentTextData_); - } - onChanged(); - } - } else { - if (!other.documentTextData_.isEmpty()) { - if (documentTextDataBuilder_.isEmpty()) { - documentTextDataBuilder_.dispose(); - documentTextDataBuilder_ = null; - documentTextData_ = other.documentTextData_; - bitField0_ = (bitField0_ & ~0x00000001); - documentTextDataBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getDocumentTextDataFieldBuilder() : null; - } else { - documentTextDataBuilder_.addAllMessages(other.documentTextData_); - } - } - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - - @Override - public final boolean isInitialized() { - - return true; - } - - - @Override - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - if (extensionRegistry == null) { - throw new NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 10: { - DocumentTextData m = input.readMessage(DocumentTextData.parser(), extensionRegistry); - if (documentTextDataBuilder_ == null) { - ensureDocumentTextDataIsMutable(); - documentTextData_.add(m); - } else { - documentTextDataBuilder_.addMessage(m); - } - break; - } // case 10 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private java.util.List documentTextData_ = java.util.Collections.emptyList(); - - - private void ensureDocumentTextDataIsMutable() { - - if (!((bitField0_ & 0x00000001) != 0)) { - documentTextData_ = new java.util.ArrayList(documentTextData_); - bitField0_ |= 0x00000001; - } - } - - - private com.google.protobuf.RepeatedFieldBuilder documentTextDataBuilder_; - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public java.util.List getDocumentTextDataList() { - - if (documentTextDataBuilder_ == null) { - return java.util.Collections.unmodifiableList(documentTextData_); - } else { - return documentTextDataBuilder_.getMessageList(); - } - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public int getDocumentTextDataCount() { - - if (documentTextDataBuilder_ == null) { - return documentTextData_.size(); - } else { - return documentTextDataBuilder_.getCount(); - } - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public DocumentTextData getDocumentTextData(int index) { - - if (documentTextDataBuilder_ == null) { - return documentTextData_.get(index); - } else { - return documentTextDataBuilder_.getMessage(index); - } - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder setDocumentTextData(int index, DocumentTextData value) { - - if (documentTextDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentTextDataIsMutable(); - documentTextData_.set(index, value); - onChanged(); - } else { - documentTextDataBuilder_.setMessage(index, value); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder setDocumentTextData(int index, DocumentTextData.Builder builderForValue) { - - if (documentTextDataBuilder_ == null) { - ensureDocumentTextDataIsMutable(); - documentTextData_.set(index, builderForValue.build()); - onChanged(); - } else { - documentTextDataBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder addDocumentTextData(DocumentTextData value) { - - if (documentTextDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentTextDataIsMutable(); - documentTextData_.add(value); - onChanged(); - } else { - documentTextDataBuilder_.addMessage(value); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder addDocumentTextData(int index, DocumentTextData value) { - - if (documentTextDataBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureDocumentTextDataIsMutable(); - documentTextData_.add(index, value); - onChanged(); - } else { - documentTextDataBuilder_.addMessage(index, value); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder addDocumentTextData(DocumentTextData.Builder builderForValue) { - - if (documentTextDataBuilder_ == null) { - ensureDocumentTextDataIsMutable(); - documentTextData_.add(builderForValue.build()); - onChanged(); - } else { - documentTextDataBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder addDocumentTextData(int index, DocumentTextData.Builder builderForValue) { - - if (documentTextDataBuilder_ == null) { - ensureDocumentTextDataIsMutable(); - documentTextData_.add(index, builderForValue.build()); - onChanged(); - } else { - documentTextDataBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder addAllDocumentTextData(Iterable values) { - - if (documentTextDataBuilder_ == null) { - ensureDocumentTextDataIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, documentTextData_); - onChanged(); - } else { - documentTextDataBuilder_.addAllMessages(values); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder clearDocumentTextData() { - - if (documentTextDataBuilder_ == null) { - documentTextData_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - onChanged(); - } else { - documentTextDataBuilder_.clear(); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public Builder removeDocumentTextData(int index) { - - if (documentTextDataBuilder_ == null) { - ensureDocumentTextDataIsMutable(); - documentTextData_.remove(index); - onChanged(); - } else { - documentTextDataBuilder_.remove(index); - } - return this; - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public DocumentTextData.Builder getDocumentTextDataBuilder(int index) { - - return getDocumentTextDataFieldBuilder().getBuilder(index); - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public DocumentTextDataOrBuilder getDocumentTextDataOrBuilder(int index) { - - if (documentTextDataBuilder_ == null) { - return documentTextData_.get(index); - } else { - return documentTextDataBuilder_.getMessageOrBuilder(index); - } - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public java.util.List getDocumentTextDataOrBuilderList() { - - if (documentTextDataBuilder_ != null) { - return documentTextDataBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(documentTextData_); - } - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public DocumentTextData.Builder addDocumentTextDataBuilder() { - - return getDocumentTextDataFieldBuilder().addBuilder(DocumentTextData.getDefaultInstance()); - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public DocumentTextData.Builder addDocumentTextDataBuilder(int index) { - - return getDocumentTextDataFieldBuilder().addBuilder(index, DocumentTextData.getDefaultInstance()); - } - - - /** - * repeated .DocumentTextData documentTextData = 1; - */ - public java.util.List getDocumentTextDataBuilderList() { - - return getDocumentTextDataFieldBuilder().getBuilderList(); - } - - - private com.google.protobuf.RepeatedFieldBuilder getDocumentTextDataFieldBuilder() { - - if (documentTextDataBuilder_ == null) { - documentTextDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(documentTextData_, - ((bitField0_ - & 0x00000001) - != 0), - getParentForChildren(), - isClean()); - documentTextData_ = null; - } - return documentTextDataBuilder_; - } - - // @@protoc_insertion_point(builder_scope:AllDocumentTextData) - } - - // @@protoc_insertion_point(class_scope:AllDocumentTextData) - private static final AllDocumentTextData DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new AllDocumentTextData(); - } - - public static AllDocumentTextData getDefaultInstance() { - - return DEFAULT_INSTANCE; - } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @Override - public AllDocumentTextData parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - - public static com.google.protobuf.Parser parser() { - - return PARSER; - } - - - @Override - public com.google.protobuf.Parser getParserForType() { - - return PARSER; - } - - - @Override - public AllDocumentTextData getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder addDocumentTextDataBuilder() { + return getDocumentTextDataFieldBuilder().addBuilder( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.getDefaultInstance()); + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder addDocumentTextDataBuilder( + int index) { + return getDocumentTextDataFieldBuilder().addBuilder( + index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.getDefaultInstance()); + } + /** + * repeated .DocumentTextData documentTextData = 1; + */ + public java.util.List + getDocumentTextDataBuilderList() { + return getDocumentTextDataFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextDataOrBuilder> + getDocumentTextDataFieldBuilder() { + if (documentTextDataBuilder_ == null) { + documentTextDataBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextDataOrBuilder>( + documentTextData_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + documentTextData_ = null; } + return documentTextDataBuilder_; + } + // @@protoc_insertion_point(builder_scope:AllDocumentTextData) } - public interface DocumentTextDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:DocumentTextData) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * Identifier of the text block.
-         * 
- * - * int64 id = 1; - * - * @return The id. - */ - long getId(); - - - /** - *
-         * The page the text block occurs on.
-         * 
- * - * int64 page = 2; - * - * @return The page. - */ - long getPage(); - - - /** - *
-         * The text of the text block.
-         * 
- * - * string searchText = 3; - * - * @return The searchText. - */ - String getSearchText(); - - - /** - *
-         * The text of the text block.
-         * 
- * - * string searchText = 3; - * - * @return The bytes for searchText. - */ - com.google.protobuf.ByteString getSearchTextBytes(); - - - /** - *
-         * Each text block is assigned a number on a page, starting from 0.
-         * 
- * - * int32 numberOnPage = 4; - * - * @return The numberOnPage. - */ - int getNumberOnPage(); - - - /** - *
-         * The text blocks are ordered, this number represents the start of the text block as a string offset.
-         * 
- * - * int32 start = 5; - * - * @return The start. - */ - int getStart(); - - - /** - *
-         * The text blocks are ordered, this number represents the end of the text block as a string offset.
-         * 
- * - * int32 end = 6; - * - * @return The end. - */ - int getEnd(); - - - /** - *
-         * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-         * 
- * - * repeated int32 lineBreaks = 7; - * - * @return A list containing the lineBreaks. - */ - java.util.List getLineBreaksList(); - - - /** - *
-         * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-         * 
- * - * repeated int32 lineBreaks = 7; - * - * @return The count of lineBreaks. - */ - int getLineBreaksCount(); - - - /** - *
-         * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-         * 
- * - * repeated int32 lineBreaks = 7; - * - * @param index The index of the element to return. - * @return The lineBreaks at the given index. - */ - int getLineBreaks(int index); - + // @@protoc_insertion_point(class_scope:AllDocumentTextData) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData(); } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AllDocumentTextData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DocumentTextDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:DocumentTextData) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Identifier of the text block.
+     * 
+ * + * int64 id = 1; + * @return The id. + */ + long getId(); + + /** + *
+     * The page the text block occurs on.
+     * 
+ * + * int64 page = 2; + * @return The page. + */ + long getPage(); + + /** + *
+     * The text of the text block.
+     * 
+ * + * string searchText = 3; + * @return The searchText. + */ + java.lang.String getSearchText(); + /** + *
+     * The text of the text block.
+     * 
+ * + * string searchText = 3; + * @return The bytes for searchText. + */ + com.google.protobuf.ByteString + getSearchTextBytes(); + + /** + *
+     * Each text block is assigned a number on a page, starting from 0.
+     * 
+ * + * int32 numberOnPage = 4; + * @return The numberOnPage. + */ + int getNumberOnPage(); + + /** + *
+     * The text blocks are ordered, this number represents the start of the text block as a string offset.
+     * 
+ * + * int32 start = 5; + * @return The start. + */ + int getStart(); + + /** + *
+     * The text blocks are ordered, this number represents the end of the text block as a string offset.
+     * 
+ * + * int32 end = 6; + * @return The end. + */ + int getEnd(); + + /** + *
+     * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+     * 
+ * + * repeated int32 lineBreaks = 7; + * @return A list containing the lineBreaks. + */ + java.util.List getLineBreaksList(); + /** + *
+     * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+     * 
+ * + * repeated int32 lineBreaks = 7; + * @return The count of lineBreaks. + */ + int getLineBreaksCount(); + /** + *
+     * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+     * 
+ * + * repeated int32 lineBreaks = 7; + * @param index The index of the element to return. + * @return The lineBreaks at the given index. + */ + int getLineBreaks(int index); + } + /** + * Protobuf type {@code DocumentTextData} + */ + public static final class DocumentTextData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:DocumentTextData) + DocumentTextDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + DocumentTextData.class.getName()); + } + // Use DocumentTextData.newBuilder() to construct. + private DocumentTextData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private DocumentTextData() { + searchText_ = ""; + lineBreaks_ = emptyIntList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_DocumentTextData_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_DocumentTextData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private long id_ = 0L; + /** + *
+     * Identifier of the text block.
+     * 
+ * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + + public static final int PAGE_FIELD_NUMBER = 2; + private long page_ = 0L; + /** + *
+     * The page the text block occurs on.
+     * 
+ * + * int64 page = 2; + * @return The page. + */ + @java.lang.Override + public long getPage() { + return page_; + } + + public static final int SEARCHTEXT_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private volatile java.lang.Object searchText_ = ""; + /** + *
+     * The text of the text block.
+     * 
+ * + * string searchText = 3; + * @return The searchText. + */ + @java.lang.Override + public java.lang.String getSearchText() { + java.lang.Object ref = searchText_; + 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(); + searchText_ = s; + return s; + } + } + /** + *
+     * The text of the text block.
+     * 
+ * + * string searchText = 3; + * @return The bytes for searchText. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSearchTextBytes() { + java.lang.Object ref = searchText_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + searchText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NUMBERONPAGE_FIELD_NUMBER = 4; + private int numberOnPage_ = 0; + /** + *
+     * Each text block is assigned a number on a page, starting from 0.
+     * 
+ * + * int32 numberOnPage = 4; + * @return The numberOnPage. + */ + @java.lang.Override + public int getNumberOnPage() { + return numberOnPage_; + } + + public static final int START_FIELD_NUMBER = 5; + private int start_ = 0; + /** + *
+     * The text blocks are ordered, this number represents the start of the text block as a string offset.
+     * 
+ * + * int32 start = 5; + * @return The start. + */ + @java.lang.Override + public int getStart() { + return start_; + } + + public static final int END_FIELD_NUMBER = 6; + private int end_ = 0; + /** + *
+     * The text blocks are ordered, this number represents the end of the text block as a string offset.
+     * 
+ * + * int32 end = 6; + * @return The end. + */ + @java.lang.Override + public int getEnd() { + return end_; + } + + public static final int LINEBREAKS_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList lineBreaks_ = + emptyIntList(); + /** + *
+     * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+     * 
+ * + * repeated int32 lineBreaks = 7; + * @return A list containing the lineBreaks. + */ + @java.lang.Override + public java.util.List + getLineBreaksList() { + return lineBreaks_; + } + /** + *
+     * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+     * 
+ * + * repeated int32 lineBreaks = 7; + * @return The count of lineBreaks. + */ + public int getLineBreaksCount() { + return lineBreaks_.size(); + } + /** + *
+     * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+     * 
+ * + * repeated int32 lineBreaks = 7; + * @param index The index of the element to return. + * @return The lineBreaks at the given index. + */ + public int getLineBreaks(int index) { + return lineBreaks_.getInt(index); + } + private int lineBreaksMemoizedSerializedSize = -1; + + 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 { + getSerializedSize(); + if (id_ != 0L) { + output.writeInt64(1, id_); + } + if (page_ != 0L) { + output.writeInt64(2, page_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(searchText_)) { + com.google.protobuf.GeneratedMessage.writeString(output, 3, searchText_); + } + if (numberOnPage_ != 0) { + output.writeInt32(4, numberOnPage_); + } + if (start_ != 0) { + output.writeInt32(5, start_); + } + if (end_ != 0) { + output.writeInt32(6, end_); + } + if (getLineBreaksList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(lineBreaksMemoizedSerializedSize); + } + for (int i = 0; i < lineBreaks_.size(); i++) { + output.writeInt32NoTag(lineBreaks_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (id_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, id_); + } + if (page_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, page_); + } + if (!com.google.protobuf.GeneratedMessage.isStringEmpty(searchText_)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(3, searchText_); + } + if (numberOnPage_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, numberOnPage_); + } + if (start_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(5, start_); + } + if (end_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(6, end_); + } + { + int dataSize = 0; + for (int i = 0; i < lineBreaks_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(lineBreaks_.getInt(i)); + } + size += dataSize; + if (!getLineBreaksList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + lineBreaksMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData) obj; + + if (getId() + != other.getId()) return false; + if (getPage() + != other.getPage()) return false; + if (!getSearchText() + .equals(other.getSearchText())) return false; + if (getNumberOnPage() + != other.getNumberOnPage()) return false; + if (getStart() + != other.getStart()) return false; + if (getEnd() + != other.getEnd()) return false; + if (!getLineBreaksList() + .equals(other.getLineBreaksList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + com.google.protobuf.Internal.hashLong( + getId()); + hash = (37 * hash) + PAGE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getPage()); + hash = (37 * hash) + SEARCHTEXT_FIELD_NUMBER; + hash = (53 * hash) + getSearchText().hashCode(); + hash = (37 * hash) + NUMBERONPAGE_FIELD_NUMBER; + hash = (53 * hash) + getNumberOnPage(); + hash = (37 * hash) + START_FIELD_NUMBER; + hash = (53 * hash) + getStart(); + hash = (37 * hash) + END_FIELD_NUMBER; + hash = (53 * hash) + getEnd(); + if (getLineBreaksCount() > 0) { + hash = (37 * hash) + LINEBREAKS_FIELD_NUMBER; + hash = (53 * hash) + getLineBreaksList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code DocumentTextData} */ - public static final class DocumentTextData extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:DocumentTextData) - DocumentTextDataOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:DocumentTextData) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_DocumentTextData_descriptor; + } - private static final long serialVersionUID = 0L; + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_DocumentTextData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.Builder.class); + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", DocumentTextData.class.getName()); + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + id_ = 0L; + page_ = 0L; + searchText_ = ""; + numberOnPage_ = 0; + start_ = 0; + end_ = 0; + lineBreaks_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_DocumentTextData_descriptor; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.getDefaultInstance(); + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } + return result; + } - // Use DocumentTextData.newBuilder() to construct. - private DocumentTextData(com.google.protobuf.GeneratedMessage.Builder builder) { + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } - super(builder); + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.id_ = id_; } - - - private DocumentTextData() { - - searchText_ = ""; - lineBreaks_ = emptyIntList(); + if (((from_bitField0_ & 0x00000002) != 0)) { + result.page_ = page_; } - - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentTextDataProto.internal_static_DocumentTextData_descriptor; + if (((from_bitField0_ & 0x00000004) != 0)) { + result.searchText_ = searchText_; } - - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentTextDataProto.internal_static_DocumentTextData_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentTextData.class, Builder.class); + if (((from_bitField0_ & 0x00000008) != 0)) { + result.numberOnPage_ = numberOnPage_; } - - - public static final int ID_FIELD_NUMBER = 1; - private long id_ = 0L; - - - /** - *
-         * Identifier of the text block.
-         * 
- * - * int64 id = 1; - * - * @return The id. - */ - @Override - public long getId() { - - return id_; + if (((from_bitField0_ & 0x00000010) != 0)) { + result.start_ = start_; } - - - public static final int PAGE_FIELD_NUMBER = 2; - private long page_ = 0L; - - - /** - *
-         * The page the text block occurs on.
-         * 
- * - * int64 page = 2; - * - * @return The page. - */ - @Override - public long getPage() { - - return page_; + if (((from_bitField0_ & 0x00000020) != 0)) { + result.end_ = end_; } - - - public static final int SEARCHTEXT_FIELD_NUMBER = 3; - @SuppressWarnings("serial") - private volatile Object searchText_ = ""; - - - /** - *
-         * The text of the text block.
-         * 
- * - * string searchText = 3; - * - * @return The searchText. - */ - @Override - public String getSearchText() { - - Object ref = searchText_; - if (ref instanceof String) { - return (String) ref; - } else { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - searchText_ = s; - return s; - } + if (((from_bitField0_ & 0x00000040) != 0)) { + lineBreaks_.makeImmutable(); + result.lineBreaks_ = lineBreaks_; } + } - - /** - *
-         * The text of the text block.
-         * 
- * - * string searchText = 3; - * - * @return The bytes for searchText. - */ - @Override - public com.google.protobuf.ByteString getSearchTextBytes() { - - Object ref = searchText_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); - searchText_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData)other); + } else { + super.mergeFrom(other); + return this; } + } - - public static final int NUMBERONPAGE_FIELD_NUMBER = 4; - private int numberOnPage_ = 0; - - - /** - *
-         * Each text block is assigned a number on a page, starting from 0.
-         * 
- * - * int32 numberOnPage = 4; - * - * @return The numberOnPage. - */ - @Override - public int getNumberOnPage() { - - return numberOnPage_; + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData.getDefaultInstance()) return this; + if (other.getId() != 0L) { + setId(other.getId()); } - - - public static final int START_FIELD_NUMBER = 5; - private int start_ = 0; - - - /** - *
-         * The text blocks are ordered, this number represents the start of the text block as a string offset.
-         * 
- * - * int32 start = 5; - * - * @return The start. - */ - @Override - public int getStart() { - - return start_; + if (other.getPage() != 0L) { + setPage(other.getPage()); } - - - public static final int END_FIELD_NUMBER = 6; - private int end_ = 0; - - - /** - *
-         * The text blocks are ordered, this number represents the end of the text block as a string offset.
-         * 
- * - * int32 end = 6; - * - * @return The end. - */ - @Override - public int getEnd() { - - return end_; + if (!other.getSearchText().isEmpty()) { + searchText_ = other.searchText_; + bitField0_ |= 0x00000004; + onChanged(); } - - - public static final int LINEBREAKS_FIELD_NUMBER = 7; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.IntList lineBreaks_ = emptyIntList(); - - - /** - *
-         * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-         * 
- * - * repeated int32 lineBreaks = 7; - * - * @return A list containing the lineBreaks. - */ - @Override - public java.util.List getLineBreaksList() { - - return lineBreaks_; + if (other.getNumberOnPage() != 0) { + setNumberOnPage(other.getNumberOnPage()); } - - - /** - *
-         * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-         * 
- * - * repeated int32 lineBreaks = 7; - * - * @return The count of lineBreaks. - */ - public int getLineBreaksCount() { - - return lineBreaks_.size(); + if (other.getStart() != 0) { + setStart(other.getStart()); } - - - /** - *
-         * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-         * 
- * - * repeated int32 lineBreaks = 7; - * - * @param index The index of the element to return. - * @return The lineBreaks at the given index. - */ - public int getLineBreaks(int index) { - - return lineBreaks_.getInt(index); + if (other.getEnd() != 0) { + setEnd(other.getEnd()); } - - - private int lineBreaksMemoizedSerializedSize = -1; - - private byte memoizedIsInitialized = -1; - - - @Override - public final boolean isInitialized() { - - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; + if (!other.lineBreaks_.isEmpty()) { + if (lineBreaks_.isEmpty()) { + lineBreaks_ = other.lineBreaks_; + lineBreaks_.makeImmutable(); + bitField0_ |= 0x00000040; + } else { + ensureLineBreaksIsMutable(); + lineBreaks_.addAll(other.lineBreaks_); } - if (isInitialized == 0) { - return false; - } - - memoizedIsInitialized = 1; - return true; + onChanged(); } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - getSerializedSize(); - if (id_ != 0L) { - output.writeInt64(1, id_); - } - if (page_ != 0L) { - output.writeInt64(2, page_); - } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(searchText_)) { - com.google.protobuf.GeneratedMessage.writeString(output, 3, searchText_); - } - if (numberOnPage_ != 0) { - output.writeInt32(4, numberOnPage_); - } - if (start_ != 0) { - output.writeInt32(5, start_); - } - if (end_ != 0) { - output.writeInt32(6, end_); - } - if (getLineBreaksList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(lineBreaksMemoizedSerializedSize); - } - for (int i = 0; i < lineBreaks_.size(); i++) { - output.writeInt32NoTag(lineBreaks_.getInt(i)); - } - getUnknownFields().writeTo(output); + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - - - @Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; - } - - size = 0; - if (id_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, id_); - } - if (page_ != 0L) { - size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, page_); - } - if (!com.google.protobuf.GeneratedMessage.isStringEmpty(searchText_)) { - size += com.google.protobuf.GeneratedMessage.computeStringSize(3, searchText_); - } - if (numberOnPage_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(4, numberOnPage_); - } - if (start_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(5, start_); - } - if (end_ != 0) { - size += com.google.protobuf.CodedOutputStream.computeInt32Size(6, end_); - } - { - int dataSize = 0; - for (int i = 0; i < lineBreaks_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(lineBreaks_.getInt(i)); - } - size += dataSize; - if (!getLineBreaksList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); - } - lineBreaksMemoizedSerializedSize = dataSize; - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; - } - - - @Override - public boolean equals(final Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof DocumentTextData)) { - return super.equals(obj); - } - DocumentTextData other = (DocumentTextData) obj; - - if (getId() != other.getId()) { - return false; - } - if (getPage() != other.getPage()) { - return false; - } - if (!getSearchText().equals(other.getSearchText())) { - return false; - } - if (getNumberOnPage() != other.getNumberOnPage()) { - return false; - } - if (getStart() != other.getStart()) { - return false; - } - if (getEnd() != other.getEnd()) { - return false; - } - if (!getLineBreaksList().equals(other.getLineBreaksList())) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; - } - - - @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) + com.google.protobuf.Internal.hashLong(getId()); - hash = (37 * hash) + PAGE_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getPage()); - hash = (37 * hash) + SEARCHTEXT_FIELD_NUMBER; - hash = (53 * hash) + getSearchText().hashCode(); - hash = (37 * hash) + NUMBERONPAGE_FIELD_NUMBER; - hash = (53 * hash) + getNumberOnPage(); - hash = (37 * hash) + START_FIELD_NUMBER; - hash = (53 * hash) + getStart(); - hash = (37 * hash) + END_FIELD_NUMBER; - hash = (53 * hash) + getEnd(); - if (getLineBreaksCount() > 0) { - hash = (37 * hash) + LINEBREAKS_FIELD_NUMBER; - hash = (53 * hash) + getLineBreaksList().hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; - } - - - public static DocumentTextData parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentTextData parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentTextData parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentTextData parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentTextData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static DocumentTextData parseFrom(byte[] data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static DocumentTextData parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentTextData parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentTextData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static DocumentTextData parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static DocumentTextData parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static DocumentTextData parseFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(DocumentTextData prototype) { - - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - - @Override - public Builder toBuilder() { - - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - - @Override - protected Builder newBuilderForType(BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - * Protobuf type {@code DocumentTextData} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:DocumentTextData) - DocumentTextDataOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return DocumentTextDataProto.internal_static_DocumentTextData_descriptor; - } - - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return DocumentTextDataProto.internal_static_DocumentTextData_fieldAccessorTable.ensureFieldAccessorsInitialized(DocumentTextData.class, Builder.class); - } - - - // Construct using DocumentTextDataOuterClass.DocumentTextData.newBuilder() - private Builder() { - - } - - - private Builder(BuilderParent parent) { - - super(parent); - - } - - - @Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - id_ = 0L; - page_ = 0L; - searchText_ = ""; - numberOnPage_ = 0; - start_ = 0; - end_ = 0; - lineBreaks_ = emptyIntList(); - return this; - } - - - @Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return DocumentTextDataProto.internal_static_DocumentTextData_descriptor; - } - - - @Override - public DocumentTextData getDefaultInstanceForType() { - - return DocumentTextData.getDefaultInstance(); - } - - - @Override - public DocumentTextData build() { - - DocumentTextData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @Override - public DocumentTextData buildPartial() { - - DocumentTextData result = new DocumentTextData(this); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartial0(DocumentTextData result) { - - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.id_ = id_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - result.page_ = page_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - result.searchText_ = searchText_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - result.numberOnPage_ = numberOnPage_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.start_ = start_; - } - if (((from_bitField0_ & 0x00000020) != 0)) { - result.end_ = end_; - } - if (((from_bitField0_ & 0x00000040) != 0)) { - lineBreaks_.makeImmutable(); - result.lineBreaks_ = lineBreaks_; - } - } - - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof DocumentTextData) { - return mergeFrom((DocumentTextData) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(DocumentTextData other) { - - if (other == DocumentTextData.getDefaultInstance()) { - return this; - } - if (other.getId() != 0L) { - setId(other.getId()); - } - if (other.getPage() != 0L) { - setPage(other.getPage()); - } - if (!other.getSearchText().isEmpty()) { - searchText_ = other.searchText_; - bitField0_ |= 0x00000004; - onChanged(); - } - if (other.getNumberOnPage() != 0) { - setNumberOnPage(other.getNumberOnPage()); - } - if (other.getStart() != 0) { - setStart(other.getStart()); - } - if (other.getEnd() != 0) { - setEnd(other.getEnd()); - } - if (!other.lineBreaks_.isEmpty()) { - if (lineBreaks_.isEmpty()) { - lineBreaks_ = other.lineBreaks_; - lineBreaks_.makeImmutable(); - bitField0_ |= 0x00000040; - } else { - ensureLineBreaksIsMutable(); - lineBreaks_.addAll(other.lineBreaks_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - - @Override - public final boolean isInitialized() { - - return true; - } - - - @Override - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - if (extensionRegistry == null) { - throw new NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - id_ = input.readInt64(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - page_ = input.readInt64(); - bitField0_ |= 0x00000002; - break; - } // case 16 - case 26: { - searchText_ = input.readStringRequireUtf8(); - bitField0_ |= 0x00000004; - break; - } // case 26 - case 32: { - numberOnPage_ = input.readInt32(); - bitField0_ |= 0x00000008; - break; - } // case 32 - case 40: { - start_ = input.readInt32(); - bitField0_ |= 0x00000010; - break; - } // case 40 - case 48: { - end_ = input.readInt32(); - bitField0_ |= 0x00000020; - break; - } // case 48 - case 56: { - int v = input.readInt32(); - ensureLineBreaksIsMutable(); - lineBreaks_.addInt(v); - break; - } // case 56 - case 58: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureLineBreaksIsMutable(); - while (input.getBytesUntilLimit() > 0) { - lineBreaks_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } // case 58 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private long id_; - - - /** - *
-             * Identifier of the text block.
-             * 
- * - * int64 id = 1; - * - * @return The id. - */ - @Override - public long getId() { - - return id_; - } - - - /** - *
-             * Identifier of the text block.
-             * 
- * - * int64 id = 1; - * - * @param value The id to set. - * @return This builder for chaining. - */ - public Builder setId(long value) { - - id_ = value; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + id_ = input.readInt64(); bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - *
-             * Identifier of the text block.
-             * 
- * - * int64 id = 1; - * - * @return This builder for chaining. - */ - public Builder clearId() { - - bitField0_ = (bitField0_ & ~0x00000001); - id_ = 0L; - onChanged(); - return this; - } - - - private long page_; - - - /** - *
-             * The page the text block occurs on.
-             * 
- * - * int64 page = 2; - * - * @return The page. - */ - @Override - public long getPage() { - - return page_; - } - - - /** - *
-             * The page the text block occurs on.
-             * 
- * - * int64 page = 2; - * - * @param value The page to set. - * @return This builder for chaining. - */ - public Builder setPage(long value) { - - page_ = value; + break; + } // case 8 + case 16: { + page_ = input.readInt64(); bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * The page the text block occurs on.
-             * 
- * - * int64 page = 2; - * - * @return This builder for chaining. - */ - public Builder clearPage() { - - bitField0_ = (bitField0_ & ~0x00000002); - page_ = 0L; - onChanged(); - return this; - } - - - private Object searchText_ = ""; - - - /** - *
-             * The text of the text block.
-             * 
- * - * string searchText = 3; - * - * @return The searchText. - */ - public String getSearchText() { - - Object ref = searchText_; - if (!(ref instanceof String)) { - com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; - String s = bs.toStringUtf8(); - searchText_ = s; - return s; - } else { - return (String) ref; - } - } - - - /** - *
-             * The text of the text block.
-             * 
- * - * string searchText = 3; - * - * @return The bytes for searchText. - */ - public com.google.protobuf.ByteString getSearchTextBytes() { - - Object ref = searchText_; - if (ref instanceof String) { - com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((String) ref); - searchText_ = b; - return b; - } else { - return (com.google.protobuf.ByteString) ref; - } - } - - - /** - *
-             * The text of the text block.
-             * 
- * - * string searchText = 3; - * - * @param value The searchText to set. - * @return This builder for chaining. - */ - public Builder setSearchText(String value) { - - if (value == null) { - throw new NullPointerException(); - } - searchText_ = value; + break; + } // case 16 + case 26: { + searchText_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - - /** - *
-             * The text of the text block.
-             * 
- * - * string searchText = 3; - * - * @return This builder for chaining. - */ - public Builder clearSearchText() { - - searchText_ = getDefaultInstance().getSearchText(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - - /** - *
-             * The text of the text block.
-             * 
- * - * string searchText = 3; - * - * @param value The bytes for searchText to set. - * @return This builder for chaining. - */ - public Builder setSearchTextBytes(com.google.protobuf.ByteString value) { - - if (value == null) { - throw new NullPointerException(); - } - checkByteStringIsUtf8(value); - searchText_ = value; - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - - private int numberOnPage_; - - - /** - *
-             * Each text block is assigned a number on a page, starting from 0.
-             * 
- * - * int32 numberOnPage = 4; - * - * @return The numberOnPage. - */ - @Override - public int getNumberOnPage() { - - return numberOnPage_; - } - - - /** - *
-             * Each text block is assigned a number on a page, starting from 0.
-             * 
- * - * int32 numberOnPage = 4; - * - * @param value The numberOnPage to set. - * @return This builder for chaining. - */ - public Builder setNumberOnPage(int value) { - - numberOnPage_ = value; + break; + } // case 26 + case 32: { + numberOnPage_ = input.readInt32(); bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - - /** - *
-             * Each text block is assigned a number on a page, starting from 0.
-             * 
- * - * int32 numberOnPage = 4; - * - * @return This builder for chaining. - */ - public Builder clearNumberOnPage() { - - bitField0_ = (bitField0_ & ~0x00000008); - numberOnPage_ = 0; - onChanged(); - return this; - } - - - private int start_; - - - /** - *
-             * The text blocks are ordered, this number represents the start of the text block as a string offset.
-             * 
- * - * int32 start = 5; - * - * @return The start. - */ - @Override - public int getStart() { - - return start_; - } - - - /** - *
-             * The text blocks are ordered, this number represents the start of the text block as a string offset.
-             * 
- * - * int32 start = 5; - * - * @param value The start to set. - * @return This builder for chaining. - */ - public Builder setStart(int value) { - - start_ = value; + break; + } // case 32 + case 40: { + start_ = input.readInt32(); bitField0_ |= 0x00000010; - onChanged(); - return this; - } - - - /** - *
-             * The text blocks are ordered, this number represents the start of the text block as a string offset.
-             * 
- * - * int32 start = 5; - * - * @return This builder for chaining. - */ - public Builder clearStart() { - - bitField0_ = (bitField0_ & ~0x00000010); - start_ = 0; - onChanged(); - return this; - } - - - private int end_; - - - /** - *
-             * The text blocks are ordered, this number represents the end of the text block as a string offset.
-             * 
- * - * int32 end = 6; - * - * @return The end. - */ - @Override - public int getEnd() { - - return end_; - } - - - /** - *
-             * The text blocks are ordered, this number represents the end of the text block as a string offset.
-             * 
- * - * int32 end = 6; - * - * @param value The end to set. - * @return This builder for chaining. - */ - public Builder setEnd(int value) { - - end_ = value; + break; + } // case 40 + case 48: { + end_ = input.readInt32(); bitField0_ |= 0x00000020; - onChanged(); - return this; - } - - - /** - *
-             * The text blocks are ordered, this number represents the end of the text block as a string offset.
-             * 
- * - * int32 end = 6; - * - * @return This builder for chaining. - */ - public Builder clearEnd() { - - bitField0_ = (bitField0_ & ~0x00000020); - end_ = 0; - onChanged(); - return this; - } - - - private com.google.protobuf.Internal.IntList lineBreaks_ = emptyIntList(); - - - private void ensureLineBreaksIsMutable() { - - if (!lineBreaks_.isModifiable()) { - lineBreaks_ = makeMutableCopy(lineBreaks_); + break; + } // case 48 + case 56: { + int v = input.readInt32(); + ensureLineBreaksIsMutable(); + lineBreaks_.addInt(v); + break; + } // case 56 + case 58: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureLineBreaksIsMutable(); + while (input.getBytesUntilLimit() > 0) { + lineBreaks_.addInt(input.readInt32()); } - bitField0_ |= 0x00000040; - } - - - /** - *
-             * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-             * 
- * - * repeated int32 lineBreaks = 7; - * - * @return A list containing the lineBreaks. - */ - public java.util.List getLineBreaksList() { - - lineBreaks_.makeImmutable(); - return lineBreaks_; - } - - - /** - *
-             * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-             * 
- * - * repeated int32 lineBreaks = 7; - * - * @return The count of lineBreaks. - */ - public int getLineBreaksCount() { - - return lineBreaks_.size(); - } - - - /** - *
-             * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-             * 
- * - * repeated int32 lineBreaks = 7; - * - * @param index The index of the element to return. - * @return The lineBreaks at the given index. - */ - public int getLineBreaks(int index) { - - return lineBreaks_.getInt(index); - } - - - /** - *
-             * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-             * 
- * - * repeated int32 lineBreaks = 7; - * - * @param index The index to set the value at. - * @param value The lineBreaks to set. - * @return This builder for chaining. - */ - public Builder setLineBreaks(int index, int value) { - - ensureLineBreaksIsMutable(); - lineBreaks_.setInt(index, value); - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - - - /** - *
-             * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-             * 
- * - * repeated int32 lineBreaks = 7; - * - * @param value The lineBreaks to add. - * @return This builder for chaining. - */ - public Builder addLineBreaks(int value) { - - ensureLineBreaksIsMutable(); - lineBreaks_.addInt(value); - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - - - /** - *
-             * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-             * 
- * - * repeated int32 lineBreaks = 7; - * - * @param values The lineBreaks to add. - * @return This builder for chaining. - */ - public Builder addAllLineBreaks(Iterable values) { - - ensureLineBreaksIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, lineBreaks_); - bitField0_ |= 0x00000040; - onChanged(); - return this; - } - - - /** - *
-             * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
-             * 
- * - * repeated int32 lineBreaks = 7; - * - * @return This builder for chaining. - */ - public Builder clearLineBreaks() { - - lineBreaks_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000040); - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:DocumentTextData) - } - - // @@protoc_insertion_point(class_scope:DocumentTextData) - private static final DocumentTextData DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new DocumentTextData(); - } - - public static DocumentTextData getDefaultInstance() { - - return DEFAULT_INSTANCE; - } - - - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @Override - public DocumentTextData parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); + input.popLimit(limit); + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag } - return builder.buildPartial(); - } - }; + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + private long id_ ; + /** + *
+       * Identifier of the text block.
+       * 
+ * + * int64 id = 1; + * @return The id. + */ + @java.lang.Override + public long getId() { + return id_; + } + /** + *
+       * Identifier of the text block.
+       * 
+ * + * int64 id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId(long value) { - public static com.google.protobuf.Parser parser() { + id_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * Identifier of the text block.
+       * 
+ * + * int64 id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + bitField0_ = (bitField0_ & ~0x00000001); + id_ = 0L; + onChanged(); + return this; + } - return PARSER; + private long page_ ; + /** + *
+       * The page the text block occurs on.
+       * 
+ * + * int64 page = 2; + * @return The page. + */ + @java.lang.Override + public long getPage() { + return page_; + } + /** + *
+       * The page the text block occurs on.
+       * 
+ * + * int64 page = 2; + * @param value The page to set. + * @return This builder for chaining. + */ + public Builder setPage(long value) { + + page_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * The page the text block occurs on.
+       * 
+ * + * int64 page = 2; + * @return This builder for chaining. + */ + public Builder clearPage() { + bitField0_ = (bitField0_ & ~0x00000002); + page_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object searchText_ = ""; + /** + *
+       * The text of the text block.
+       * 
+ * + * string searchText = 3; + * @return The searchText. + */ + public java.lang.String getSearchText() { + java.lang.Object ref = searchText_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + searchText_ = s; + return s; + } else { + return (java.lang.String) ref; } - - - @Override - public com.google.protobuf.Parser getParserForType() { - - return PARSER; + } + /** + *
+       * The text of the text block.
+       * 
+ * + * string searchText = 3; + * @return The bytes for searchText. + */ + public com.google.protobuf.ByteString + getSearchTextBytes() { + java.lang.Object ref = searchText_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + searchText_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; } + } + /** + *
+       * The text of the text block.
+       * 
+ * + * string searchText = 3; + * @param value The searchText to set. + * @return This builder for chaining. + */ + public Builder setSearchText( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + searchText_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * The text of the text block.
+       * 
+ * + * string searchText = 3; + * @return This builder for chaining. + */ + public Builder clearSearchText() { + searchText_ = getDefaultInstance().getSearchText(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } + /** + *
+       * The text of the text block.
+       * 
+ * + * string searchText = 3; + * @param value The bytes for searchText to set. + * @return This builder for chaining. + */ + public Builder setSearchTextBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + searchText_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + private int numberOnPage_ ; + /** + *
+       * Each text block is assigned a number on a page, starting from 0.
+       * 
+ * + * int32 numberOnPage = 4; + * @return The numberOnPage. + */ + @java.lang.Override + public int getNumberOnPage() { + return numberOnPage_; + } + /** + *
+       * Each text block is assigned a number on a page, starting from 0.
+       * 
+ * + * int32 numberOnPage = 4; + * @param value The numberOnPage to set. + * @return This builder for chaining. + */ + public Builder setNumberOnPage(int value) { - @Override - public DocumentTextData getDefaultInstanceForType() { + numberOnPage_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Each text block is assigned a number on a page, starting from 0.
+       * 
+ * + * int32 numberOnPage = 4; + * @return This builder for chaining. + */ + public Builder clearNumberOnPage() { + bitField0_ = (bitField0_ & ~0x00000008); + numberOnPage_ = 0; + onChanged(); + return this; + } - return DEFAULT_INSTANCE; + private int start_ ; + /** + *
+       * The text blocks are ordered, this number represents the start of the text block as a string offset.
+       * 
+ * + * int32 start = 5; + * @return The start. + */ + @java.lang.Override + public int getStart() { + return start_; + } + /** + *
+       * The text blocks are ordered, this number represents the start of the text block as a string offset.
+       * 
+ * + * int32 start = 5; + * @param value The start to set. + * @return This builder for chaining. + */ + public Builder setStart(int value) { + + start_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + *
+       * The text blocks are ordered, this number represents the start of the text block as a string offset.
+       * 
+ * + * int32 start = 5; + * @return This builder for chaining. + */ + public Builder clearStart() { + bitField0_ = (bitField0_ & ~0x00000010); + start_ = 0; + onChanged(); + return this; + } + + private int end_ ; + /** + *
+       * The text blocks are ordered, this number represents the end of the text block as a string offset.
+       * 
+ * + * int32 end = 6; + * @return The end. + */ + @java.lang.Override + public int getEnd() { + return end_; + } + /** + *
+       * The text blocks are ordered, this number represents the end of the text block as a string offset.
+       * 
+ * + * int32 end = 6; + * @param value The end to set. + * @return This builder for chaining. + */ + public Builder setEnd(int value) { + + end_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + *
+       * The text blocks are ordered, this number represents the end of the text block as a string offset.
+       * 
+ * + * int32 end = 6; + * @return This builder for chaining. + */ + public Builder clearEnd() { + bitField0_ = (bitField0_ & ~0x00000020); + end_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.Internal.IntList lineBreaks_ = emptyIntList(); + private void ensureLineBreaksIsMutable() { + if (!lineBreaks_.isModifiable()) { + lineBreaks_ = makeMutableCopy(lineBreaks_); } + bitField0_ |= 0x00000040; + } + /** + *
+       * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+       * 
+ * + * repeated int32 lineBreaks = 7; + * @return A list containing the lineBreaks. + */ + public java.util.List + getLineBreaksList() { + lineBreaks_.makeImmutable(); + return lineBreaks_; + } + /** + *
+       * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+       * 
+ * + * repeated int32 lineBreaks = 7; + * @return The count of lineBreaks. + */ + public int getLineBreaksCount() { + return lineBreaks_.size(); + } + /** + *
+       * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+       * 
+ * + * repeated int32 lineBreaks = 7; + * @param index The index of the element to return. + * @return The lineBreaks at the given index. + */ + public int getLineBreaks(int index) { + return lineBreaks_.getInt(index); + } + /** + *
+       * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+       * 
+ * + * repeated int32 lineBreaks = 7; + * @param index The index to set the value at. + * @param value The lineBreaks to set. + * @return This builder for chaining. + */ + public Builder setLineBreaks( + int index, int value) { + ensureLineBreaksIsMutable(); + lineBreaks_.setInt(index, value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+       * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+       * 
+ * + * repeated int32 lineBreaks = 7; + * @param value The lineBreaks to add. + * @return This builder for chaining. + */ + public Builder addLineBreaks(int value) { + + ensureLineBreaksIsMutable(); + lineBreaks_.addInt(value); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+       * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+       * 
+ * + * repeated int32 lineBreaks = 7; + * @param values The lineBreaks to add. + * @return This builder for chaining. + */ + public Builder addAllLineBreaks( + java.lang.Iterable values) { + ensureLineBreaksIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, lineBreaks_); + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + *
+       * The line breaks in the text of this semantic node in string offsets. They are exclusive end. At the end of each semantic node there is an implicit linebreak.
+       * 
+ * + * repeated int32 lineBreaks = 7; + * @return This builder for chaining. + */ + public Builder clearLineBreaks() { + lineBreaks_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:DocumentTextData) } - private static final com.google.protobuf.Descriptors.Descriptor internal_static_AllDocumentTextData_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_AllDocumentTextData_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_DocumentTextData_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_DocumentTextData_fieldAccessorTable; - - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - - return descriptor; - } - - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - + // @@protoc_insertion_point(class_scope:DocumentTextData) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData DEFAULT_INSTANCE; static { - String[] descriptorData = {"\n\026DocumentTextData.proto\"B\n\023AllDocumentT" - + "extData\022+\n\020documentTextData\030\001 \003(\0132\021.Docu" - + "mentTextData\"\206\001\n\020DocumentTextData\022\n\n\002id\030" - + "\001 \001(\003\022\014\n\004page\030\002 \001(\003\022\022\n\nsearchText\030\003 \001(\t\022" - + "\024\n\014numberOnPage\030\004 \001(\005\022\r\n\005start\030\005 \001(\005\022\013\n\003" - + "end\030\006 \001(\005\022\022\n\nlineBreaks\030\007 \003(\005b\006proto3"}; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[]{}); - internal_static_AllDocumentTextData_descriptor = getDescriptor().getMessageTypes() - .get(0); - internal_static_AllDocumentTextData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_AllDocumentTextData_descriptor, - new String[]{"DocumentTextData",}); - internal_static_DocumentTextData_descriptor = getDescriptor().getMessageTypes() - .get(1); - internal_static_DocumentTextData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_DocumentTextData_descriptor, - new String[]{"Id", "Page", "SearchText", "NumberOnPage", "Start", "End", "LineBreaks",}); - descriptor.resolveAllFeaturesImmutable(); + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData(); } - // @@protoc_insertion_point(outer_class_scope) + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DocumentTextData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_AllDocumentTextData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_AllDocumentTextData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_DocumentTextData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_DocumentTextData_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\026DocumentTextData.proto\"B\n\023AllDocumentT" + + "extData\022+\n\020documentTextData\030\001 \003(\0132\021.Docu" + + "mentTextData\"\206\001\n\020DocumentTextData\022\n\n\002id\030" + + "\001 \001(\003\022\014\n\004page\030\002 \001(\003\022\022\n\nsearchText\030\003 \001(\t\022" + + "\024\n\014numberOnPage\030\004 \001(\005\022\r\n\005start\030\005 \001(\005\022\013\n\003" + + "end\030\006 \001(\005\022\022\n\nlineBreaks\030\007 \003(\005B_\nFcom.kne" + + "con.fforesight.service.layoutparser.inte" + + "rnal.api.data.redactionB\025DocumentTextDat" + + "aProtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_AllDocumentTextData_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_AllDocumentTextData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_AllDocumentTextData_descriptor, + new java.lang.String[] { "DocumentTextData", }); + internal_static_DocumentTextData_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_DocumentTextData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_DocumentTextData_descriptor, + new java.lang.String[] { "Id", "Page", "SearchText", "NumberOnPage", "Start", "End", "LineBreaks", }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/EntryDataProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/EntryDataProto.java index f7fabe2..38b657e 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/EntryDataProto.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/EntryDataProto.java @@ -1,2977 +1,2557 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: EntryData.proto -// Protobuf Java Version: 4.27.1 -@SuppressWarnings("all") +// Protobuf Java Version: 4.28.3 + +package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; + public final class EntryDataProto { + private EntryDataProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + EntryDataProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private EntryDataProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface EntryDataOrBuilder extends + // @@protoc_insertion_point(interface_extends:EntryData) + com.google.protobuf.MessageOrBuilder { + /** + *
+     * Type of the semantic node.
+     * 
+ * + * .NodeType type = 1; + * @return The enum numeric value on the wire for type. + */ + int getTypeValue(); + /** + *
+     * Type of the semantic node.
+     * 
+ * + * .NodeType type = 1; + * @return The type. + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType getType(); - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", EntryDataProto.class.getName()); - } + /** + *
+     * Specifies the position in the parsed tree structure.
+     * 
+ * + * repeated int32 treeId = 2; + * @return A list containing the treeId. + */ + java.util.List getTreeIdList(); + /** + *
+     * Specifies the position in the parsed tree structure.
+     * 
+ * + * repeated int32 treeId = 2; + * @return The count of treeId. + */ + int getTreeIdCount(); + /** + *
+     * Specifies the position in the parsed tree structure.
+     * 
+ * + * repeated int32 treeId = 2; + * @param index The index of the element to return. + * @return The treeId at the given index. + */ + int getTreeId(int index); - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + /** + *
+     * Specifies the text block IDs associated with this semantic node.
+     * 
+ * + * repeated int64 atomicBlockIds = 3; + * @return A list containing the atomicBlockIds. + */ + java.util.List getAtomicBlockIdsList(); + /** + *
+     * Specifies the text block IDs associated with this semantic node.
+     * 
+ * + * repeated int64 atomicBlockIds = 3; + * @return The count of atomicBlockIds. + */ + int getAtomicBlockIdsCount(); + /** + *
+     * Specifies the text block IDs associated with this semantic node.
+     * 
+ * + * repeated int64 atomicBlockIds = 3; + * @param index The index of the element to return. + * @return The atomicBlockIds at the given index. + */ + long getAtomicBlockIds(int index); - } + /** + *
+     * Specifies the pages this semantic node appears on.
+     * 
+ * + * repeated int64 pageNumbers = 4; + * @return A list containing the pageNumbers. + */ + java.util.List getPageNumbersList(); + /** + *
+     * Specifies the pages this semantic node appears on.
+     * 
+ * + * repeated int64 pageNumbers = 4; + * @return The count of pageNumbers. + */ + int getPageNumbersCount(); + /** + *
+     * Specifies the pages this semantic node appears on.
+     * 
+ * + * repeated int64 pageNumbers = 4; + * @param index The index of the element to return. + * @return The pageNumbers at the given index. + */ + long getPageNumbers(int index); - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - - public interface EntryDataOrBuilder extends - // @@protoc_insertion_point(interface_extends:EntryData) - com.google.protobuf.MessageOrBuilder { - - /** - *
-         * Type of the semantic node.
-         * 
- * - * .NodeType type = 1; - * - * @return The enum numeric value on the wire for type. - */ - int getTypeValue(); - - - /** - *
-         * Type of the semantic node.
-         * 
- * - * .NodeType type = 1; - * - * @return The type. - */ - NodeTypeProto.NodeType getType(); - - - /** - *
-         * Specifies the position in the parsed tree structure.
-         * 
- * - * repeated int32 treeId = 2; - * - * @return A list containing the treeId. - */ - java.util.List getTreeIdList(); - - - /** - *
-         * Specifies the position in the parsed tree structure.
-         * 
- * - * repeated int32 treeId = 2; - * - * @return The count of treeId. - */ - int getTreeIdCount(); - - - /** - *
-         * Specifies the position in the parsed tree structure.
-         * 
- * - * repeated int32 treeId = 2; - * - * @param index The index of the element to return. - * @return The treeId at the given index. - */ - int getTreeId(int index); - - - /** - *
-         * Specifies the text block IDs associated with this semantic node.
-         * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @return A list containing the atomicBlockIds. - */ - java.util.List getAtomicBlockIdsList(); - - - /** - *
-         * Specifies the text block IDs associated with this semantic node.
-         * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @return The count of atomicBlockIds. - */ - int getAtomicBlockIdsCount(); - - - /** - *
-         * Specifies the text block IDs associated with this semantic node.
-         * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @param index The index of the element to return. - * @return The atomicBlockIds at the given index. - */ - long getAtomicBlockIds(int index); - - - /** - *
-         * Specifies the pages this semantic node appears on.
-         * 
- * - * repeated int64 pageNumbers = 4; - * - * @return A list containing the pageNumbers. - */ - java.util.List getPageNumbersList(); - - - /** - *
-         * Specifies the pages this semantic node appears on.
-         * 
- * - * repeated int64 pageNumbers = 4; - * - * @return The count of pageNumbers. - */ - int getPageNumbersCount(); - - - /** - *
-         * Specifies the pages this semantic node appears on.
-         * 
- * - * repeated int64 pageNumbers = 4; - * - * @param index The index of the element to return. - * @return The pageNumbers at the given index. - */ - long getPageNumbers(int index); - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - int getPropertiesCount(); - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - boolean containsProperties(String key); - - - /** - * Use {@link #getPropertiesMap()} instead. - */ - @Deprecated - java.util.Map getProperties(); - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - java.util.Map getPropertiesMap(); - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + int getPropertiesCount(); + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + boolean containsProperties( + java.lang.String key); + /** + * Use {@link #getPropertiesMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getProperties(); + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + java.util.Map + getPropertiesMap(); + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + /* nullable */ +java.lang.String getPropertiesOrDefault( + java.lang.String key, /* nullable */ - String getPropertiesOrDefault(String key, - /* nullable */ - String defaultValue); +java.lang.String defaultValue); + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + java.lang.String getPropertiesOrThrow( + java.lang.String key); + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + java.util.List + getChildrenList(); + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getChildren(int index); + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + int getChildrenCount(); + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + java.util.List + getChildrenOrBuilderList(); + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder getChildrenOrBuilder( + int index); - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - String getPropertiesOrThrow(String key); - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - java.util.List getChildrenList(); - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - EntryData getChildren(int index); - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - int getChildrenCount(); - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - java.util.List getChildrenOrBuilderList(); - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - EntryDataOrBuilder getChildrenOrBuilder(int index); - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return A list containing the engines. - */ - java.util.List getEnginesList(); - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return The count of engines. - */ - int getEnginesCount(); - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index of the element to return. - * @return The engines at the given index. - */ - LayoutEngineProto.LayoutEngine getEngines(int index); - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return A list containing the enum numeric values on the wire for engines. - */ - java.util.List getEnginesValueList(); - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index of the value to return. - * @return The enum numeric value on the wire of engines at the given index. - */ - int getEnginesValue(int index); - + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @return A list containing the engines. + */ + java.util.List getEnginesList(); + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @return The count of engines. + */ + int getEnginesCount(); + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index of the element to return. + * @return The engines at the given index. + */ + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine getEngines(int index); + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @return A list containing the enum numeric values on the wire for engines. + */ + java.util.List + getEnginesValueList(); + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of engines at the given index. + */ + int getEnginesValue(int index); + } + /** + * Protobuf type {@code EntryData} + */ + public static final class EntryData extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:EntryData) + EntryDataOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + EntryData.class.getName()); + } + // Use EntryData.newBuilder() to construct. + private EntryData(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private EntryData() { + type_ = 0; + treeId_ = emptyIntList(); + atomicBlockIds_ = emptyLongList(); + pageNumbers_ = emptyLongList(); + children_ = java.util.Collections.emptyList(); + engines_ = emptyIntList(); } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetProperties(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder.class); + } + + public static final int TYPE_FIELD_NUMBER = 1; + private int type_ = 0; + /** + *
+     * Type of the semantic node.
+     * 
+ * + * .NodeType type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
+     * Type of the semantic node.
+     * 
+ * + * .NodeType type = 1; + * @return The type. + */ + @java.lang.Override public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType getType() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType result = com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.forNumber(type_); + return result == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.UNRECOGNIZED : result; + } + + public static final int TREEID_FIELD_NUMBER = 2; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList treeId_ = + emptyIntList(); + /** + *
+     * Specifies the position in the parsed tree structure.
+     * 
+ * + * repeated int32 treeId = 2; + * @return A list containing the treeId. + */ + @java.lang.Override + public java.util.List + getTreeIdList() { + return treeId_; + } + /** + *
+     * Specifies the position in the parsed tree structure.
+     * 
+ * + * repeated int32 treeId = 2; + * @return The count of treeId. + */ + public int getTreeIdCount() { + return treeId_.size(); + } + /** + *
+     * Specifies the position in the parsed tree structure.
+     * 
+ * + * repeated int32 treeId = 2; + * @param index The index of the element to return. + * @return The treeId at the given index. + */ + public int getTreeId(int index) { + return treeId_.getInt(index); + } + private int treeIdMemoizedSerializedSize = -1; + + public static final int ATOMICBLOCKIDS_FIELD_NUMBER = 3; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList atomicBlockIds_ = + emptyLongList(); + /** + *
+     * Specifies the text block IDs associated with this semantic node.
+     * 
+ * + * repeated int64 atomicBlockIds = 3; + * @return A list containing the atomicBlockIds. + */ + @java.lang.Override + public java.util.List + getAtomicBlockIdsList() { + return atomicBlockIds_; + } + /** + *
+     * Specifies the text block IDs associated with this semantic node.
+     * 
+ * + * repeated int64 atomicBlockIds = 3; + * @return The count of atomicBlockIds. + */ + public int getAtomicBlockIdsCount() { + return atomicBlockIds_.size(); + } + /** + *
+     * Specifies the text block IDs associated with this semantic node.
+     * 
+ * + * repeated int64 atomicBlockIds = 3; + * @param index The index of the element to return. + * @return The atomicBlockIds at the given index. + */ + public long getAtomicBlockIds(int index) { + return atomicBlockIds_.getLong(index); + } + private int atomicBlockIdsMemoizedSerializedSize = -1; + + public static final int PAGENUMBERS_FIELD_NUMBER = 4; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.LongList pageNumbers_ = + emptyLongList(); + /** + *
+     * Specifies the pages this semantic node appears on.
+     * 
+ * + * repeated int64 pageNumbers = 4; + * @return A list containing the pageNumbers. + */ + @java.lang.Override + public java.util.List + getPageNumbersList() { + return pageNumbers_; + } + /** + *
+     * Specifies the pages this semantic node appears on.
+     * 
+ * + * repeated int64 pageNumbers = 4; + * @return The count of pageNumbers. + */ + public int getPageNumbersCount() { + return pageNumbers_.size(); + } + /** + *
+     * Specifies the pages this semantic node appears on.
+     * 
+ * + * repeated int64 pageNumbers = 4; + * @param index The index of the element to return. + * @return The pageNumbers at the given index. + */ + public long getPageNumbers(int index) { + return pageNumbers_.getLong(index); + } + private int pageNumbersMemoizedSerializedSize = -1; + + public static final int PROPERTIES_FIELD_NUMBER = 5; + private static final class PropertiesDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_PropertiesEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> properties_; + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PropertiesDefaultEntryHolder.defaultEntry); + } + return properties_; + } + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public boolean containsProperties( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetProperties().getMap().containsKey(key); + } + /** + * Use {@link #getPropertiesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public java.util.Map getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getPropertiesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * Some semantic nodes have additional information, this information is stored in this Map.
+     * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public java.lang.String getPropertiesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int CHILDREN_FIELD_NUMBER = 6; + @SuppressWarnings("serial") + private java.util.List children_; + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + @java.lang.Override + public java.util.List getChildrenList() { + return children_; + } + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + @java.lang.Override + public java.util.List + getChildrenOrBuilderList() { + return children_; + } + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + @java.lang.Override + public int getChildrenCount() { + return children_.size(); + } + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getChildren(int index) { + return children_.get(index); + } + /** + *
+     * All child Entries of this Entry.
+     * 
+ * + * repeated .EntryData children = 6; + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder getChildrenOrBuilder( + int index) { + return children_.get(index); + } + + public static final int ENGINES_FIELD_NUMBER = 7; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList engines_; + private static final com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine> engines_converter_ = + new com.google.protobuf.Internal.IntListAdapter.IntConverter< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine>() { + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine convert(int from) { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine result = com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine.forNumber(from); + return result == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine.UNRECOGNIZED : result; + } + }; + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @return A list containing the engines. + */ + @java.lang.Override + public java.util.List getEnginesList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine>(engines_, engines_converter_); + } + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @return The count of engines. + */ + @java.lang.Override + public int getEnginesCount() { + return engines_.size(); + } + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index of the element to return. + * @return The engines at the given index. + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine getEngines(int index) { + return engines_converter_.convert(engines_.getInt(index)); + } + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @return A list containing the enum numeric values on the wire for engines. + */ + @java.lang.Override + public java.util.List + getEnginesValueList() { + return engines_; + } + /** + *
+     * Describes the origin of the semantic node.
+     * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of engines at the given index. + */ + @java.lang.Override + public int getEnginesValue(int index) { + return engines_.getInt(index); + } + private int enginesMemoizedSerializedSize; + + 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 { + getSerializedSize(); + if (type_ != com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.DOCUMENT.getNumber()) { + output.writeEnum(1, type_); + } + if (getTreeIdList().size() > 0) { + output.writeUInt32NoTag(18); + output.writeUInt32NoTag(treeIdMemoizedSerializedSize); + } + for (int i = 0; i < treeId_.size(); i++) { + output.writeInt32NoTag(treeId_.getInt(i)); + } + if (getAtomicBlockIdsList().size() > 0) { + output.writeUInt32NoTag(26); + output.writeUInt32NoTag(atomicBlockIdsMemoizedSerializedSize); + } + for (int i = 0; i < atomicBlockIds_.size(); i++) { + output.writeInt64NoTag(atomicBlockIds_.getLong(i)); + } + if (getPageNumbersList().size() > 0) { + output.writeUInt32NoTag(34); + output.writeUInt32NoTag(pageNumbersMemoizedSerializedSize); + } + for (int i = 0; i < pageNumbers_.size(); i++) { + output.writeInt64NoTag(pageNumbers_.getLong(i)); + } + com.google.protobuf.GeneratedMessage + .serializeStringMapTo( + output, + internalGetProperties(), + PropertiesDefaultEntryHolder.defaultEntry, + 5); + for (int i = 0; i < children_.size(); i++) { + output.writeMessage(6, children_.get(i)); + } + if (getEnginesList().size() > 0) { + output.writeUInt32NoTag(58); + output.writeUInt32NoTag(enginesMemoizedSerializedSize); + } + for (int i = 0; i < engines_.size(); i++) { + output.writeEnumNoTag(engines_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (type_ != com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.DOCUMENT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, type_); + } + { + int dataSize = 0; + for (int i = 0; i < treeId_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(treeId_.getInt(i)); + } + size += dataSize; + if (!getTreeIdList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + treeIdMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < atomicBlockIds_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(atomicBlockIds_.getLong(i)); + } + size += dataSize; + if (!getAtomicBlockIdsList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + atomicBlockIdsMemoizedSerializedSize = dataSize; + } + { + int dataSize = 0; + for (int i = 0; i < pageNumbers_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt64SizeNoTag(pageNumbers_.getLong(i)); + } + size += dataSize; + if (!getPageNumbersList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + pageNumbersMemoizedSerializedSize = dataSize; + } + for (java.util.Map.Entry entry + : internalGetProperties().getMap().entrySet()) { + com.google.protobuf.MapEntry + properties__ = PropertiesDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, properties__); + } + for (int i = 0; i < children_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, children_.get(i)); + } + { + int dataSize = 0; + for (int i = 0; i < engines_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeEnumSizeNoTag(engines_.getInt(i)); + } + size += dataSize; + if (!getEnginesList().isEmpty()) { size += 1; + size += com.google.protobuf.CodedOutputStream + .computeUInt32SizeNoTag(dataSize); + }enginesMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData)) { + return super.equals(obj); + } + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData other = (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData) obj; + + if (type_ != other.type_) return false; + if (!getTreeIdList() + .equals(other.getTreeIdList())) return false; + if (!getAtomicBlockIdsList() + .equals(other.getAtomicBlockIdsList())) return false; + if (!getPageNumbersList() + .equals(other.getPageNumbersList())) return false; + if (!internalGetProperties().equals( + other.internalGetProperties())) return false; + if (!getChildrenList() + .equals(other.getChildrenList())) return false; + if (!engines_.equals(other.engines_)) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) 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) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + type_; + if (getTreeIdCount() > 0) { + hash = (37 * hash) + TREEID_FIELD_NUMBER; + hash = (53 * hash) + getTreeIdList().hashCode(); + } + if (getAtomicBlockIdsCount() > 0) { + hash = (37 * hash) + ATOMICBLOCKIDS_FIELD_NUMBER; + hash = (53 * hash) + getAtomicBlockIdsList().hashCode(); + } + if (getPageNumbersCount() > 0) { + hash = (37 * hash) + PAGENUMBERS_FIELD_NUMBER; + hash = (53 * hash) + getPageNumbersList().hashCode(); + } + if (!internalGetProperties().getMap().isEmpty()) { + hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; + hash = (53 * hash) + internalGetProperties().hashCode(); + } + if (getChildrenCount() > 0) { + hash = (37 * hash) + CHILDREN_FIELD_NUMBER; + hash = (53 * hash) + getChildrenList().hashCode(); + } + if (getEnginesCount() > 0) { + hash = (37 * hash) + ENGINES_FIELD_NUMBER; + hash = (53 * hash) + engines_.hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } /** * Protobuf type {@code EntryData} */ - public static class EntryData extends com.google.protobuf.GeneratedMessage implements - // @@protoc_insertion_point(message_implements:EntryData) - EntryDataOrBuilder { + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:EntryData) + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_descriptor; + } - private static final long serialVersionUID = 0L; - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", EntryData.class.getName()); + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetProperties(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); } - - // Use EntryData.newBuilder() to construct. - private EntryData(com.google.protobuf.GeneratedMessage.Builder builder) { - - super(builder); + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 5: + return internalGetMutableProperties(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.class, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder.class); + } + // Construct using com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.newBuilder() + private Builder() { - private EntryData() { + } - type_ = 0; - treeId_ = emptyIntList(); - atomicBlockIds_ = emptyLongList(); - pageNumbers_ = emptyLongList(); - children_ = java.util.Collections.emptyList(); - engines_ = java.util.Collections.emptyList(); + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + type_ = 0; + treeId_ = emptyIntList(); + atomicBlockIds_ = emptyLongList(); + pageNumbers_ = emptyLongList(); + internalGetMutableProperties().clear(); + if (childrenBuilder_ == null) { + children_ = java.util.Collections.emptyList(); + } else { + children_ = null; + childrenBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00000020); + engines_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000040); + return this; + } + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.internal_static_EntryData_descriptor; + } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getDefaultInstanceForType() { + return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance(); + } - return EntryDataProto.internal_static_EntryData_descriptor; + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData build() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); } - - - @SuppressWarnings({"rawtypes"}) - @Override - protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { - - switch (number) { - case 5: - return internalGetProperties(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return EntryDataProto.internal_static_EntryData_fieldAccessorTable.ensureFieldAccessorsInitialized(EntryData.class, Builder.class); - } - - - public static final int TYPE_FIELD_NUMBER = 1; - private int type_ = 0; - - - /** - *
-         * Type of the semantic node.
-         * 
- * - * .NodeType type = 1; - * - * @return The enum numeric value on the wire for type. - */ - @Override - public int getTypeValue() { - - return type_; - } - - - /** - *
-         * Type of the semantic node.
-         * 
- * - * .NodeType type = 1; - * - * @return The type. - */ - @Override - public NodeTypeProto.NodeType getType() { - - NodeTypeProto.NodeType result = NodeTypeProto.NodeType.forNumber(type_); - return result == null ? NodeTypeProto.NodeType.UNRECOGNIZED : result; - } - - - public static final int TREEID_FIELD_NUMBER = 2; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.IntList treeId_ = emptyIntList(); - - - /** - *
-         * Specifies the position in the parsed tree structure.
-         * 
- * - * repeated int32 treeId = 2; - * - * @return A list containing the treeId. - */ - @Override - public java.util.List getTreeIdList() { - - return treeId_; - } - - - /** - *
-         * Specifies the position in the parsed tree structure.
-         * 
- * - * repeated int32 treeId = 2; - * - * @return The count of treeId. - */ - public int getTreeIdCount() { - - return treeId_.size(); - } - - - /** - *
-         * Specifies the position in the parsed tree structure.
-         * 
- * - * repeated int32 treeId = 2; - * - * @param index The index of the element to return. - * @return The treeId at the given index. - */ - public int getTreeId(int index) { - - return treeId_.getInt(index); - } - - - private int treeIdMemoizedSerializedSize = -1; - - public static final int ATOMICBLOCKIDS_FIELD_NUMBER = 3; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.LongList atomicBlockIds_ = emptyLongList(); - - - /** - *
-         * Specifies the text block IDs associated with this semantic node.
-         * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @return A list containing the atomicBlockIds. - */ - @Override - public java.util.List getAtomicBlockIdsList() { - - return atomicBlockIds_; - } - - - /** - *
-         * Specifies the text block IDs associated with this semantic node.
-         * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @return The count of atomicBlockIds. - */ - public int getAtomicBlockIdsCount() { - - return atomicBlockIds_.size(); - } - - - /** - *
-         * Specifies the text block IDs associated with this semantic node.
-         * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @param index The index of the element to return. - * @return The atomicBlockIds at the given index. - */ - public long getAtomicBlockIds(int index) { - - return atomicBlockIds_.getLong(index); - } - - - private int atomicBlockIdsMemoizedSerializedSize = -1; - - public static final int PAGENUMBERS_FIELD_NUMBER = 4; - @SuppressWarnings("serial") - private com.google.protobuf.Internal.LongList pageNumbers_ = emptyLongList(); - - - /** - *
-         * Specifies the pages this semantic node appears on.
-         * 
- * - * repeated int64 pageNumbers = 4; - * - * @return A list containing the pageNumbers. - */ - @Override - public java.util.List getPageNumbersList() { - - return pageNumbers_; - } - - - /** - *
-         * Specifies the pages this semantic node appears on.
-         * 
- * - * repeated int64 pageNumbers = 4; - * - * @return The count of pageNumbers. - */ - public int getPageNumbersCount() { - - return pageNumbers_.size(); - } - - - /** - *
-         * Specifies the pages this semantic node appears on.
-         * 
- * - * repeated int64 pageNumbers = 4; - * - * @param index The index of the element to return. - * @return The pageNumbers at the given index. - */ - public long getPageNumbers(int index) { - - return pageNumbers_.getLong(index); - } - - - private int pageNumbersMemoizedSerializedSize = -1; - - public static final int PROPERTIES_FIELD_NUMBER = 5; - - private static final class PropertiesDefaultEntryHolder { - - static final com.google.protobuf.MapEntry defaultEntry = com.google.protobuf.MapEntry.newDefaultInstance(EntryDataProto.internal_static_EntryData_PropertiesEntry_descriptor, - com.google.protobuf.WireFormat.FieldType.STRING, - "", - com.google.protobuf.WireFormat.FieldType.STRING, - ""); - - } - - @SuppressWarnings("serial") - private com.google.protobuf.MapField properties_; - - - private com.google.protobuf.MapField internalGetProperties() { - - if (properties_ == null) { - return com.google.protobuf.MapField.emptyMapField(PropertiesDefaultEntryHolder.defaultEntry); - } - return properties_; - } - - - public int getPropertiesCount() { - - return internalGetProperties().getMap().size(); - } - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - @Override - public boolean containsProperties(String key) { - - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetProperties().getMap().containsKey(key); - } - - - /** - * Use {@link #getPropertiesMap()} instead. - */ - @Override - @Deprecated - public java.util.Map getProperties() { - - return getPropertiesMap(); - } - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - @Override - public java.util.Map getPropertiesMap() { - - return internalGetProperties().getMap(); - } - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - @Override - public /* nullable */ - String getPropertiesOrDefault(String key, - /* nullable */ - String defaultValue) { - - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - - - /** - *
-         * Some semantic nodes have additional information, this information is stored in this Map.
-         * 
- * - * map<string, string> properties = 5; - */ - @Override - public String getPropertiesOrThrow(String key) { - - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetProperties().getMap(); - if (!map.containsKey(key)) { - throw new IllegalArgumentException(); - } - return map.get(key); - } - - - public static final int CHILDREN_FIELD_NUMBER = 6; - @SuppressWarnings("serial") - private java.util.List children_; - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - @Override - public java.util.List getChildrenList() { - - return children_; - } - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - @Override - public java.util.List getChildrenOrBuilderList() { - - return children_; - } - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - @Override - public int getChildrenCount() { - - return children_.size(); - } - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - @Override - public EntryData getChildren(int index) { - - return children_.get(index); - } - - - /** - *
-         * All child Entries of this Entry.
-         * 
- * - * repeated .EntryData children = 6; - */ - @Override - public EntryDataOrBuilder getChildrenOrBuilder(int index) { - - return children_.get(index); - } - - - public static final int ENGINES_FIELD_NUMBER = 7; - @SuppressWarnings("serial") - private java.util.List engines_; - private static final com.google.protobuf.Internal.ListAdapter.Converter engines_converter_ = new com.google.protobuf.Internal.ListAdapter.Converter() { - public LayoutEngineProto.LayoutEngine convert(Integer from) { - - LayoutEngineProto.LayoutEngine result = LayoutEngineProto.LayoutEngine.forNumber(from); - return result == null ? LayoutEngineProto.LayoutEngine.UNRECOGNIZED : result; - } - }; - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return A list containing the engines. - */ - @Override - public java.util.List getEnginesList() { - - return new com.google.protobuf.Internal.ListAdapter(engines_, engines_converter_); - } - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return The count of engines. - */ - @Override - public int getEnginesCount() { - - return engines_.size(); - } - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index of the element to return. - * @return The engines at the given index. - */ - @Override - public LayoutEngineProto.LayoutEngine getEngines(int index) { - - return engines_converter_.convert(engines_.get(index)); - } - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return A list containing the enum numeric values on the wire for engines. - */ - @Override - public java.util.List getEnginesValueList() { - - return engines_; - } - - - /** - *
-         * Describes the origin of the semantic node.
-         * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index of the value to return. - * @return The enum numeric value on the wire of engines at the given index. - */ - @Override - public int getEnginesValue(int index) { - - return engines_.get(index); - } - - - private int enginesMemoizedSerializedSize; - - private byte memoizedIsInitialized = -1; - - - @Override - public final boolean isInitialized() { - - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) { - return true; + return result; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData buildPartial() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData result = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData result) { + if (childrenBuilder_ == null) { + if (((bitField0_ & 0x00000020) != 0)) { + children_ = java.util.Collections.unmodifiableList(children_); + bitField0_ = (bitField0_ & ~0x00000020); } - if (isInitialized == 0) { - return false; + result.children_ = children_; + } else { + result.children_ = childrenBuilder_.build(); + } + if (((bitField0_ & 0x00000040) != 0)) { + engines_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.engines_ = engines_; + } + + private void buildPartial0(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.type_ = type_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + treeId_.makeImmutable(); + result.treeId_ = treeId_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + atomicBlockIds_.makeImmutable(); + result.atomicBlockIds_ = atomicBlockIds_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + pageNumbers_.makeImmutable(); + result.pageNumbers_ = pageNumbers_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.properties_ = internalGetProperties(); + result.properties_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData) { + return mergeFrom((com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData other) { + if (other == com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance()) return this; + if (other.type_ != 0) { + setTypeValue(other.getTypeValue()); + } + if (!other.treeId_.isEmpty()) { + if (treeId_.isEmpty()) { + treeId_ = other.treeId_; + treeId_.makeImmutable(); + bitField0_ |= 0x00000002; + } else { + ensureTreeIdIsMutable(); + treeId_.addAll(other.treeId_); } - - memoizedIsInitialized = 1; - return true; + onChanged(); } - - - @Override - public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - - getSerializedSize(); - if (type_ != NodeTypeProto.NodeType.DOCUMENT.getNumber()) { - output.writeEnum(1, type_); - } - if (getTreeIdList().size() > 0) { - output.writeUInt32NoTag(18); - output.writeUInt32NoTag(treeIdMemoizedSerializedSize); - } - for (int i = 0; i < treeId_.size(); i++) { - output.writeInt32NoTag(treeId_.getInt(i)); - } - if (getAtomicBlockIdsList().size() > 0) { - output.writeUInt32NoTag(26); - output.writeUInt32NoTag(atomicBlockIdsMemoizedSerializedSize); - } - for (int i = 0; i < atomicBlockIds_.size(); i++) { - output.writeInt64NoTag(atomicBlockIds_.getLong(i)); - } - if (getPageNumbersList().size() > 0) { - output.writeUInt32NoTag(34); - output.writeUInt32NoTag(pageNumbersMemoizedSerializedSize); - } - for (int i = 0; i < pageNumbers_.size(); i++) { - output.writeInt64NoTag(pageNumbers_.getLong(i)); - } - com.google.protobuf.GeneratedMessage.serializeStringMapTo(output, internalGetProperties(), PropertiesDefaultEntryHolder.defaultEntry, 5); - for (int i = 0; i < children_.size(); i++) { - output.writeMessage(6, children_.get(i)); - } - if (getEnginesList().size() > 0) { - output.writeUInt32NoTag(58); - output.writeUInt32NoTag(enginesMemoizedSerializedSize); - } - for (int i = 0; i < engines_.size(); i++) { - output.writeEnumNoTag(engines_.get(i)); - } - getUnknownFields().writeTo(output); - } - - - @Override - public int getSerializedSize() { - - int size = memoizedSize; - if (size != -1) { - return size; + if (!other.atomicBlockIds_.isEmpty()) { + if (atomicBlockIds_.isEmpty()) { + atomicBlockIds_ = other.atomicBlockIds_; + atomicBlockIds_.makeImmutable(); + bitField0_ |= 0x00000004; + } else { + ensureAtomicBlockIdsIsMutable(); + atomicBlockIds_.addAll(other.atomicBlockIds_); } - - size = 0; - if (type_ != NodeTypeProto.NodeType.DOCUMENT.getNumber()) { - size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_); - } - { - int dataSize = 0; - for (int i = 0; i < treeId_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(treeId_.getInt(i)); - } - size += dataSize; - if (!getTreeIdList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); - } - treeIdMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < atomicBlockIds_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(atomicBlockIds_.getLong(i)); - } - size += dataSize; - if (!getAtomicBlockIdsList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); - } - atomicBlockIdsMemoizedSerializedSize = dataSize; - } - { - int dataSize = 0; - for (int i = 0; i < pageNumbers_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeInt64SizeNoTag(pageNumbers_.getLong(i)); - } - size += dataSize; - if (!getPageNumbersList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(dataSize); - } - pageNumbersMemoizedSerializedSize = dataSize; - } - for (java.util.Map.Entry entry : internalGetProperties().getMap().entrySet()) { - com.google.protobuf.MapEntry properties__ = PropertiesDefaultEntryHolder.defaultEntry.newBuilderForType() - .setKey(entry.getKey()) - .setValue(entry.getValue()) - .build(); - size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, properties__); - } - for (int i = 0; i < children_.size(); i++) { - size += com.google.protobuf.CodedOutputStream.computeMessageSize(6, children_.get(i)); - } - { - int dataSize = 0; - for (int i = 0; i < engines_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeEnumSizeNoTag(engines_.get(i)); - } - size += dataSize; - if (!getEnginesList().isEmpty()) { - size += 1; - size += com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(dataSize); - } - enginesMemoizedSerializedSize = dataSize; - } - size += getUnknownFields().getSerializedSize(); - memoizedSize = size; - return size; + onChanged(); } - - - @Override - public boolean equals(final Object obj) { - - if (obj == this) { - return true; - } - if (!(obj instanceof EntryData)) { - return super.equals(obj); - } - EntryData other = (EntryData) obj; - - if (type_ != other.type_) { - return false; + if (!other.pageNumbers_.isEmpty()) { + if (pageNumbers_.isEmpty()) { + pageNumbers_ = other.pageNumbers_; + pageNumbers_.makeImmutable(); + bitField0_ |= 0x00000008; + } else { + ensurePageNumbersIsMutable(); + pageNumbers_.addAll(other.pageNumbers_); } - if (!getTreeIdList().equals(other.getTreeIdList())) { - return false; + onChanged(); + } + internalGetMutableProperties().mergeFrom( + other.internalGetProperties()); + bitField0_ |= 0x00000010; + if (childrenBuilder_ == null) { + if (!other.children_.isEmpty()) { + if (children_.isEmpty()) { + children_ = other.children_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureChildrenIsMutable(); + children_.addAll(other.children_); + } + onChanged(); } - if (!getAtomicBlockIdsList().equals(other.getAtomicBlockIdsList())) { - return false; + } else { + if (!other.children_.isEmpty()) { + if (childrenBuilder_.isEmpty()) { + childrenBuilder_.dispose(); + childrenBuilder_ = null; + children_ = other.children_; + bitField0_ = (bitField0_ & ~0x00000020); + childrenBuilder_ = + com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? + getChildrenFieldBuilder() : null; + } else { + childrenBuilder_.addAllMessages(other.children_); + } } - if (!getPageNumbersList().equals(other.getPageNumbersList())) { - return false; + } + if (!other.engines_.isEmpty()) { + if (engines_.isEmpty()) { + engines_ = other.engines_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureEnginesIsMutable(); + engines_.addAll(other.engines_); } - if (!internalGetProperties().equals(other.internalGetProperties())) { - return false; - } - if (!getChildrenList().equals(other.getChildrenList())) { - return false; - } - if (!engines_.equals(other.engines_)) { - return false; - } - if (!getUnknownFields().equals(other.getUnknownFields())) { - return false; - } - return true; + onChanged(); } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + @java.lang.Override + public final boolean isInitialized() { + return true; + } - @Override - public int hashCode() { - - if (memoizedHashCode != 0) { - return memoizedHashCode; - } - int hash = 41; - hash = (19 * hash) + getDescriptor().hashCode(); - hash = (37 * hash) + TYPE_FIELD_NUMBER; - hash = (53 * hash) + type_; - if (getTreeIdCount() > 0) { - hash = (37 * hash) + TREEID_FIELD_NUMBER; - hash = (53 * hash) + getTreeIdList().hashCode(); - } - if (getAtomicBlockIdsCount() > 0) { - hash = (37 * hash) + ATOMICBLOCKIDS_FIELD_NUMBER; - hash = (53 * hash) + getAtomicBlockIdsList().hashCode(); - } - if (getPageNumbersCount() > 0) { - hash = (37 * hash) + PAGENUMBERS_FIELD_NUMBER; - hash = (53 * hash) + getPageNumbersList().hashCode(); - } - if (!internalGetProperties().getMap().isEmpty()) { - hash = (37 * hash) + PROPERTIES_FIELD_NUMBER; - hash = (53 * hash) + internalGetProperties().hashCode(); - } - if (getChildrenCount() > 0) { - hash = (37 * hash) + CHILDREN_FIELD_NUMBER; - hash = (53 * hash) + getChildrenList().hashCode(); - } - if (getEnginesCount() > 0) { - hash = (37 * hash) + ENGINES_FIELD_NUMBER; - hash = (53 * hash) + engines_.hashCode(); - } - hash = (29 * hash) + getUnknownFields().hashCode(); - memoizedHashCode = hash; - return hash; + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); } - - - public static EntryData parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static EntryData parseFrom(java.nio.ByteBuffer data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static EntryData parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static EntryData parseFrom(com.google.protobuf.ByteString data, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static EntryData parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data); - } - - - public static EntryData parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - - return PARSER.parseFrom(data, extensionRegistry); - } - - - public static EntryData parseFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static EntryData parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - public static EntryData parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); - } - - - public static EntryData parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); - } - - - public static EntryData parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); - } - - - public static EntryData parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); - } - - - @Override - public Builder newBuilderForType() {return newBuilder();} - - - public static Builder newBuilder() { - - return DEFAULT_INSTANCE.toBuilder(); - } - - - public static Builder newBuilder(EntryData prototype) { - - return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); - } - - - @Override - public Builder toBuilder() { - - return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); - } - - - @Override - protected Builder newBuilderForType(BuilderParent parent) { - - Builder builder = new Builder(parent); - return builder; - } - - - /** - * Protobuf type {@code EntryData} - */ - public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements - // @@protoc_insertion_point(builder_implements:EntryData) - EntryDataOrBuilder { - - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { - - return EntryDataProto.internal_static_EntryData_descriptor; - } - - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) { - - switch (number) { - case 5: - return internalGetProperties(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - - @SuppressWarnings({"rawtypes"}) - protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number) { - - switch (number) { - case 5: - return internalGetMutableProperties(); - default: - throw new RuntimeException("Invalid map field number: " + number); - } - } - - - @Override - protected FieldAccessorTable internalGetFieldAccessorTable() { - - return EntryDataProto.internal_static_EntryData_fieldAccessorTable.ensureFieldAccessorsInitialized(EntryData.class, Builder.class); - } - - - // Construct using EntryDataOuterClass.EntryData.newBuilder() - private Builder() { - - } - - - private Builder(BuilderParent parent) { - - super(parent); - - } - - - @Override - public Builder clear() { - - super.clear(); - bitField0_ = 0; - type_ = 0; - treeId_ = emptyIntList(); - atomicBlockIds_ = emptyLongList(); - pageNumbers_ = emptyLongList(); - internalGetMutableProperties().clear(); - if (childrenBuilder_ == null) { - children_ = java.util.Collections.emptyList(); - } else { - children_ = null; - childrenBuilder_.clear(); - } - bitField0_ = (bitField0_ & ~0x00000020); - engines_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - return this; - } - - - @Override - public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { - - return EntryDataProto.internal_static_EntryData_descriptor; - } - - - @Override - public EntryData getDefaultInstanceForType() { - - return EntryData.getDefaultInstance(); - } - - - @Override - public EntryData build() { - - EntryData result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - - @Override - public EntryData buildPartial() { - - EntryData result = new EntryData(this); - buildPartialRepeatedFields(result); - if (bitField0_ != 0) { - buildPartial0(result); - } - onBuilt(); - return result; - } - - - private void buildPartialRepeatedFields(EntryData result) { - - if (childrenBuilder_ == null) { - if (((bitField0_ & 0x00000020) != 0)) { - children_ = java.util.Collections.unmodifiableList(children_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.children_ = children_; - } else { - result.children_ = childrenBuilder_.build(); - } - if (((bitField0_ & 0x00000040) != 0)) { - engines_ = java.util.Collections.unmodifiableList(engines_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.engines_ = engines_; - } - - - private void buildPartial0(EntryData result) { - - int from_bitField0_ = bitField0_; - if (((from_bitField0_ & 0x00000001) != 0)) { - result.type_ = type_; - } - if (((from_bitField0_ & 0x00000002) != 0)) { - treeId_.makeImmutable(); - result.treeId_ = treeId_; - } - if (((from_bitField0_ & 0x00000004) != 0)) { - atomicBlockIds_.makeImmutable(); - result.atomicBlockIds_ = atomicBlockIds_; - } - if (((from_bitField0_ & 0x00000008) != 0)) { - pageNumbers_.makeImmutable(); - result.pageNumbers_ = pageNumbers_; - } - if (((from_bitField0_ & 0x00000010) != 0)) { - result.properties_ = internalGetProperties(); - result.properties_.makeImmutable(); - } - } - - - @Override - public Builder mergeFrom(com.google.protobuf.Message other) { - - if (other instanceof EntryData) { - return mergeFrom((EntryData) other); - } else { - super.mergeFrom(other); - return this; - } - } - - - public Builder mergeFrom(EntryData other) { - - if (other == EntryData.getDefaultInstance()) { - return this; - } - if (other.type_ != 0) { - setTypeValue(other.getTypeValue()); - } - if (!other.treeId_.isEmpty()) { - if (treeId_.isEmpty()) { - treeId_ = other.treeId_; - treeId_.makeImmutable(); - bitField0_ |= 0x00000002; - } else { - ensureTreeIdIsMutable(); - treeId_.addAll(other.treeId_); - } - onChanged(); - } - if (!other.atomicBlockIds_.isEmpty()) { - if (atomicBlockIds_.isEmpty()) { - atomicBlockIds_ = other.atomicBlockIds_; - atomicBlockIds_.makeImmutable(); - bitField0_ |= 0x00000004; - } else { - ensureAtomicBlockIdsIsMutable(); - atomicBlockIds_.addAll(other.atomicBlockIds_); - } - onChanged(); - } - if (!other.pageNumbers_.isEmpty()) { - if (pageNumbers_.isEmpty()) { - pageNumbers_ = other.pageNumbers_; - pageNumbers_.makeImmutable(); - bitField0_ |= 0x00000008; - } else { - ensurePageNumbersIsMutable(); - pageNumbers_.addAll(other.pageNumbers_); - } - onChanged(); - } - internalGetMutableProperties().mergeFrom(other.internalGetProperties()); - bitField0_ |= 0x00000010; - if (childrenBuilder_ == null) { - if (!other.children_.isEmpty()) { - if (children_.isEmpty()) { - children_ = other.children_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureChildrenIsMutable(); - children_.addAll(other.children_); - } - onChanged(); - } - } else { - if (!other.children_.isEmpty()) { - if (childrenBuilder_.isEmpty()) { - childrenBuilder_.dispose(); - childrenBuilder_ = null; - children_ = other.children_; - bitField0_ = (bitField0_ & ~0x00000020); - childrenBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getChildrenFieldBuilder() : null; - } else { - childrenBuilder_.addAllMessages(other.children_); - } - } - } - if (!other.engines_.isEmpty()) { - if (engines_.isEmpty()) { - engines_ = other.engines_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureEnginesIsMutable(); - engines_.addAll(other.engines_); - } - onChanged(); - } - this.mergeUnknownFields(other.getUnknownFields()); - onChanged(); - return this; - } - - - @Override - public final boolean isInitialized() { - - return true; - } - - - @Override - public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - - if (extensionRegistry == null) { - throw new NullPointerException(); - } - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - case 8: { - type_ = input.readEnum(); - bitField0_ |= 0x00000001; - break; - } // case 8 - case 16: { - int v = input.readInt32(); - ensureTreeIdIsMutable(); - treeId_.addInt(v); - break; - } // case 16 - case 18: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureTreeIdIsMutable(); - while (input.getBytesUntilLimit() > 0) { - treeId_.addInt(input.readInt32()); - } - input.popLimit(limit); - break; - } // case 18 - case 24: { - long v = input.readInt64(); - ensureAtomicBlockIdsIsMutable(); - atomicBlockIds_.addLong(v); - break; - } // case 24 - case 26: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensureAtomicBlockIdsIsMutable(); - while (input.getBytesUntilLimit() > 0) { - atomicBlockIds_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } // case 26 - case 32: { - long v = input.readInt64(); - ensurePageNumbersIsMutable(); - pageNumbers_.addLong(v); - break; - } // case 32 - case 34: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - ensurePageNumbersIsMutable(); - while (input.getBytesUntilLimit() > 0) { - pageNumbers_.addLong(input.readInt64()); - } - input.popLimit(limit); - break; - } // case 34 - case 42: { - com.google.protobuf.MapEntry properties__ = input.readMessage(PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), - extensionRegistry); - internalGetMutableProperties().getMutableMap().put(properties__.getKey(), properties__.getValue()); - bitField0_ |= 0x00000010; - break; - } // case 42 - case 50: { - EntryData m = input.readMessage(EntryData.parser(), extensionRegistry); - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.add(m); - } else { - childrenBuilder_.addMessage(m); - } - break; - } // case 50 - case 56: { - int tmpRaw = input.readEnum(); - ensureEnginesIsMutable(); - engines_.add(tmpRaw); - break; - } // case 56 - case 58: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - int tmpRaw = input.readEnum(); - ensureEnginesIsMutable(); - engines_.add(tmpRaw); - } - input.popLimit(oldLimit); - break; - } // case 58 - default: { - if (!super.parseUnknownField(input, extensionRegistry, tag)) { - done = true; // was an endgroup tag - } - break; - } // default: - } // switch (tag) - } // while (!done) - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.unwrapIOException(); - } finally { - onChanged(); - } // finally - return this; - } - - - private int bitField0_; - - private int type_ = 0; - - - /** - *
-             * Type of the semantic node.
-             * 
- * - * .NodeType type = 1; - * - * @return The enum numeric value on the wire for type. - */ - @Override - public int getTypeValue() { - - return type_; - } - - - /** - *
-             * Type of the semantic node.
-             * 
- * - * .NodeType type = 1; - * - * @param value The enum numeric value on the wire for type to set. - * @return This builder for chaining. - */ - public Builder setTypeValue(int value) { - - type_ = value; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + type_ = input.readEnum(); bitField0_ |= 0x00000001; - onChanged(); - return this; - } - - - /** - *
-             * Type of the semantic node.
-             * 
- * - * .NodeType type = 1; - * - * @return The type. - */ - @Override - public NodeTypeProto.NodeType getType() { - - NodeTypeProto.NodeType result = NodeTypeProto.NodeType.forNumber(type_); - return result == null ? NodeTypeProto.NodeType.UNRECOGNIZED : result; - } - - - /** - *
-             * Type of the semantic node.
-             * 
- * - * .NodeType type = 1; - * - * @param value The type to set. - * @return This builder for chaining. - */ - public Builder setType(NodeTypeProto.NodeType value) { - - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000001; - type_ = value.getNumber(); - onChanged(); - return this; - } - - - /** - *
-             * Type of the semantic node.
-             * 
- * - * .NodeType type = 1; - * - * @return This builder for chaining. - */ - public Builder clearType() { - - bitField0_ = (bitField0_ & ~0x00000001); - type_ = 0; - onChanged(); - return this; - } - - - private com.google.protobuf.Internal.IntList treeId_ = emptyIntList(); - - - private void ensureTreeIdIsMutable() { - - if (!treeId_.isModifiable()) { - treeId_ = makeMutableCopy(treeId_); - } - bitField0_ |= 0x00000002; - } - - - /** - *
-             * Specifies the position in the parsed tree structure.
-             * 
- * - * repeated int32 treeId = 2; - * - * @return A list containing the treeId. - */ - public java.util.List getTreeIdList() { - - treeId_.makeImmutable(); - return treeId_; - } - - - /** - *
-             * Specifies the position in the parsed tree structure.
-             * 
- * - * repeated int32 treeId = 2; - * - * @return The count of treeId. - */ - public int getTreeIdCount() { - - return treeId_.size(); - } - - - /** - *
-             * Specifies the position in the parsed tree structure.
-             * 
- * - * repeated int32 treeId = 2; - * - * @param index The index of the element to return. - * @return The treeId at the given index. - */ - public int getTreeId(int index) { - - return treeId_.getInt(index); - } - - - /** - *
-             * Specifies the position in the parsed tree structure.
-             * 
- * - * repeated int32 treeId = 2; - * - * @param index The index to set the value at. - * @param value The treeId to set. - * @return This builder for chaining. - */ - public Builder setTreeId(int index, int value) { - + break; + } // case 8 + case 16: { + int v = input.readInt32(); ensureTreeIdIsMutable(); - treeId_.setInt(index, value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the position in the parsed tree structure.
-             * 
- * - * repeated int32 treeId = 2; - * - * @param value The treeId to add. - * @return This builder for chaining. - */ - public Builder addTreeId(int value) { - + treeId_.addInt(v); + break; + } // case 16 + case 18: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); ensureTreeIdIsMutable(); - treeId_.addInt(value); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the position in the parsed tree structure.
-             * 
- * - * repeated int32 treeId = 2; - * - * @param values The treeId to add. - * @return This builder for chaining. - */ - public Builder addAllTreeId(Iterable values) { - - ensureTreeIdIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, treeId_); - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the position in the parsed tree structure.
-             * 
- * - * repeated int32 treeId = 2; - * - * @return This builder for chaining. - */ - public Builder clearTreeId() { - - treeId_ = emptyIntList(); - bitField0_ = (bitField0_ & ~0x00000002); - onChanged(); - return this; - } - - - private com.google.protobuf.Internal.LongList atomicBlockIds_ = emptyLongList(); - - - private void ensureAtomicBlockIdsIsMutable() { - - if (!atomicBlockIds_.isModifiable()) { - atomicBlockIds_ = makeMutableCopy(atomicBlockIds_); + while (input.getBytesUntilLimit() > 0) { + treeId_.addInt(input.readInt32()); } - bitField0_ |= 0x00000004; - } - - - /** - *
-             * Specifies the text block IDs associated with this semantic node.
-             * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @return A list containing the atomicBlockIds. - */ - public java.util.List getAtomicBlockIdsList() { - - atomicBlockIds_.makeImmutable(); - return atomicBlockIds_; - } - - - /** - *
-             * Specifies the text block IDs associated with this semantic node.
-             * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @return The count of atomicBlockIds. - */ - public int getAtomicBlockIdsCount() { - - return atomicBlockIds_.size(); - } - - - /** - *
-             * Specifies the text block IDs associated with this semantic node.
-             * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @param index The index of the element to return. - * @return The atomicBlockIds at the given index. - */ - public long getAtomicBlockIds(int index) { - - return atomicBlockIds_.getLong(index); - } - - - /** - *
-             * Specifies the text block IDs associated with this semantic node.
-             * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @param index The index to set the value at. - * @param value The atomicBlockIds to set. - * @return This builder for chaining. - */ - public Builder setAtomicBlockIds(int index, long value) { - + input.popLimit(limit); + break; + } // case 18 + case 24: { + long v = input.readInt64(); ensureAtomicBlockIdsIsMutable(); - atomicBlockIds_.setLong(index, value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the text block IDs associated with this semantic node.
-             * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @param value The atomicBlockIds to add. - * @return This builder for chaining. - */ - public Builder addAtomicBlockIds(long value) { - + atomicBlockIds_.addLong(v); + break; + } // case 24 + case 26: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); ensureAtomicBlockIdsIsMutable(); - atomicBlockIds_.addLong(value); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the text block IDs associated with this semantic node.
-             * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @param values The atomicBlockIds to add. - * @return This builder for chaining. - */ - public Builder addAllAtomicBlockIds(Iterable values) { - - ensureAtomicBlockIdsIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, atomicBlockIds_); - bitField0_ |= 0x00000004; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the text block IDs associated with this semantic node.
-             * 
- * - * repeated int64 atomicBlockIds = 3; - * - * @return This builder for chaining. - */ - public Builder clearAtomicBlockIds() { - - atomicBlockIds_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000004); - onChanged(); - return this; - } - - - private com.google.protobuf.Internal.LongList pageNumbers_ = emptyLongList(); - - - private void ensurePageNumbersIsMutable() { - - if (!pageNumbers_.isModifiable()) { - pageNumbers_ = makeMutableCopy(pageNumbers_); + while (input.getBytesUntilLimit() > 0) { + atomicBlockIds_.addLong(input.readInt64()); } - bitField0_ |= 0x00000008; - } - - - /** - *
-             * Specifies the pages this semantic node appears on.
-             * 
- * - * repeated int64 pageNumbers = 4; - * - * @return A list containing the pageNumbers. - */ - public java.util.List getPageNumbersList() { - - pageNumbers_.makeImmutable(); - return pageNumbers_; - } - - - /** - *
-             * Specifies the pages this semantic node appears on.
-             * 
- * - * repeated int64 pageNumbers = 4; - * - * @return The count of pageNumbers. - */ - public int getPageNumbersCount() { - - return pageNumbers_.size(); - } - - - /** - *
-             * Specifies the pages this semantic node appears on.
-             * 
- * - * repeated int64 pageNumbers = 4; - * - * @param index The index of the element to return. - * @return The pageNumbers at the given index. - */ - public long getPageNumbers(int index) { - - return pageNumbers_.getLong(index); - } - - - /** - *
-             * Specifies the pages this semantic node appears on.
-             * 
- * - * repeated int64 pageNumbers = 4; - * - * @param index The index to set the value at. - * @param value The pageNumbers to set. - * @return This builder for chaining. - */ - public Builder setPageNumbers(int index, long value) { - + input.popLimit(limit); + break; + } // case 26 + case 32: { + long v = input.readInt64(); ensurePageNumbersIsMutable(); - pageNumbers_.setLong(index, value); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the pages this semantic node appears on.
-             * 
- * - * repeated int64 pageNumbers = 4; - * - * @param value The pageNumbers to add. - * @return This builder for chaining. - */ - public Builder addPageNumbers(long value) { - + pageNumbers_.addLong(v); + break; + } // case 32 + case 34: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); ensurePageNumbersIsMutable(); - pageNumbers_.addLong(value); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the pages this semantic node appears on.
-             * 
- * - * repeated int64 pageNumbers = 4; - * - * @param values The pageNumbers to add. - * @return This builder for chaining. - */ - public Builder addAllPageNumbers(Iterable values) { - - ensurePageNumbersIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pageNumbers_); - bitField0_ |= 0x00000008; - onChanged(); - return this; - } - - - /** - *
-             * Specifies the pages this semantic node appears on.
-             * 
- * - * repeated int64 pageNumbers = 4; - * - * @return This builder for chaining. - */ - public Builder clearPageNumbers() { - - pageNumbers_ = emptyLongList(); - bitField0_ = (bitField0_ & ~0x00000008); - onChanged(); - return this; - } - - - private com.google.protobuf.MapField properties_; - - - private com.google.protobuf.MapField internalGetProperties() { - - if (properties_ == null) { - return com.google.protobuf.MapField.emptyMapField(PropertiesDefaultEntryHolder.defaultEntry); - } - return properties_; - } - - - private com.google.protobuf.MapField internalGetMutableProperties() { - - if (properties_ == null) { - properties_ = com.google.protobuf.MapField.newMapField(PropertiesDefaultEntryHolder.defaultEntry); - } - if (!properties_.isMutable()) { - properties_ = properties_.copy(); + while (input.getBytesUntilLimit() > 0) { + pageNumbers_.addLong(input.readInt64()); } + input.popLimit(limit); + break; + } // case 34 + case 42: { + com.google.protobuf.MapEntry + properties__ = input.readMessage( + PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableProperties().getMutableMap().put( + properties__.getKey(), properties__.getValue()); bitField0_ |= 0x00000010; - onChanged(); - return properties_; - } - - - public int getPropertiesCount() { - - return internalGetProperties().getMap().size(); - } - - - /** - *
-             * Some semantic nodes have additional information, this information is stored in this Map.
-             * 
- * - * map<string, string> properties = 5; - */ - @Override - public boolean containsProperties(String key) { - - if (key == null) { - throw new NullPointerException("map key"); - } - return internalGetProperties().getMap().containsKey(key); - } - - - /** - * Use {@link #getPropertiesMap()} instead. - */ - @Override - @Deprecated - public java.util.Map getProperties() { - - return getPropertiesMap(); - } - - - /** - *
-             * Some semantic nodes have additional information, this information is stored in this Map.
-             * 
- * - * map<string, string> properties = 5; - */ - @Override - public java.util.Map getPropertiesMap() { - - return internalGetProperties().getMap(); - } - - - /** - *
-             * Some semantic nodes have additional information, this information is stored in this Map.
-             * 
- * - * map<string, string> properties = 5; - */ - @Override - public /* nullable */ - String getPropertiesOrDefault(String key, - /* nullable */ - String defaultValue) { - - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetProperties().getMap(); - return map.containsKey(key) ? map.get(key) : defaultValue; - } - - - /** - *
-             * Some semantic nodes have additional information, this information is stored in this Map.
-             * 
- * - * map<string, string> properties = 5; - */ - @Override - public String getPropertiesOrThrow(String key) { - - if (key == null) { - throw new NullPointerException("map key"); - } - java.util.Map map = internalGetProperties().getMap(); - if (!map.containsKey(key)) { - throw new IllegalArgumentException(); - } - return map.get(key); - } - - - public Builder clearProperties() { - - bitField0_ = (bitField0_ & ~0x00000010); - internalGetMutableProperties().getMutableMap().clear(); - return this; - } - - - /** - *
-             * Some semantic nodes have additional information, this information is stored in this Map.
-             * 
- * - * map<string, string> properties = 5; - */ - public Builder removeProperties(String key) { - - if (key == null) { - throw new NullPointerException("map key"); - } - internalGetMutableProperties().getMutableMap().remove(key); - return this; - } - - - /** - * Use alternate mutation accessors instead. - */ - @Deprecated - public java.util.Map getMutableProperties() { - - bitField0_ |= 0x00000010; - return internalGetMutableProperties().getMutableMap(); - } - - - /** - *
-             * Some semantic nodes have additional information, this information is stored in this Map.
-             * 
- * - * map<string, string> properties = 5; - */ - public Builder putProperties(String key, String value) { - - if (key == null) { - throw new NullPointerException("map key"); - } - if (value == null) { - throw new NullPointerException("map value"); - } - internalGetMutableProperties().getMutableMap().put(key, value); - bitField0_ |= 0x00000010; - return this; - } - - - /** - *
-             * Some semantic nodes have additional information, this information is stored in this Map.
-             * 
- * - * map<string, string> properties = 5; - */ - public Builder putAllProperties(java.util.Map values) { - - internalGetMutableProperties().getMutableMap().putAll(values); - bitField0_ |= 0x00000010; - return this; - } - - - private java.util.List children_ = java.util.Collections.emptyList(); - - - private void ensureChildrenIsMutable() { - - if (!((bitField0_ & 0x00000020) != 0)) { - children_ = new java.util.ArrayList(children_); - bitField0_ |= 0x00000020; - } - } - - - private com.google.protobuf.RepeatedFieldBuilder childrenBuilder_; - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public java.util.List getChildrenList() { - + break; + } // case 42 + case 50: { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData m = + input.readMessage( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.parser(), + extensionRegistry); if (childrenBuilder_ == null) { - return java.util.Collections.unmodifiableList(children_); + ensureChildrenIsMutable(); + children_.add(m); } else { - return childrenBuilder_.getMessageList(); - } - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public int getChildrenCount() { - - if (childrenBuilder_ == null) { - return children_.size(); - } else { - return childrenBuilder_.getCount(); - } - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public EntryData getChildren(int index) { - - if (childrenBuilder_ == null) { - return children_.get(index); - } else { - return childrenBuilder_.getMessage(index); - } - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder setChildren(int index, EntryData value) { - - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.set(index, value); - onChanged(); - } else { - childrenBuilder_.setMessage(index, value); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder setChildren(int index, Builder builderForValue) { - - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.set(index, builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.setMessage(index, builderForValue.build()); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder addChildren(EntryData value) { - - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.add(value); - onChanged(); - } else { - childrenBuilder_.addMessage(value); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder addChildren(int index, EntryData value) { - - if (childrenBuilder_ == null) { - if (value == null) { - throw new NullPointerException(); - } - ensureChildrenIsMutable(); - children_.add(index, value); - onChanged(); - } else { - childrenBuilder_.addMessage(index, value); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder addChildren(Builder builderForValue) { - - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.add(builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.addMessage(builderForValue.build()); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder addChildren(int index, Builder builderForValue) { - - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.add(index, builderForValue.build()); - onChanged(); - } else { - childrenBuilder_.addMessage(index, builderForValue.build()); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder addAllChildren(Iterable values) { - - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - com.google.protobuf.AbstractMessageLite.Builder.addAll(values, children_); - onChanged(); - } else { - childrenBuilder_.addAllMessages(values); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder clearChildren() { - - if (childrenBuilder_ == null) { - children_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - onChanged(); - } else { - childrenBuilder_.clear(); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder removeChildren(int index) { - - if (childrenBuilder_ == null) { - ensureChildrenIsMutable(); - children_.remove(index); - onChanged(); - } else { - childrenBuilder_.remove(index); - } - return this; - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder getChildrenBuilder(int index) { - - return getChildrenFieldBuilder().getBuilder(index); - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public EntryDataOrBuilder getChildrenOrBuilder(int index) { - - if (childrenBuilder_ == null) { - return children_.get(index); - } else { - return childrenBuilder_.getMessageOrBuilder(index); - } - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public java.util.List getChildrenOrBuilderList() { - - if (childrenBuilder_ != null) { - return childrenBuilder_.getMessageOrBuilderList(); - } else { - return java.util.Collections.unmodifiableList(children_); - } - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder addChildrenBuilder() { - - return getChildrenFieldBuilder().addBuilder(EntryData.getDefaultInstance()); - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public Builder addChildrenBuilder(int index) { - - return getChildrenFieldBuilder().addBuilder(index, EntryData.getDefaultInstance()); - } - - - /** - *
-             * All child Entries of this Entry.
-             * 
- * - * repeated .EntryData children = 6; - */ - public java.util.List getChildrenBuilderList() { - - return getChildrenFieldBuilder().getBuilderList(); - } - - - private com.google.protobuf.RepeatedFieldBuilder getChildrenFieldBuilder() { - - if (childrenBuilder_ == null) { - childrenBuilder_ = new com.google.protobuf.RepeatedFieldBuilder(children_, - ((bitField0_ & 0x00000020) != 0), - getParentForChildren(), - isClean()); - children_ = null; - } - return childrenBuilder_; - } - - - private java.util.List engines_ = java.util.Collections.emptyList(); - - - private void ensureEnginesIsMutable() { - - if (!((bitField0_ & 0x00000040) != 0)) { - engines_ = new java.util.ArrayList(engines_); - bitField0_ |= 0x00000040; - } - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return A list containing the engines. - */ - public java.util.List getEnginesList() { - - return new com.google.protobuf.Internal.ListAdapter(engines_, engines_converter_); - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return The count of engines. - */ - public int getEnginesCount() { - - return engines_.size(); - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index of the element to return. - * @return The engines at the given index. - */ - public LayoutEngineProto.LayoutEngine getEngines(int index) { - - return engines_converter_.convert(engines_.get(index)); - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index to set the value at. - * @param value The engines to set. - * @return This builder for chaining. - */ - public Builder setEngines(int index, LayoutEngineProto.LayoutEngine value) { - - if (value == null) { - throw new NullPointerException(); + childrenBuilder_.addMessage(m); } + break; + } // case 50 + case 56: { + int tmpRaw = input.readEnum(); ensureEnginesIsMutable(); - engines_.set(index, value.getNumber()); - onChanged(); - return this; - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param value The engines to add. - * @return This builder for chaining. - */ - public Builder addEngines(LayoutEngineProto.LayoutEngine value) { - - if (value == null) { - throw new NullPointerException(); + engines_.addInt(tmpRaw); + break; + } // case 56 + case 58: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while(input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + ensureEnginesIsMutable(); + engines_.addInt(tmpRaw); } - ensureEnginesIsMutable(); - engines_.add(value.getNumber()); - onChanged(); - return this; - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param values The engines to add. - * @return This builder for chaining. - */ - public Builder addAllEngines(Iterable values) { - - ensureEnginesIsMutable(); - for (LayoutEngineProto.LayoutEngine value : values) { - engines_.add(value.getNumber()); + input.popLimit(oldLimit); + break; + } // case 58 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag } - onChanged(); - return this; - } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return This builder for chaining. - */ - public Builder clearEngines() { - - engines_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - onChanged(); - return this; - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @return A list containing the enum numeric values on the wire for engines. - */ - public java.util.List getEnginesValueList() { - - return java.util.Collections.unmodifiableList(engines_); - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index of the value to return. - * @return The enum numeric value on the wire of engines at the given index. - */ - public int getEnginesValue(int index) { - - return engines_.get(index); - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param index The index to set the value at. - * @param value The enum numeric value on the wire for engines to set. - * @return This builder for chaining. - */ - public Builder setEnginesValue(int index, int value) { - - ensureEnginesIsMutable(); - engines_.set(index, value); - onChanged(); - return this; - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param value The enum numeric value on the wire for engines to add. - * @return This builder for chaining. - */ - public Builder addEnginesValue(int value) { - - ensureEnginesIsMutable(); - engines_.add(value); - onChanged(); - return this; - } - - - /** - *
-             * Describes the origin of the semantic node.
-             * 
- * - * repeated .LayoutEngine engines = 7; - * - * @param values The enum numeric values on the wire for engines to add. - * @return This builder for chaining. - */ - public Builder addAllEnginesValue(Iterable values) { - - ensureEnginesIsMutable(); - for (int value : values) { - engines_.add(value); - } - onChanged(); - return this; - } - - // @@protoc_insertion_point(builder_scope:EntryData) + private int type_ = 0; + /** + *
+       * Type of the semantic node.
+       * 
+ * + * .NodeType type = 1; + * @return The enum numeric value on the wire for type. + */ + @java.lang.Override public int getTypeValue() { + return type_; + } + /** + *
+       * Type of the semantic node.
+       * 
+ * + * .NodeType type = 1; + * @param value The enum numeric value on the wire for type to set. + * @return This builder for chaining. + */ + public Builder setTypeValue(int value) { + type_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+       * Type of the semantic node.
+       * 
+ * + * .NodeType type = 1; + * @return The type. + */ + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType getType() { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType result = com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.forNumber(type_); + return result == null ? com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType.UNRECOGNIZED : result; + } + /** + *
+       * Type of the semantic node.
+       * 
+ * + * .NodeType type = 1; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType value) { + if (value == null) { + throw new NullPointerException(); } + bitField0_ |= 0x00000001; + type_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * Type of the semantic node.
+       * 
+ * + * .NodeType type = 1; + * @return This builder for chaining. + */ + public Builder clearType() { + bitField0_ = (bitField0_ & ~0x00000001); + type_ = 0; + onChanged(); + return this; + } - // @@protoc_insertion_point(class_scope:EntryData) - private static final EntryData DEFAULT_INSTANCE; - - static { - DEFAULT_INSTANCE = new EntryData(); + private com.google.protobuf.Internal.IntList treeId_ = emptyIntList(); + private void ensureTreeIdIsMutable() { + if (!treeId_.isModifiable()) { + treeId_ = makeMutableCopy(treeId_); } + bitField0_ |= 0x00000002; + } + /** + *
+       * Specifies the position in the parsed tree structure.
+       * 
+ * + * repeated int32 treeId = 2; + * @return A list containing the treeId. + */ + public java.util.List + getTreeIdList() { + treeId_.makeImmutable(); + return treeId_; + } + /** + *
+       * Specifies the position in the parsed tree structure.
+       * 
+ * + * repeated int32 treeId = 2; + * @return The count of treeId. + */ + public int getTreeIdCount() { + return treeId_.size(); + } + /** + *
+       * Specifies the position in the parsed tree structure.
+       * 
+ * + * repeated int32 treeId = 2; + * @param index The index of the element to return. + * @return The treeId at the given index. + */ + public int getTreeId(int index) { + return treeId_.getInt(index); + } + /** + *
+       * Specifies the position in the parsed tree structure.
+       * 
+ * + * repeated int32 treeId = 2; + * @param index The index to set the value at. + * @param value The treeId to set. + * @return This builder for chaining. + */ + public Builder setTreeId( + int index, int value) { - public static EntryData getDefaultInstance() { + ensureTreeIdIsMutable(); + treeId_.setInt(index, value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Specifies the position in the parsed tree structure.
+       * 
+ * + * repeated int32 treeId = 2; + * @param value The treeId to add. + * @return This builder for chaining. + */ + public Builder addTreeId(int value) { - return DEFAULT_INSTANCE; + ensureTreeIdIsMutable(); + treeId_.addInt(value); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Specifies the position in the parsed tree structure.
+       * 
+ * + * repeated int32 treeId = 2; + * @param values The treeId to add. + * @return This builder for chaining. + */ + public Builder addAllTreeId( + java.lang.Iterable values) { + ensureTreeIdIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, treeId_); + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + *
+       * Specifies the position in the parsed tree structure.
+       * 
+ * + * repeated int32 treeId = 2; + * @return This builder for chaining. + */ + public Builder clearTreeId() { + treeId_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + private com.google.protobuf.Internal.LongList atomicBlockIds_ = emptyLongList(); + private void ensureAtomicBlockIdsIsMutable() { + if (!atomicBlockIds_.isModifiable()) { + atomicBlockIds_ = makeMutableCopy(atomicBlockIds_); } + bitField0_ |= 0x00000004; + } + /** + *
+       * Specifies the text block IDs associated with this semantic node.
+       * 
+ * + * repeated int64 atomicBlockIds = 3; + * @return A list containing the atomicBlockIds. + */ + public java.util.List + getAtomicBlockIdsList() { + atomicBlockIds_.makeImmutable(); + return atomicBlockIds_; + } + /** + *
+       * Specifies the text block IDs associated with this semantic node.
+       * 
+ * + * repeated int64 atomicBlockIds = 3; + * @return The count of atomicBlockIds. + */ + public int getAtomicBlockIdsCount() { + return atomicBlockIds_.size(); + } + /** + *
+       * Specifies the text block IDs associated with this semantic node.
+       * 
+ * + * repeated int64 atomicBlockIds = 3; + * @param index The index of the element to return. + * @return The atomicBlockIds at the given index. + */ + public long getAtomicBlockIds(int index) { + return atomicBlockIds_.getLong(index); + } + /** + *
+       * Specifies the text block IDs associated with this semantic node.
+       * 
+ * + * repeated int64 atomicBlockIds = 3; + * @param index The index to set the value at. + * @param value The atomicBlockIds to set. + * @return This builder for chaining. + */ + public Builder setAtomicBlockIds( + int index, long value) { + ensureAtomicBlockIdsIsMutable(); + atomicBlockIds_.setLong(index, value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Specifies the text block IDs associated with this semantic node.
+       * 
+ * + * repeated int64 atomicBlockIds = 3; + * @param value The atomicBlockIds to add. + * @return This builder for chaining. + */ + public Builder addAtomicBlockIds(long value) { - private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { - @Override - public EntryData parsePartialFrom(com.google.protobuf.CodedInputStream input, - com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { + ensureAtomicBlockIdsIsMutable(); + atomicBlockIds_.addLong(value); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Specifies the text block IDs associated with this semantic node.
+       * 
+ * + * repeated int64 atomicBlockIds = 3; + * @param values The atomicBlockIds to add. + * @return This builder for chaining. + */ + public Builder addAllAtomicBlockIds( + java.lang.Iterable values) { + ensureAtomicBlockIdsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, atomicBlockIds_); + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+       * Specifies the text block IDs associated with this semantic node.
+       * 
+ * + * repeated int64 atomicBlockIds = 3; + * @return This builder for chaining. + */ + public Builder clearAtomicBlockIds() { + atomicBlockIds_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000004); + onChanged(); + return this; + } - Builder builder = newBuilder(); - try { - builder.mergeFrom(input, extensionRegistry); - } catch (com.google.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(builder.buildPartial()); - } catch (com.google.protobuf.UninitializedMessageException e) { - throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); - } catch (java.io.IOException e) { - throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(builder.buildPartial()); - } - return builder.buildPartial(); - } - }; - - - public static com.google.protobuf.Parser parser() { - - return PARSER; + private com.google.protobuf.Internal.LongList pageNumbers_ = emptyLongList(); + private void ensurePageNumbersIsMutable() { + if (!pageNumbers_.isModifiable()) { + pageNumbers_ = makeMutableCopy(pageNumbers_); } + bitField0_ |= 0x00000008; + } + /** + *
+       * Specifies the pages this semantic node appears on.
+       * 
+ * + * repeated int64 pageNumbers = 4; + * @return A list containing the pageNumbers. + */ + public java.util.List + getPageNumbersList() { + pageNumbers_.makeImmutable(); + return pageNumbers_; + } + /** + *
+       * Specifies the pages this semantic node appears on.
+       * 
+ * + * repeated int64 pageNumbers = 4; + * @return The count of pageNumbers. + */ + public int getPageNumbersCount() { + return pageNumbers_.size(); + } + /** + *
+       * Specifies the pages this semantic node appears on.
+       * 
+ * + * repeated int64 pageNumbers = 4; + * @param index The index of the element to return. + * @return The pageNumbers at the given index. + */ + public long getPageNumbers(int index) { + return pageNumbers_.getLong(index); + } + /** + *
+       * Specifies the pages this semantic node appears on.
+       * 
+ * + * repeated int64 pageNumbers = 4; + * @param index The index to set the value at. + * @param value The pageNumbers to set. + * @return This builder for chaining. + */ + public Builder setPageNumbers( + int index, long value) { + ensurePageNumbersIsMutable(); + pageNumbers_.setLong(index, value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Specifies the pages this semantic node appears on.
+       * 
+ * + * repeated int64 pageNumbers = 4; + * @param value The pageNumbers to add. + * @return This builder for chaining. + */ + public Builder addPageNumbers(long value) { - @Override - public com.google.protobuf.Parser getParserForType() { + ensurePageNumbersIsMutable(); + pageNumbers_.addLong(value); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Specifies the pages this semantic node appears on.
+       * 
+ * + * repeated int64 pageNumbers = 4; + * @param values The pageNumbers to add. + * @return This builder for chaining. + */ + public Builder addAllPageNumbers( + java.lang.Iterable values) { + ensurePageNumbersIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, pageNumbers_); + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + *
+       * Specifies the pages this semantic node appears on.
+       * 
+ * + * repeated int64 pageNumbers = 4; + * @return This builder for chaining. + */ + public Builder clearPageNumbers() { + pageNumbers_ = emptyLongList(); + bitField0_ = (bitField0_ & ~0x00000008); + onChanged(); + return this; + } - return PARSER; + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> properties_; + private com.google.protobuf.MapField + internalGetProperties() { + if (properties_ == null) { + return com.google.protobuf.MapField.emptyMapField( + PropertiesDefaultEntryHolder.defaultEntry); } - - - @Override - public EntryData getDefaultInstanceForType() { - - return DEFAULT_INSTANCE; + return properties_; + } + private com.google.protobuf.MapField + internalGetMutableProperties() { + if (properties_ == null) { + properties_ = com.google.protobuf.MapField.newMapField( + PropertiesDefaultEntryHolder.defaultEntry); } + if (!properties_.isMutable()) { + properties_ = properties_.copy(); + } + bitField0_ |= 0x00000010; + onChanged(); + return properties_; + } + public int getPropertiesCount() { + return internalGetProperties().getMap().size(); + } + /** + *
+       * Some semantic nodes have additional information, this information is stored in this Map.
+       * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public boolean containsProperties( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetProperties().getMap().containsKey(key); + } + /** + * Use {@link #getPropertiesMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getProperties() { + return getPropertiesMap(); + } + /** + *
+       * Some semantic nodes have additional information, this information is stored in this Map.
+       * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public java.util.Map getPropertiesMap() { + return internalGetProperties().getMap(); + } + /** + *
+       * Some semantic nodes have additional information, this information is stored in this Map.
+       * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public /* nullable */ +java.lang.String getPropertiesOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetProperties().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * Some semantic nodes have additional information, this information is stored in this Map.
+       * 
+ * + * map<string, string> properties = 5; + */ + @java.lang.Override + public java.lang.String getPropertiesOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetProperties().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearProperties() { + bitField0_ = (bitField0_ & ~0x00000010); + internalGetMutableProperties().getMutableMap() + .clear(); + return this; + } + /** + *
+       * Some semantic nodes have additional information, this information is stored in this Map.
+       * 
+ * + * map<string, string> properties = 5; + */ + public Builder removeProperties( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + internalGetMutableProperties().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableProperties() { + bitField0_ |= 0x00000010; + return internalGetMutableProperties().getMutableMap(); + } + /** + *
+       * Some semantic nodes have additional information, this information is stored in this Map.
+       * 
+ * + * map<string, string> properties = 5; + */ + public Builder putProperties( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableProperties().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000010; + return this; + } + /** + *
+       * Some semantic nodes have additional information, this information is stored in this Map.
+       * 
+ * + * map<string, string> properties = 5; + */ + public Builder putAllProperties( + java.util.Map values) { + internalGetMutableProperties().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000010; + return this; + } + private java.util.List children_ = + java.util.Collections.emptyList(); + private void ensureChildrenIsMutable() { + if (!((bitField0_ & 0x00000020) != 0)) { + children_ = new java.util.ArrayList(children_); + bitField0_ |= 0x00000020; + } + } + + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder> childrenBuilder_; + + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public java.util.List getChildrenList() { + if (childrenBuilder_ == null) { + return java.util.Collections.unmodifiableList(children_); + } else { + return childrenBuilder_.getMessageList(); + } + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public int getChildrenCount() { + if (childrenBuilder_ == null) { + return children_.size(); + } else { + return childrenBuilder_.getCount(); + } + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getChildren(int index) { + if (childrenBuilder_ == null) { + return children_.get(index); + } else { + return childrenBuilder_.getMessage(index); + } + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder setChildren( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.set(index, value); + onChanged(); + } else { + childrenBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder setChildren( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.set(index, builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder addChildren(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.add(value); + onChanged(); + } else { + childrenBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder addChildren( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData value) { + if (childrenBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureChildrenIsMutable(); + children_.add(index, value); + onChanged(); + } else { + childrenBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder addChildren( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder addChildren( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder builderForValue) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.add(index, builderForValue.build()); + onChanged(); + } else { + childrenBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder addAllChildren( + java.lang.Iterable values) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, children_); + onChanged(); + } else { + childrenBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder clearChildren() { + if (childrenBuilder_ == null) { + children_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + onChanged(); + } else { + childrenBuilder_.clear(); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public Builder removeChildren(int index) { + if (childrenBuilder_ == null) { + ensureChildrenIsMutable(); + children_.remove(index); + onChanged(); + } else { + childrenBuilder_.remove(index); + } + return this; + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder getChildrenBuilder( + int index) { + return getChildrenFieldBuilder().getBuilder(index); + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder getChildrenOrBuilder( + int index) { + if (childrenBuilder_ == null) { + return children_.get(index); } else { + return childrenBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public java.util.List + getChildrenOrBuilderList() { + if (childrenBuilder_ != null) { + return childrenBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(children_); + } + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder addChildrenBuilder() { + return getChildrenFieldBuilder().addBuilder( + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance()); + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder addChildrenBuilder( + int index) { + return getChildrenFieldBuilder().addBuilder( + index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.getDefaultInstance()); + } + /** + *
+       * All child Entries of this Entry.
+       * 
+ * + * repeated .EntryData children = 6; + */ + public java.util.List + getChildrenBuilderList() { + return getChildrenFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder> + getChildrenFieldBuilder() { + if (childrenBuilder_ == null) { + childrenBuilder_ = new com.google.protobuf.RepeatedFieldBuilder< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData.Builder, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryDataOrBuilder>( + children_, + ((bitField0_ & 0x00000020) != 0), + getParentForChildren(), + isClean()); + children_ = null; + } + return childrenBuilder_; + } + + private com.google.protobuf.Internal.IntList engines_ = + emptyIntList(); + private void ensureEnginesIsMutable() { + if (!((bitField0_ & 0x00000040) != 0)) { + engines_ = makeMutableCopy(engines_); + bitField0_ |= 0x00000040; + } + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @return A list containing the engines. + */ + public java.util.List getEnginesList() { + return new com.google.protobuf.Internal.IntListAdapter< + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine>(engines_, engines_converter_); + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @return The count of engines. + */ + public int getEnginesCount() { + return engines_.size(); + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index of the element to return. + * @return The engines at the given index. + */ + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine getEngines(int index) { + return engines_converter_.convert(engines_.getInt(index)); + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index to set the value at. + * @param value The engines to set. + * @return This builder for chaining. + */ + public Builder setEngines( + int index, com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnginesIsMutable(); + engines_.setInt(index, value.getNumber()); + onChanged(); + return this; + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param value The engines to add. + * @return This builder for chaining. + */ + public Builder addEngines(com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine value) { + if (value == null) { + throw new NullPointerException(); + } + ensureEnginesIsMutable(); + engines_.addInt(value.getNumber()); + onChanged(); + return this; + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param values The engines to add. + * @return This builder for chaining. + */ + public Builder addAllEngines( + java.lang.Iterable values) { + ensureEnginesIsMutable(); + for (com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine value : values) { + engines_.addInt(value.getNumber()); + } + onChanged(); + return this; + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @return This builder for chaining. + */ + public Builder clearEngines() { + engines_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000040); + onChanged(); + return this; + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @return A list containing the enum numeric values on the wire for engines. + */ + public java.util.List + getEnginesValueList() { + return java.util.Collections.unmodifiableList(engines_); + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index of the value to return. + * @return The enum numeric value on the wire of engines at the given index. + */ + public int getEnginesValue(int index) { + return engines_.getInt(index); + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param index The index to set the value at. + * @param value The enum numeric value on the wire for engines to set. + * @return This builder for chaining. + */ + public Builder setEnginesValue( + int index, int value) { + ensureEnginesIsMutable(); + engines_.setInt(index, value); + onChanged(); + return this; + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param value The enum numeric value on the wire for engines to add. + * @return This builder for chaining. + */ + public Builder addEnginesValue(int value) { + ensureEnginesIsMutable(); + engines_.addInt(value); + onChanged(); + return this; + } + /** + *
+       * Describes the origin of the semantic node.
+       * 
+ * + * repeated .LayoutEngine engines = 7; + * @param values The enum numeric values on the wire for engines to add. + * @return This builder for chaining. + */ + public Builder addAllEnginesValue( + java.lang.Iterable values) { + ensureEnginesIsMutable(); + for (int value : values) { + engines_.addInt(value); + } + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:EntryData) } - private static final com.google.protobuf.Descriptors.Descriptor internal_static_EntryData_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_EntryData_fieldAccessorTable; - private static final com.google.protobuf.Descriptors.Descriptor internal_static_EntryData_PropertiesEntry_descriptor; - private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_EntryData_PropertiesEntry_fieldAccessorTable; - - - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - - return descriptor; - } - - - private static com.google.protobuf.Descriptors.FileDescriptor descriptor; - + // @@protoc_insertion_point(class_scope:EntryData) + private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData DEFAULT_INSTANCE; static { - String[] descriptorData = {"\n\017EntryData.proto\032\022LayoutEngine.proto\032\016N" - + "odeType.proto\"\202\002\n\tEntryData\022\027\n\004type\030\001 \001(" - + "\0162\t.NodeType\022\016\n\006treeId\030\002 \003(\005\022\026\n\016atomicBl" - + "ockIds\030\003 \003(\003\022\023\n\013pageNumbers\030\004 \003(\003\022.\n\npro" - + "perties\030\005 \003(\0132\032.EntryData.PropertiesEntr" - + "y\022\034\n\010children\030\006 \003(\0132\n.EntryData\022\036\n\007engin" - + "es\030\007 \003(\0162\r.LayoutEngine\0321\n\017PropertiesEnt" - + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001b\006prot" - + "o3"}; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[]{LayoutEngineProto.getDescriptor(), NodeTypeProto.getDescriptor(),}); - internal_static_EntryData_descriptor = getDescriptor().getMessageTypes() - .get(0); - internal_static_EntryData_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable(internal_static_EntryData_descriptor, - new String[]{"Type", "TreeId", "AtomicBlockIds", "PageNumbers", "Properties", "Children", "Engines",}); - internal_static_EntryData_PropertiesEntry_descriptor = internal_static_EntryData_descriptor.getNestedTypes() - .get(0); - internal_static_EntryData_PropertiesEntry_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( - internal_static_EntryData_PropertiesEntry_descriptor, - new String[]{"Key", "Value",}); - descriptor.resolveAllFeaturesImmutable(); - LayoutEngineProto.getDescriptor(); - NodeTypeProto.getDescriptor(); + DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData(); } - // @@protoc_insertion_point(outer_class_scope) + public static com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public EntryData parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_EntryData_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_EntryData_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_EntryData_PropertiesEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_EntryData_PropertiesEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\017EntryData.proto\032\022LayoutEngine.proto\032\016N" + + "odeType.proto\"\202\002\n\tEntryData\022\027\n\004type\030\001 \001(" + + "\0162\t.NodeType\022\016\n\006treeId\030\002 \003(\005\022\026\n\016atomicBl" + + "ockIds\030\003 \003(\003\022\023\n\013pageNumbers\030\004 \003(\003\022.\n\npro" + + "perties\030\005 \003(\0132\032.EntryData.PropertiesEntr" + + "y\022\034\n\010children\030\006 \003(\0132\n.EntryData\022\036\n\007engin" + + "es\030\007 \003(\0162\r.LayoutEngine\0321\n\017PropertiesEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001BX\nFco" + + "m.knecon.fforesight.service.layoutparser" + + ".internal.api.data.redactionB\016EntryDataP" + + "rotob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.getDescriptor(), + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.getDescriptor(), + }); + internal_static_EntryData_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_EntryData_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_EntryData_descriptor, + new java.lang.String[] { "Type", "TreeId", "AtomicBlockIds", "PageNumbers", "Properties", "Children", "Engines", }); + internal_static_EntryData_PropertiesEntry_descriptor = + internal_static_EntryData_descriptor.getNestedTypes().get(0); + internal_static_EntryData_PropertiesEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_EntryData_PropertiesEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + descriptor.resolveAllFeaturesImmutable(); + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.getDescriptor(); + com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java index 5407056..572243b 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java @@ -1,193 +1,177 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: LayoutEngine.proto -// Protobuf Java Version: 4.27.1 -@SuppressWarnings("all") +// Protobuf Java Version: 4.28.3 + +package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; + public final class LayoutEngineProto { + private LayoutEngineProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + LayoutEngineProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private LayoutEngineProto() {} - + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code LayoutEngine} + */ + public enum LayoutEngine + implements com.google.protobuf.ProtocolMessageEnum { + /** + * ALGORITHM = 0; + */ + ALGORITHM(0), + /** + * AI = 1; + */ + AI(1), + /** + * OUTLINE = 2; + */ + OUTLINE(2), + UNRECOGNIZED(-1), + ; static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", LayoutEngineProto.class.getName()); + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + LayoutEngine.class.getName()); } + /** + * ALGORITHM = 0; + */ + public static final int ALGORITHM_VALUE = 0; + /** + * AI = 1; + */ + public static final int AI_VALUE = 1; + /** + * OUTLINE = 2; + */ + public static final int OUTLINE_VALUE = 2; - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - /** - * Protobuf enum {@code LayoutEngine} + * @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. */ - public enum LayoutEngine implements com.google.protobuf.ProtocolMessageEnum { - /** - * ALGORITHM = 0; - */ - ALGORITHM(0), - /** - * AI = 1; - */ - AI(1), - /** - * OUTLINE = 2; - */ - OUTLINE(2), - UNRECOGNIZED(-1), - ; + @java.lang.Deprecated + public static LayoutEngine 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 LayoutEngine forNumber(int value) { + switch (value) { + case 0: return ALGORITHM; + case 1: return AI; + case 2: return OUTLINE; + default: return null; + } + } - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", LayoutEngine.class.getName()); - } - - /** - * ALGORITHM = 0; - */ - public static final int ALGORITHM_VALUE = 0; - /** - * AI = 1; - */ - public static final int AI_VALUE = 1; - /** - * OUTLINE = 2; - */ - public static final int OUTLINE_VALUE = 2; - - - public final int getNumber() { - - if (this == UNRECOGNIZED) { - throw new 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. - */ - @Deprecated - public static LayoutEngine 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 LayoutEngine forNumber(int value) { - - switch (value) { - case 0: - return ALGORITHM; - case 1: - return AI; - case 2: - return OUTLINE; - default: - return null; - } - } - - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - - return internalValueMap; - } - - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + LayoutEngine> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { public LayoutEngine findValueByNumber(int number) { - - return LayoutEngine.forNumber(number); + return LayoutEngine.forNumber(number); } - }; + }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - - if (this == UNRECOGNIZED) { - throw new 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 LayoutEngineProto.getDescriptor().getEnumTypes() - .get(0); - } - - - private static final LayoutEngine[] VALUES = values(); - - - public static LayoutEngine valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - - if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - - private final int value; - - - private LayoutEngine(int value) { - - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:LayoutEngine) + 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 com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.getDescriptor().getEnumTypes().get(0); } + private static final LayoutEngine[] VALUES = values(); - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - - return descriptor; + public static LayoutEngine 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 static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - String[] descriptorData = {"\n\022LayoutEngine.proto*2\n\014LayoutEngine\022\r\n\t" + "ALGORITHM\020\000\022\006\n\002AI\020\001\022\013\n\007OUTLINE\020\002b\006proto3"}; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[]{}); - descriptor.resolveAllFeaturesImmutable(); + private LayoutEngine(int value) { + this.value = value; } - // @@protoc_insertion_point(outer_class_scope) + // @@protoc_insertion_point(enum_scope:LayoutEngine) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\022LayoutEngine.proto*2\n\014LayoutEngine\022\r\n\t" + + "ALGORITHM\020\000\022\006\n\002AI\020\001\022\013\n\007OUTLINE\020\002B[\nFcom." + + "knecon.fforesight.service.layoutparser.i" + + "nternal.api.data.redactionB\021LayoutEngine" + + "Protob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java index 21a20cc..edbd9d1 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java @@ -1,274 +1,261 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -import java.util.Locale; // Generated by the protocol buffer compiler. DO NOT EDIT! // NO CHECKED-IN PROTOBUF GENCODE // source: NodeType.proto -// Protobuf Java Version: 4.27.1 -@SuppressWarnings("all") +// Protobuf Java Version: 4.28.3 + +package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; + public final class NodeTypeProto { + private NodeTypeProto() {} + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NodeTypeProto.class.getName()); + } + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } - private NodeTypeProto() {} - + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + /** + * Protobuf enum {@code NodeType} + */ + public enum NodeType + implements com.google.protobuf.ProtocolMessageEnum { + /** + * DOCUMENT = 0; + */ + DOCUMENT(0), + /** + * SECTION = 1; + */ + SECTION(1), + /** + * SUPER_SECTION = 2; + */ + SUPER_SECTION(2), + /** + * HEADLINE = 3; + */ + HEADLINE(3), + /** + * PARAGRAPH = 4; + */ + PARAGRAPH(4), + /** + * TABLE = 5; + */ + TABLE(5), + /** + * TABLE_CELL = 6; + */ + TABLE_CELL(6), + /** + * IMAGE = 7; + */ + IMAGE(7), + /** + * HEADER = 8; + */ + HEADER(8), + /** + * FOOTER = 9; + */ + FOOTER(9), + /** + * TABLE_OF_CONTENTS = 10; + */ + TABLE_OF_CONTENTS(10), + /** + * TABLE_OF_CONTENTS_ITEM = 11; + */ + TABLE_OF_CONTENTS_ITEM(11), + UNRECOGNIZED(-1), + ; static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", NodeTypeProto.class.getName()); + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 28, + /* patch= */ 3, + /* suffix= */ "", + NodeType.class.getName()); } + /** + * DOCUMENT = 0; + */ + public static final int DOCUMENT_VALUE = 0; + /** + * SECTION = 1; + */ + public static final int SECTION_VALUE = 1; + /** + * SUPER_SECTION = 2; + */ + public static final int SUPER_SECTION_VALUE = 2; + /** + * HEADLINE = 3; + */ + public static final int HEADLINE_VALUE = 3; + /** + * PARAGRAPH = 4; + */ + public static final int PARAGRAPH_VALUE = 4; + /** + * TABLE = 5; + */ + public static final int TABLE_VALUE = 5; + /** + * TABLE_CELL = 6; + */ + public static final int TABLE_CELL_VALUE = 6; + /** + * IMAGE = 7; + */ + public static final int IMAGE_VALUE = 7; + /** + * HEADER = 8; + */ + public static final int HEADER_VALUE = 8; + /** + * FOOTER = 9; + */ + public static final int FOOTER_VALUE = 9; + /** + * TABLE_OF_CONTENTS = 10; + */ + public static final int TABLE_OF_CONTENTS_VALUE = 10; + /** + * TABLE_OF_CONTENTS_ITEM = 11; + */ + public static final int TABLE_OF_CONTENTS_ITEM_VALUE = 11; - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; } - - public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { - - registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); - } - - /** - * Protobuf enum {@code NodeType} + * @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. */ - public enum NodeType implements com.google.protobuf.ProtocolMessageEnum { - /** - * DOCUMENT = 0; - */ - DOCUMENT(0), - /** - * SECTION = 1; - */ - SECTION(1), - /** - * SUPER_SECTION = 2; - */ - SUPER_SECTION(2), - /** - * HEADLINE = 3; - */ - HEADLINE(3), - /** - * PARAGRAPH = 4; - */ - PARAGRAPH(4), - /** - * TABLE = 5; - */ - TABLE(5), - /** - * TABLE_CELL = 6; - */ - TABLE_CELL(6), - /** - * IMAGE = 7; - */ - IMAGE(7), - /** - * HEADER = 8; - */ - HEADER(8), - /** - * FOOTER = 9; - */ - FOOTER(9), - UNRECOGNIZED(-1), - ; + @java.lang.Deprecated + public static NodeType 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 NodeType forNumber(int value) { + switch (value) { + case 0: return DOCUMENT; + case 1: return SECTION; + case 2: return SUPER_SECTION; + case 3: return HEADLINE; + case 4: return PARAGRAPH; + case 5: return TABLE; + case 6: return TABLE_CELL; + case 7: return IMAGE; + case 8: return HEADER; + case 9: return FOOTER; + case 10: return TABLE_OF_CONTENTS; + case 11: return TABLE_OF_CONTENTS_ITEM; + default: return null; + } + } - public String toString() { - - return this.name().charAt(0) + this.name().substring(1).toLowerCase(Locale.ROOT); - } - - - static { - com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, - /* major= */ 4, - /* minor= */ 27, - /* patch= */ 1, - /* suffix= */ "", NodeType.class.getName()); - } - - /** - * DOCUMENT = 0; - */ - public static final int DOCUMENT_VALUE = 0; - /** - * SECTION = 1; - */ - public static final int SECTION_VALUE = 1; - /** - * SUPER_SECTION = 2; - */ - public static final int SUPER_SECTION_VALUE = 2; - /** - * HEADLINE = 3; - */ - public static final int HEADLINE_VALUE = 3; - /** - * PARAGRAPH = 4; - */ - public static final int PARAGRAPH_VALUE = 4; - /** - * TABLE = 5; - */ - public static final int TABLE_VALUE = 5; - /** - * TABLE_CELL = 6; - */ - public static final int TABLE_CELL_VALUE = 6; - /** - * IMAGE = 7; - */ - public static final int IMAGE_VALUE = 7; - /** - * HEADER = 8; - */ - public static final int HEADER_VALUE = 8; - /** - * FOOTER = 9; - */ - public static final int FOOTER_VALUE = 9; - - - public final int getNumber() { - - if (this == UNRECOGNIZED) { - throw new 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. - */ - @Deprecated - public static NodeType 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 NodeType forNumber(int value) { - - switch (value) { - case 0: - return DOCUMENT; - case 1: - return SECTION; - case 2: - return SUPER_SECTION; - case 3: - return HEADLINE; - case 4: - return PARAGRAPH; - case 5: - return TABLE; - case 6: - return TABLE_CELL; - case 7: - return IMAGE; - case 8: - return HEADER; - case 9: - return FOOTER; - default: - return null; - } - } - - - public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { - - return internalValueMap; - } - - - private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = new com.google.protobuf.Internal.EnumLiteMap() { + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + NodeType> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { public NodeType findValueByNumber(int number) { - - return NodeType.forNumber(number); + return NodeType.forNumber(number); } - }; + }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { - - if (this == UNRECOGNIZED) { - throw new 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 NodeTypeProto.getDescriptor().getEnumTypes() - .get(0); - } - - - private static final NodeType[] VALUES = values(); - - - public static NodeType valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { - - if (desc.getType() != getDescriptor()) { - throw new IllegalArgumentException("EnumValueDescriptor is not for this type."); - } - if (desc.getIndex() == -1) { - return UNRECOGNIZED; - } - return VALUES[desc.getIndex()]; - } - - - private final int value; - - - private NodeType(int value) { - - this.value = value; - } - - // @@protoc_insertion_point(enum_scope:NodeType) + 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 com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.getDescriptor().getEnumTypes().get(0); } + private static final NodeType[] VALUES = values(); - public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { - - return descriptor; + public static NodeType 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 static com.google.protobuf.Descriptors.FileDescriptor descriptor; - - static { - String[] descriptorData = {"\n\016NodeType.proto*\223\001\n\010NodeType\022\014\n\010DOCUMEN" - + "T\020\000\022\013\n\007SECTION\020\001\022\021\n\rSUPER_SECTION\020\002\022\014\n\010H" - + "EADLINE\020\003\022\r\n\tPARAGRAPH\020\004\022\t\n\005TABLE\020\005\022\016\n\nT" - + "ABLE_CELL\020\006\022\t\n\005IMAGE\020\007\022\n\n\006HEADER\020\010\022\n\n\006FO" - + "OTER\020\tb\006proto3"}; - descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[]{}); - descriptor.resolveAllFeaturesImmutable(); + private NodeType(int value) { + this.value = value; } - // @@protoc_insertion_point(outer_class_scope) + // @@protoc_insertion_point(enum_scope:NodeType) + } + + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n\016NodeType.proto*\306\001\n\010NodeType\022\014\n\010DOCUMEN" + + "T\020\000\022\013\n\007SECTION\020\001\022\021\n\rSUPER_SECTION\020\002\022\014\n\010H" + + "EADLINE\020\003\022\r\n\tPARAGRAPH\020\004\022\t\n\005TABLE\020\005\022\016\n\nT" + + "ABLE_CELL\020\006\022\t\n\005IMAGE\020\007\022\n\n\006HEADER\020\010\022\n\n\006FO" + + "OTER\020\t\022\025\n\021TABLE_OF_CONTENTS\020\n\022\032\n\026TABLE_O" + + "F_CONTENTS_ITEM\020\013BW\nFcom.knecon.fforesig" + + "ht.service.layoutparser.internal.api.dat" + + "a.redactionB\rNodeTypeProtob\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + descriptor.resolveAllFeaturesImmutable(); + } + + // @@protoc_insertion_point(outer_class_scope) } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto index a3d518b..d7ff489 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto @@ -1,5 +1,9 @@ syntax = "proto3"; +option java_outer_classname = "DocumentPageProto"; +option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; + + message AllDocumentPages { repeated DocumentPage documentPages = 1; diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto index 5353924..e597175 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto @@ -1,5 +1,8 @@ syntax = "proto3"; +option java_outer_classname = "DocumentPositionDataProto"; +option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; + message AllDocumentPositionData { repeated DocumentPositionData documentPositionData = 1; diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto index fc7aea6..ab1cea1 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto @@ -1,5 +1,9 @@ syntax = "proto3"; +option java_outer_classname = "DocumentStructureProto"; +option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; + + import "EntryData.proto"; message DocumentStructure { diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto index 9f187ce..c162279 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto @@ -1,5 +1,8 @@ syntax = "proto3"; +option java_outer_classname = "DocumentTextDataProto"; +option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; + message AllDocumentTextData { repeated DocumentTextData documentTextData = 1; diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto index 09e7851..cc6900c 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto @@ -3,6 +3,9 @@ syntax = "proto3"; import "LayoutEngine.proto"; import "NodeType.proto"; +option java_outer_classname = "EntryDataProto"; +option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; + message EntryData { // Type of the semantic node. NodeType type = 1; diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto index 584da56..a668134 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto @@ -1,5 +1,6 @@ syntax = "proto3"; - +option java_outer_classname = "LayoutEngineProto"; +option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; enum LayoutEngine { ALGORITHM = 0; AI = 1; diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto index 6cf9172..ce58aaa 100644 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto @@ -1,5 +1,8 @@ syntax = "proto3"; +option java_outer_classname = "NodeTypeProto"; +option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; + enum NodeType { DOCUMENT = 0; SECTION = 1; @@ -11,4 +14,6 @@ enum NodeType { IMAGE = 7; HEADER = 8; FOOTER = 9; + TABLE_OF_CONTENTS = 10; + TABLE_OF_CONTENTS_ITEM = 11; } diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/generate_proto_files.sh b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/generate_proto_files.sh new file mode 100644 index 0000000..4a929be --- /dev/null +++ b/layoutparser-service/layoutparser-service-internal-api/src/main/resources/generate_proto_files.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Minimum required protoc version +MIN_VERSION="28.3" + +# Get the installed protoc version +INSTALLED_VERSION=$(protoc --version | awk '{print $2}') + +# Function to compare versions +version_lt() { + [ "$(printf '%s\n' "$1" "$2" | sort -V | head -n1)" != "$1" ] +} + +# Check if protoc is installed and meets the minimum version +if ! command -v protoc &> /dev/null; then + echo "Error: protoc is not installed. Please install version $MIN_VERSION or later." + exit 1 +fi + +if version_lt "$INSTALLED_VERSION" "$MIN_VERSION"; then + echo "Error: protoc version $INSTALLED_VERSION is too old. Please upgrade to version $MIN_VERSION or later." + exit 1 +fi + +# Generate Java files from proto files +protoc --java_out=../java ./*.proto diff --git a/layoutparser-service/layoutparser-service-processor/build.gradle.kts b/layoutparser-service/layoutparser-service-processor/build.gradle.kts index c397e3b..ea4772c 100644 --- a/layoutparser-service/layoutparser-service-processor/build.gradle.kts +++ b/layoutparser-service/layoutparser-service-processor/build.gradle.kts @@ -35,6 +35,4 @@ dependencies { implementation("org.commonmark:commonmark-ext-gfm-tables:0.22.0") implementation("com.pdftron:PDFNet:10.11.0") implementation("org.apache.commons:commons-text:1.12.0") - - implementation("com.google.protobuf:protobuf-java-util:4.27.1") } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java index eb93d8e..8cbd322 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingPipeline.java @@ -39,10 +39,9 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Do import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.ImageType; import com.knecon.fforesight.service.layoutparser.processor.model.image.ClassifiedImage; import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineExtractorService; -import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineObject; import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineValidationService; -import com.knecon.fforesight.service.layoutparser.processor.model.outline.TOCEnrichmentService; -import com.knecon.fforesight.service.layoutparser.processor.model.outline.TableOfContents; +import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTreeBuilderService; +import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTree; import com.knecon.fforesight.service.layoutparser.processor.model.table.Cell; import com.knecon.fforesight.service.layoutparser.processor.model.table.CleanRulings; import com.knecon.fforesight.service.layoutparser.processor.model.text.TextPageBlock; @@ -107,7 +106,7 @@ public class LayoutParsingPipeline { GraphicExtractorService graphicExtractorService; OutlineExtractorService outlineExtractorService; OutlineValidationService outlineValidationService; - TOCEnrichmentService tocEnrichmentService; + SectionTreeBuilderService sectionTreeBuilderService; LayoutparserSettings settings; ClassificationService classificationService; @@ -345,14 +344,14 @@ public class LayoutParsingPipeline { classificationService.classify(classificationDocument, layoutParsingType, identifier); - TableOfContents tableOfContents = outlineValidationService.createToC(classificationDocument); - classificationDocument.setTableOfContents(tableOfContents); + SectionTree sectionTree = outlineValidationService.createSectionTree(classificationDocument); + classificationDocument.setSectionTree(sectionTree); log.info("Building Sections for {}", identifier); switch (layoutParsingType) { case CLARIFYND_PARAGRAPH_DEBUG, REDACT_MANAGER_PARAGRAPH_DEBUG -> sectionsBuilderService.buildParagraphDebugSections(classificationDocument); - default -> tocEnrichmentService.assignSectionBlocksAndImages(classificationDocument); + default -> sectionTreeBuilderService.assignSectionBlocksAndImages(classificationDocument); } return classificationDocument; diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/ClassificationDocument.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/ClassificationDocument.java index c87343a..49b9800 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/ClassificationDocument.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/ClassificationDocument.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineObjectTree; -import com.knecon.fforesight.service.layoutparser.processor.model.outline.TableOfContents; +import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTree; import com.knecon.fforesight.service.layoutparser.processor.model.text.StringFrequencyCounter; import com.knecon.fforesight.service.layoutparser.processor.model.text.UnclassifiedText; import com.knecon.fforesight.service.layoutparser.processor.visualization.LayoutDebugLayer; @@ -31,6 +31,6 @@ public class ClassificationDocument { private long rulesVersion; private OutlineObjectTree outlineObjectTree; - private TableOfContents tableOfContents; + private SectionTree sectionTree; } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/PageBlockType.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/PageBlockType.java index d893ca2..d787ea0 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/PageBlockType.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/PageBlockType.java @@ -14,6 +14,7 @@ public enum PageBlockType { PARAGRAPH_ITALIC, PARAGRAPH_UNKNOWN, OTHER, + TABLE_OF_CONTENTS_HEADLINE, TABLE_OF_CONTENTS_ITEM, LIST_ITEM, TABLE; @@ -35,7 +36,7 @@ public enum PageBlockType { public static int getHeadlineNumber(PageBlockType pageBlockType) { return switch (pageBlockType) { - case H1 -> 1; + case H1, TABLE_OF_CONTENTS_HEADLINE -> 1; case H2 -> 2; case H3 -> 3; case H4 -> 4; @@ -47,6 +48,6 @@ public enum PageBlockType { public boolean isHeadline() { - return this.equals(H1) || this.equals(H2) || this.equals(H3) || this.equals(H4) || this.equals(H5) || this.equals(H6); + return this.equals(H1) || this.equals(H2) || this.equals(H3) || this.equals(H4) || this.equals(H5) || this.equals(H6) || this.equals(TABLE_OF_CONTENTS_HEADLINE); } } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java index fed13f1..30f2a95 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java @@ -11,6 +11,8 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Se import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContents; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContentsItem; public abstract class AbstractNodeVisitor implements NodeVisitor { @@ -83,6 +85,18 @@ public abstract class AbstractNodeVisitor implements NodeVisitor { visitChildren(tableCell); } + @Override + public void visit(TableOfContents toc) { + + visitChildren(toc); + } + + @Override + public void visit(TableOfContentsItem toci) { + + visitChildren(toci); + } + protected void visitChildren(SemanticNode semanticNode) { diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java index 38a8bdd..61086a9 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java @@ -10,6 +10,10 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Se import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContents; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContentsItem; + +import software.amazon.awssdk.utils.builder.ToCopyableBuilder; public interface NodeVisitor { @@ -42,4 +46,10 @@ public interface NodeVisitor { void visit(TableCell tableCell); + + void visit(TableOfContents tableOfContents); + + + void visit(TableOfContentsItem tableOfContentsItem); + } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/TableOfContents.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/TableOfContents.java new file mode 100644 index 0000000..6de0aa6 --- /dev/null +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/TableOfContents.java @@ -0,0 +1,41 @@ +package com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes; + +import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.NodeVisitor; + +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.FieldDefaults; +import lombok.experimental.SuperBuilder; + +@Data +@SuperBuilder +@AllArgsConstructor +@FieldDefaults(level = AccessLevel.PRIVATE) +@EqualsAndHashCode(callSuper = true) +public class TableOfContents extends AbstractSemanticNode { + + @Override + public NodeTypeProto.NodeType getType() { + + return NodeTypeProto.NodeType.TABLE_OF_CONTENTS; + } + + + public Headline getHeadline() { + + return streamChildrenOfType(NodeTypeProto.NodeType.HEADLINE).map(node -> (Headline) node) + .findFirst() + .orElseGet(() -> getParent().getHeadline()); + } + + + @Override + public void accept(NodeVisitor visitor) { + + visitor.visit(this); + } + +} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/TableOfContentsItem.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/TableOfContentsItem.java new file mode 100644 index 0000000..8749de8 --- /dev/null +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/TableOfContentsItem.java @@ -0,0 +1,51 @@ +package com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes; + +import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.NodeVisitor; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock; + +import lombok.AccessLevel; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.FieldDefaults; +import lombok.experimental.SuperBuilder; + +@Data +@SuperBuilder +@AllArgsConstructor +@FieldDefaults(level = AccessLevel.PRIVATE) +@EqualsAndHashCode(callSuper = true) +public class TableOfContentsItem extends AbstractSemanticNode { + + TextBlock leafTextBlock; + + + @Override + public NodeTypeProto.NodeType getType() { + + return NodeTypeProto.NodeType.TABLE_OF_CONTENTS_ITEM; + } + + + @Override + public boolean isLeaf() { + + return true; + } + + + @Override + public void accept(NodeVisitor visitor) { + + visitor.visit(this); + } + + + @Override + public TextBlock getTextBlock() { + + return leafTextBlock; + } + +} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/OutlineValidationService.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/OutlineValidationService.java index e40ad72..820d1e2 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/OutlineValidationService.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/OutlineValidationService.java @@ -1,5 +1,6 @@ package com.knecon.fforesight.service.layoutparser.processor.model.outline; +import static com.knecon.fforesight.service.layoutparser.processor.model.PageBlockType.TABLE_OF_CONTENTS_HEADLINE; import static com.knecon.fforesight.service.layoutparser.processor.model.PageBlockType.getHeadlineNumber; import java.util.ArrayList; @@ -21,20 +22,20 @@ import lombok.extern.slf4j.Slf4j; public class OutlineValidationService { @Observed(name = "OutlineValidationService", contextualName = "create-toc") - public TableOfContents createToC(ClassificationDocument classificationDocument) { + public SectionTree createSectionTree(ClassificationDocument classificationDocument) { List headlines = extractHeadlines(classificationDocument); - List mainSections = new ArrayList<>(); - Map lastItemsPerDepth = new HashMap<>(); - TableOfContentItem last = null; + List mainSections = new ArrayList<>(); + Map lastItemsPerDepth = new HashMap<>(); + SectionTreeEntry last = null; TreeSet depths = new TreeSet<>(); for (TextPageBlock current : headlines) { int currentDepth = getHeadlineNumber(current.getClassification()); Integer parentDepth = depths.floor(currentDepth - 1); - var tocItem = new TableOfContentItem(current); + var tocItem = new SectionTreeEntry(current); if (parentDepth == null) { mainSections.add(tocItem); @@ -44,14 +45,16 @@ public class OutlineValidationService { } else { assert last != null; int lastDepth = getHeadlineNumber(last.getHeadline().getClassification()); - - if (lastDepth < parentDepth) { + if (last.getHeadline().getClassification().equals(TABLE_OF_CONTENTS_HEADLINE) && !current.getClassification().equals(TABLE_OF_CONTENTS_HEADLINE)) { + // headline after toc should always start a main section + parentDepth = 1; + } else if (lastDepth < parentDepth) { parentDepth = lastDepth; } else if (lastDepth == currentDepth && last.getParent() != null) { parentDepth = getHeadlineNumber(last.getParent().getHeadline().getClassification()); } - TableOfContentItem parent = lastItemsPerDepth.get(parentDepth); + SectionTreeEntry parent = lastItemsPerDepth.get(parentDepth); parent.addChild(tocItem); } @@ -60,7 +63,10 @@ public class OutlineValidationService { depths.add(currentDepth); } - return new TableOfContents(mainSections); + return new + + SectionTree(mainSections); + } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TableOfContents.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTree.java similarity index 59% rename from layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TableOfContents.java rename to layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTree.java index 8d80cd3..d45378b 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TableOfContents.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTree.java @@ -14,12 +14,12 @@ import lombok.RequiredArgsConstructor; @Data @RequiredArgsConstructor -public class TableOfContents implements Iterable { +public class SectionTree implements Iterable { - private List mainSections = new ArrayList<>(); + private List mainSections = new ArrayList<>(); - public TableOfContents(List mainSections) { + public SectionTree(List mainSections) { this.mainSections = mainSections; } @@ -28,36 +28,36 @@ public class TableOfContents implements Iterable { public List getAllTextPageBlocks() { List allTextPageBlocks = new ArrayList<>(); - for (TableOfContentItem item : mainSections) { + for (SectionTreeEntry item : mainSections) { collectTextPageBlocks(item, allTextPageBlocks); } return allTextPageBlocks; } - private void collectTextPageBlocks(TableOfContentItem item, List textPageBlocks) { + private void collectTextPageBlocks(SectionTreeEntry item, List textPageBlocks) { textPageBlocks.add(item.getHeadline()); - for (TableOfContentItem child : item.getChildren()) { + for (SectionTreeEntry child : item.getChildren()) { collectTextPageBlocks(child, textPageBlocks); } } - public List getAllTableOfContentItems() { + public List getAllTableOfContentItems() { - List allItems = new ArrayList<>(); - for (TableOfContentItem item : mainSections) { + List allItems = new ArrayList<>(); + for (SectionTreeEntry item : mainSections) { collectTableOfContentItems(item, allItems); } return allItems; } - private void collectTableOfContentItems(TableOfContentItem item, List allItems) { + private void collectTableOfContentItems(SectionTreeEntry item, List allItems) { allItems.add(item); - for (TableOfContentItem child : item.getChildren()) { + for (SectionTreeEntry child : item.getChildren()) { collectTableOfContentItems(child, allItems); } } @@ -65,7 +65,7 @@ public class TableOfContents implements Iterable { private boolean containsBlock(TextPageBlock block) { - for (TableOfContentItem existingItem : this.getMainSections()) { + for (SectionTreeEntry existingItem : this.getMainSections()) { if (existingItem.getHeadline().equals(block) || existingItem.contains(block)) { return true; } @@ -74,9 +74,9 @@ public class TableOfContents implements Iterable { } - private boolean containsItem(TableOfContentItem tocItem) { + private boolean containsItem(SectionTreeEntry tocItem) { - for (TableOfContentItem existingItem : this.getMainSections()) { + for (SectionTreeEntry existingItem : this.getMainSections()) { if (existingItem.equals(tocItem) || existingItem.contains(tocItem)) { return true; } @@ -86,18 +86,18 @@ public class TableOfContents implements Iterable { @Override - public @NonNull Iterator iterator() { + public @NonNull Iterator iterator() { - return new TableOfContentItemIterator(mainSections); + return new SectionTreeEntryIterator(mainSections); } - private static class TableOfContentItemIterator implements Iterator { + private static class SectionTreeEntryIterator implements Iterator { - private final Stack> stack = new Stack<>(); + private final Stack> stack = new Stack<>(); - TableOfContentItemIterator(List mainSections) { + SectionTreeEntryIterator(List mainSections) { stack.push(mainSections.iterator()); } @@ -112,10 +112,10 @@ public class TableOfContents implements Iterable { @Override - public TableOfContentItem next() { + public SectionTreeEntry next() { ensureStackTopIsCurrent(); - TableOfContentItem currentItem = stack.peek().next(); + SectionTreeEntry currentItem = stack.peek().next(); if (currentItem.getChildren() != null && !currentItem.getChildren().isEmpty()) { stack.push(currentItem.getChildren() .iterator()); diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TOCEnrichmentService.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTreeBuilderService.java similarity index 94% rename from layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TOCEnrichmentService.java rename to layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTreeBuilderService.java index 03f4702..a4778a1 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TOCEnrichmentService.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTreeBuilderService.java @@ -23,28 +23,28 @@ import lombok.extern.slf4j.Slf4j; @Slf4j @Service -public class TOCEnrichmentService { +public class SectionTreeBuilderService { public void assignSectionBlocksAndImages(ClassificationDocument document) { - TableOfContents toc = document.getTableOfContents(); - Iterator iterator = toc.iterator(); - TableOfContentItem currentTOCItem = null; + SectionTree toc = document.getSectionTree(); + Iterator iterator = toc.iterator(); + SectionTreeEntry currentTOCItem = null; if (iterator.hasNext()) { currentTOCItem = iterator.next(); } List startBlocks = new ArrayList<>(); List startImages = new ArrayList<>(); - TableOfContentItem currentSection = null; + SectionTreeEntry currentSection = null; boolean foundFirstHeadline = false; List headers = new ArrayList<>(); List footers = new ArrayList<>(); TablePageBlock previousTable = null; - List lastFoundTOCItems = new ArrayList<>(); + List lastFoundTOCItems = new ArrayList<>(); for (ClassificationPage page : document.getPages()) { - List currentPageTOCItems = new ArrayList<>(); + List currentPageTOCItems = new ArrayList<>(); List header = new ArrayList<>(); List footer = new ArrayList<>(); for (AbstractPageBlock current : page.getTextBlocks()) { @@ -101,7 +101,7 @@ public class TOCEnrichmentService { Double xMax = null; Double yMax = null; - for (TableOfContentItem tocItem : lastFoundTOCItems) { + for (SectionTreeEntry tocItem : lastFoundTOCItems) { var headline = tocItem.getHeadline(); if (headline.getPage() != page.getPageNumber()) { @@ -169,10 +169,10 @@ public class TOCEnrichmentService { } if (!startBlocks.isEmpty() || !startImages.isEmpty()) { - TableOfContentItem unassigned = new TableOfContentItem(null); + SectionTreeEntry unassigned = new SectionTreeEntry(null); unassigned.setSectionBlocks(startBlocks); unassigned.setImages(startImages); - document.getTableOfContents().getMainSections().add(0, unassigned); + document.getSectionTree().getMainSections().add(0, unassigned); } document.setHeaders(headers); document.setFooters(footers); diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TableOfContentItem.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTreeEntry.java similarity index 68% rename from layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TableOfContentItem.java rename to layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTreeEntry.java index cee3598..da03281 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/TableOfContentItem.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/outline/SectionTreeEntry.java @@ -5,6 +5,7 @@ import java.util.List; import java.util.stream.Collectors; import com.knecon.fforesight.service.layoutparser.processor.model.AbstractPageBlock; +import com.knecon.fforesight.service.layoutparser.processor.model.PageBlockType; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.GenericSemanticNode; import com.knecon.fforesight.service.layoutparser.processor.model.image.ClassifiedImage; import com.knecon.fforesight.service.layoutparser.processor.model.text.TextPageBlock; @@ -14,12 +15,18 @@ import lombok.EqualsAndHashCode; @Data @EqualsAndHashCode(onlyExplicitlyIncluded = true) -public class TableOfContentItem { +public class SectionTreeEntry { + + public enum Type { + SECTION, + SUPER_SECTION, + TOC_SECTION + } @EqualsAndHashCode.Include private TextPageBlock headline; - private List children = new ArrayList<>(); - private TableOfContentItem parent; + private List children = new ArrayList<>(); + private SectionTreeEntry parent; private List sectionBlocks = new ArrayList<>(); private List images = new ArrayList<>(); @@ -27,20 +34,32 @@ public class TableOfContentItem { private GenericSemanticNode section; - public TableOfContentItem(TextPageBlock headline) { + public SectionTreeEntry(TextPageBlock headline) { this.headline = headline; } - public void addChild(TableOfContentItem tableOfContentItem) { + public Type getType() { - children.add(tableOfContentItem); - tableOfContentItem.setParent(this); + if (headline.getClassification().equals(PageBlockType.TABLE_OF_CONTENTS_HEADLINE)) { + return Type.TOC_SECTION; + } + if (children.isEmpty()) { + return Type.SECTION; + } + return Type.SUPER_SECTION; } - public TableOfContentItem getSiblingBefore() { + public void addChild(SectionTreeEntry sectionTreeEntry) { + + children.add(sectionTreeEntry); + sectionTreeEntry.setParent(this); + } + + + public SectionTreeEntry getSiblingBefore() { if (parent != null) { int index = parent.getChildren().indexOf(this); @@ -52,7 +71,7 @@ public class TableOfContentItem { } - public TableOfContentItem getSiblingAfter() { + public SectionTreeEntry getSiblingAfter() { if (parent != null) { int index = parent.getChildren().indexOf(this); @@ -69,7 +88,7 @@ public class TableOfContentItem { if (headline.equals(block)) { return true; } - for (TableOfContentItem child : children) { + for (SectionTreeEntry child : children) { if (child.contains(block)) { return true; } @@ -78,12 +97,12 @@ public class TableOfContentItem { } - public boolean contains(TableOfContentItem tocItem) { + public boolean contains(SectionTreeEntry tocItem) { if (this.equals(tocItem)) { return true; } - for (TableOfContentItem child : children) { + for (SectionTreeEntry child : children) { if (child.contains(tocItem)) { return true; } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/classification/TableOfContentsClassificationService.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/classification/TableOfContentsClassificationService.java index 4cc7a86..28bea50 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/classification/TableOfContentsClassificationService.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/classification/TableOfContentsClassificationService.java @@ -61,7 +61,7 @@ public class TableOfContentsClassificationService { if (end > i + 1) { if (textBlock.textBlock().getClassification() == null) { - textBlock.textBlock().setClassification(PageBlockType.H1); + textBlock.textBlock().setClassification(PageBlockType.TABLE_OF_CONTENTS_HEADLINE); } i = end; } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/DocumentGraphFactory.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/DocumentGraphFactory.java index 1906c28..ddcda89 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/DocumentGraphFactory.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/DocumentGraphFactory.java @@ -23,6 +23,7 @@ import com.knecon.fforesight.service.layoutparser.processor.model.Classification import com.knecon.fforesight.service.layoutparser.processor.model.ClassificationFooter; import com.knecon.fforesight.service.layoutparser.processor.model.ClassificationHeader; import com.knecon.fforesight.service.layoutparser.processor.model.ClassificationPage; +import com.knecon.fforesight.service.layoutparser.processor.model.PageBlockType; import com.knecon.fforesight.service.layoutparser.processor.model.graph.DocumentTree; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.AbstractSemanticNode; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; @@ -35,10 +36,11 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Im import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Page; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Paragraph; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SemanticNode; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContentsItem; import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.AtomicTextBlock; import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock; import com.knecon.fforesight.service.layoutparser.processor.model.image.ClassifiedImage; -import com.knecon.fforesight.service.layoutparser.processor.model.outline.TableOfContentItem; +import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTreeEntry; import com.knecon.fforesight.service.layoutparser.processor.model.text.TextPageBlock; import com.knecon.fforesight.service.layoutparser.processor.utils.IdBuilder; import com.knecon.fforesight.service.layoutparser.processor.utils.TextPositionOperations; @@ -65,7 +67,7 @@ public class DocumentGraphFactory { document.getPages() .forEach(context::buildAndAddPageWithCounter); - addSectionsForToC(layoutParsingType, document, context, documentGraph); + addSections(layoutParsingType, document, context, documentGraph); addHeaderAndFooterToEachPage(document, context); documentGraph.setNumberOfPages(context.pages.size()); @@ -92,18 +94,18 @@ public class DocumentGraphFactory { } - private void addSectionsForToC(LayoutParsingType layoutParsingType, ClassificationDocument classificationDocument, Context context, Document document) { + private void addSections(LayoutParsingType layoutParsingType, ClassificationDocument classificationDocument, Context context, Document document) { - for (TableOfContentItem tocItem : classificationDocument.getTableOfContents()) { - GenericSemanticNode parent = tocItem.getParent() == null ? null : tocItem.getParent().getSection(); + for (SectionTreeEntry sectionTreeEntry : classificationDocument.getSectionTree()) { + GenericSemanticNode parent = sectionTreeEntry.getParent() == null ? null : sectionTreeEntry.getParent().getSection(); Optional section = SectionNodeFactory.addSection(layoutParsingType, parent, - tocItem.getChildren().isEmpty(), - tocItem.getNonEmptySectionBlocks(), - tocItem.getImages(), + sectionTreeEntry.getType(), + sectionTreeEntry.getNonEmptySectionBlocks(), + sectionTreeEntry.getImages(), context, document); - tocItem.setSection(section.orElse(null)); + sectionTreeEntry.setSection(section.orElse(null)); } } @@ -121,6 +123,8 @@ public class DocumentGraphFactory { node = Headline.builder().documentTree(context.getDocumentTree()).build(); } else if (originalTextBlock.isToDuplicate() && layoutParsingType.equals(LayoutParsingType.REDACT_MANAGER)) { node = DuplicatedParagraph.builder().documentTree(context.getDocumentTree()).build(); + } else if (originalTextBlock.getClassification().equals(PageBlockType.TABLE_OF_CONTENTS_ITEM)) { + node = TableOfContentsItem.builder().documentTree(context.getDocumentTree()).build(); } else { node = Paragraph.builder().documentTree(context.getDocumentTree()).build(); } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/SectionNodeFactory.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/SectionNodeFactory.java index 781dcb8..8aa03ba 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/SectionNodeFactory.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/SectionNodeFactory.java @@ -17,7 +17,9 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Do import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.GenericSemanticNode; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Section; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContents; import com.knecon.fforesight.service.layoutparser.processor.model.image.ClassifiedImage; +import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTreeEntry; import com.knecon.fforesight.service.layoutparser.processor.model.table.TablePageBlock; import com.knecon.fforesight.service.layoutparser.processor.model.text.TextPageBlock; import com.knecon.fforesight.service.layoutparser.processor.utils.TableMergingUtility; @@ -29,7 +31,7 @@ public class SectionNodeFactory { public Optional addSection(LayoutParsingType layoutParsingType, GenericSemanticNode parentNode, - boolean isLeaf, + SectionTreeEntry.Type type, List pageBlocks, List images, DocumentGraphFactory.Context context, @@ -48,12 +50,11 @@ public class SectionNodeFactory { return Optional.empty(); } - AbstractSemanticNode section; - if (isLeaf) { - section = Section.builder().documentTree(context.getDocumentTree()).build(); - } else { - section = SuperSection.builder().documentTree(context.getDocumentTree()).build(); - } + AbstractSemanticNode section = switch (type) { + case SECTION -> Section.builder().documentTree(context.getDocumentTree()).build(); + case SUPER_SECTION -> SuperSection.builder().documentTree(context.getDocumentTree()).build(); + case TOC_SECTION -> TableOfContents.builder().documentTree(context.getDocumentTree()).build(); + }; context.getSections().add(section); @@ -64,13 +65,14 @@ public class SectionNodeFactory { if (containsTablesAndTextBlocks) { splitPageBlocksIntoSubSections(pageBlocks).forEach(subSectionPageBlocks -> addSection(layoutParsingType, section, - true, + SectionTreeEntry.Type.SECTION, subSectionPageBlocks, emptyList(), context, document)); - } else if (!isLeaf) { - addSection(layoutParsingType, section, true, pageBlocks, emptyList(), context, document); + } else if (type.equals(SectionTreeEntry.Type.SUPER_SECTION)) { + // If a SuperSection contains more blocks than just a headline, we add a Section which contains the remaining textblocks. + addSection(layoutParsingType, section, SectionTreeEntry.Type.SECTION, pageBlocks, emptyList(), context, document); } else { addTablesAndParagraphsAndHeadlinesToSection(layoutParsingType, pageBlocks, context, section, document); } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/TableNodeFactory.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/TableNodeFactory.java index b8d7d10..58c2bb3 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/TableNodeFactory.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/factory/TableNodeFactory.java @@ -14,6 +14,7 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Pa import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell; import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock; +import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTreeEntry; import com.knecon.fforesight.service.layoutparser.processor.model.table.Cell; import com.knecon.fforesight.service.layoutparser.processor.model.table.TablePageBlock; import com.knecon.fforesight.service.layoutparser.processor.model.text.Word; @@ -120,7 +121,7 @@ public class TableNodeFactory { } else if (firstTextBlockIsHeadline(cell)) { SectionNodeFactory.addSection(layoutParsingType, tableCell, - true, + SectionTreeEntry.Type.SECTION, cell.getTextBlocks() .stream() .map(tb -> (AbstractPageBlock) tb) diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentDataMapper.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentDataMapper.java index 561655d..c74bf63 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentDataMapper.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentDataMapper.java @@ -12,6 +12,7 @@ import java.util.Map; import java.util.Set; import java.util.stream.Collectors; +import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage; @@ -20,7 +21,6 @@ import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.Do import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData.Position; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureWrapper; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine; import com.knecon.fforesight.service.layoutparser.processor.model.graph.DocumentTree; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentGraphMapper.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentGraphMapper.java index bd09579..c9e656f 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentGraphMapper.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/mapper/DocumentGraphMapper.java @@ -1,6 +1,5 @@ package com.knecon.fforesight.service.layoutparser.processor.services.mapper; -import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; @@ -9,9 +8,9 @@ import java.util.NoSuchElementException; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage; +import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; import com.knecon.fforesight.service.layoutparser.processor.model.graph.DocumentTree; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.DuplicatedParagraph; @@ -26,6 +25,8 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Se import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContents; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContentsItem; import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.AtomicTextBlock; import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock; import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlockCollector; @@ -70,13 +71,15 @@ public class DocumentGraphMapper { SemanticNode node = switch (entryData.getType()) { case SECTION -> buildSection(context); case SUPER_SECTION -> buildSuperSection(context); - case PARAGRAPH -> buildParagraph(context, entryData.getProperties()); + case PARAGRAPH -> buildParagraph(context, entryData.getPropertiesMap()); case HEADLINE -> buildHeadline(context); case HEADER -> buildHeader(context); case FOOTER -> buildFooter(context); - case TABLE -> buildTable(context, entryData.getProperties()); - case TABLE_CELL -> buildTableCell(context, entryData.getProperties()); - case IMAGE -> buildImage(context, entryData.getProperties(), entryData.getPageNumbersList()); + case TABLE -> buildTable(context, entryData.getPropertiesMap()); + case TABLE_CELL -> buildTableCell(context, entryData.getPropertiesMap()); + case IMAGE -> buildImage(context, entryData.getPropertiesMap(), entryData.getPageNumbersList()); + case TABLE_OF_CONTENTS -> buildTableOfContents(context); + case TABLE_OF_CONTENTS_ITEM -> buildTableOfContentsItem(context); default -> throw new UnsupportedOperationException("Not yet implemented for type " + entryData.getType()); }; @@ -100,6 +103,18 @@ public class DocumentGraphMapper { } + private static SemanticNode buildTableOfContents(Context context) { + + return TableOfContents.builder().documentTree(context.documentTree).build(); + } + + + private static SemanticNode buildTableOfContentsItem(Context context) { + + return TableOfContentsItem.builder().documentTree(context.documentTree).build(); + } + + private Headline buildHeadline(Context context) { return Headline.builder().documentTree(context.documentTree).build(); @@ -182,13 +197,11 @@ public class DocumentGraphMapper { private AtomicTextBlock getAtomicTextBlock(Context context, SemanticNode parent, Long atomicTextBlockId) { - return AtomicTextBlock.fromAtomicTextBlockData(context.documentTextDataBlockData.getDocumentTextDataList() - .get(Math.toIntExact(atomicTextBlockId)), - context.atomicPositionBlockData.getDocumentPositionDataList() - .get(Math.toIntExact(atomicTextBlockId)), + return AtomicTextBlock.fromAtomicTextBlockData(context.documentTextDataBlockData.getDocumentTextDataList().get(Math.toIntExact(atomicTextBlockId)), + context.atomicPositionBlockData.getDocumentPositionDataList().get(Math.toIntExact(atomicTextBlockId)), parent, - getPage(context.documentTextDataBlockData.getDocumentTextDataList() - .get(Math.toIntExact(atomicTextBlockId)).getPage(), context)); + getPage(context.documentTextDataBlockData.getDocumentTextDataList().get(Math.toIntExact(atomicTextBlockId)).getPage(), + context)); } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/visualization/LayoutGridService.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/visualization/LayoutGridService.java index acdb8ea..77ce16f 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/visualization/LayoutGridService.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/services/visualization/LayoutGridService.java @@ -38,6 +38,7 @@ public class LayoutGridService { layoutGrid.setVisibleByDefault(layerVisibilityDefaultValue); document.getLayoutDebugLayer().addSentenceVisualization(document.getTextBlock()); + document.getLayoutDebugLayer().addOutlineHeadlines(document); if (document.getLayoutDebugLayer().isActive()) { viewerDocumentService.addLayerGroups(originFile, destinationFile, List.of(layoutGrid, document.getLayoutDebugLayer()), outline); @@ -54,12 +55,13 @@ public class LayoutGridService { .peek(layoutGrid::addTreeId) .forEach(semanticNode -> { switch (semanticNode.getType()) { - case SECTION, SUPER_SECTION -> layoutGrid.addSection(semanticNode); + case SECTION, SUPER_SECTION, TABLE_OF_CONTENTS -> layoutGrid.addSection(semanticNode); case HEADLINE -> layoutGrid.addHeadline((Headline) semanticNode); case PARAGRAPH -> layoutGrid.addParagraph((Paragraph) semanticNode); case TABLE -> layoutGrid.addTable((Table) semanticNode); case IMAGE -> layoutGrid.addImage((Image) semanticNode); case HEADER, FOOTER -> layoutGrid.addHeaderOrFooter(semanticNode); + case TABLE_OF_CONTENTS_ITEM -> layoutGrid.addTableOfContentsItem(semanticNode); } }); return layoutGrid; diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/utils/PdfVisualisationUtility.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/utils/PdfVisualisationUtility.java index b79cd8a..6cfdfa0 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/utils/PdfVisualisationUtility.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/utils/PdfVisualisationUtility.java @@ -111,8 +111,8 @@ public class PdfVisualisationUtility { return DrawingOptions.builder().stroke(true).strokeColor(switch (entry.getType()) { case DOCUMENT -> Color.LIGHT_GRAY; case HEADER, FOOTER -> Color.GREEN; - case PARAGRAPH -> Color.BLUE; - case SUPER_SECTION, SECTION -> Color.BLACK; + case PARAGRAPH, TABLE_OF_CONTENTS_ITEM -> Color.BLUE; + case SUPER_SECTION, SECTION, TABLE_OF_CONTENTS -> Color.BLACK; case HEADLINE -> Color.RED; case TABLE -> Color.ORANGE; case TABLE_CELL -> Color.GRAY; diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutDebugLayer.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutDebugLayer.java index c78ee1d..ab096ec 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutDebugLayer.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutDebugLayer.java @@ -15,13 +15,17 @@ import java.util.Set; import java.util.concurrent.atomic.AtomicInteger; import org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDMarkedContent; +import org.checkerframework.checker.units.qual.C; import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Rectangle; +import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto; +import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto; import com.knecon.fforesight.service.layoutparser.processor.docstrum.model.BoundingBox; import com.knecon.fforesight.service.layoutparser.processor.docstrum.model.Line; import com.knecon.fforesight.service.layoutparser.processor.docstrum.model.Zone; import com.knecon.fforesight.service.layoutparser.processor.model.AbstractPageBlock; import com.knecon.fforesight.service.layoutparser.processor.model.graph.TextRange; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock; import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineObject; import com.knecon.fforesight.service.layoutparser.processor.model.table.CleanRulings; @@ -379,4 +383,19 @@ public class LayoutDebugLayer extends LayoutDebugLayerConfig { } } + + public void addOutlineHeadlines(Document document) { + + if (!active) { + return; + } + + document.streamAllSubNodes() + .filter(node -> node.getType().equals(NodeTypeProto.NodeType.HEADLINE)) + .filter(node -> node.getEngines().contains(LayoutEngineProto.LayoutEngine.OUTLINE)) + .forEach(headline -> headline.getBBox() + .forEach((page, bbox) -> getOrCreateVisualizationsOnPage(page.getNumber(), this.outlineHeadlines).getColoredRectangles() + .add(new ColoredRectangle(bbox, HEADLINE_COLOR, LINE_WIDTH)))); + } + } diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutGrid.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutGrid.java index b2822fe..1a50ddf 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutGrid.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/visualization/LayoutGrid.java @@ -26,6 +26,7 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Se import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Table; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableCell; +import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.TableOfContents; import com.knecon.fforesight.service.layoutparser.processor.utils.RectangleTransformations; import com.knecon.fforesight.service.viewerdoc.layers.LayoutGridLayerConfig; import com.knecon.fforesight.service.viewerdoc.model.ColoredLine; @@ -72,10 +73,12 @@ public class LayoutGrid extends LayoutGridLayerConfig { public void addHeadline(Headline headline) { - addAsRectangle(headline, headlines, HEADLINE_COLOR); - if (headline.getEngines().contains(LayoutEngine.OUTLINE)) { - addAsRectangle(headline, outlineHeadlines, HEADLINE_COLOR); + if (headline.getParent().getType().equals(NodeTypeProto.NodeType.TABLE_OF_CONTENTS)) { + addAsRectangle(headline, toc, HEADLINE_COLOR); + } else { + addAsRectangle(headline, headlines, HEADLINE_COLOR); } + } @@ -88,19 +91,10 @@ public class LayoutGrid extends LayoutGridLayerConfig { public void addTreeId(SemanticNode semanticNode) { Page page = semanticNode.getFirstPage(); - if (semanticNode.getBBox() - .get(page) == null) { + if (semanticNode.getBBox().get(page) == null) { return; } - addPlacedText(page, - semanticNode.getBBox() - .get(page), - semanticNode.getBBox() - .get(page), - buildTreeIdString(semanticNode), - 1, - treeIds, - TREEID_COLOR); + addPlacedText(page, semanticNode.getBBox().get(page), semanticNode.getBBox().get(page), buildTreeIdString(semanticNode), 1, treeIds, TREEID_COLOR); } @@ -124,20 +118,19 @@ public class LayoutGrid extends LayoutGridLayerConfig { public void addSection(SemanticNode section) { Map bBoxMap = section.getBBox(); - + Color color = section.getType().equals(NodeTypeProto.NodeType.TABLE_OF_CONTENTS) ? TOC_COLOR : SECTION_COLOR; List subSections = section.streamAllSubNodesOfType(NodeTypeProto.NodeType.SECTION) .toList(); Integer maxChildDepth = subSections.stream() .map(node -> node.getTreeId().size()) - .max(Integer::compareTo) - .orElse(section.getTreeId().size()); + .max(Integer::compareTo).orElse(section.getTreeId().size()); int ownDepth = section.getTreeId().size(); Page firstPage = section.getFirstPage(); String treeIdString = buildTreeIdString(section); if (bBoxMap.values().size() == 1) { - handleSinglePage(section, firstPage, bBoxMap.get(firstPage), treeIdString, maxChildDepth, ownDepth); + handleSinglePage(section, firstPage, bBoxMap.get(firstPage), treeIdString, maxChildDepth, ownDepth, color); return; } List pagesInOrder = bBoxMap.keySet() @@ -145,12 +138,12 @@ public class LayoutGrid extends LayoutGridLayerConfig { .sorted(Comparator.comparingInt(Page::getNumber)) .collect(Collectors.toList()); pagesInOrder.remove(0); - handleFirstPageOfSection(section, firstPage, bBoxMap.get(firstPage), treeIdString, maxChildDepth, ownDepth); + handleFirstPageOfSection(section, firstPage, bBoxMap.get(firstPage), treeIdString, maxChildDepth, ownDepth, color); for (Page middlePage : pagesInOrder.subList(0, pagesInOrder.size() - 1)) { - handleForMiddlePageOfSection(section, middlePage, bBoxMap.get(middlePage), treeIdString, maxChildDepth, ownDepth); + handleForMiddlePageOfSection(section, middlePage, bBoxMap.get(middlePage), treeIdString, maxChildDepth, ownDepth, color); } var lastPage = pagesInOrder.remove(pagesInOrder.size() - 1); - handleLastPageOfSection(section, lastPage, bBoxMap.get(lastPage), treeIdString, maxChildDepth, ownDepth); + handleLastPageOfSection(section, lastPage, bBoxMap.get(lastPage), treeIdString, maxChildDepth, ownDepth, color); } @@ -232,33 +225,45 @@ public class LayoutGrid extends LayoutGridLayerConfig { } - private void handleSinglePage(SemanticNode semanticNode, Page page, Rectangle2D rectangle2D, String treeIdString, Integer maxChildDepth, Integer ownDepth) { + private void handleSinglePage(SemanticNode semanticNode, Page page, Rectangle2D rectangle2D, String treeIdString, Integer maxChildDepth, Integer ownDepth, Color color) { RectangleAndLinesResult result = createLinesAndPlaceText(semanticNode, page, rectangle2D, treeIdString, maxChildDepth, ownDepth); // add string to top line var firstLine = result.pageLines().remove(0); - result.coloredLines().add(new ColoredLine(firstLine, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(firstLine, color, LINE_WIDTH)); for (Line2D line : result.pageLines()) { - result.coloredLines().add(new ColoredLine(line, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(line, color, LINE_WIDTH)); } } - private void handleFirstPageOfSection(SemanticNode semanticNode, Page firstPage, Rectangle2D rectangle2D, String treeIdString, Integer maxChildDepth, Integer ownDepth) { + private void handleFirstPageOfSection(SemanticNode semanticNode, + Page firstPage, + Rectangle2D rectangle2D, + String treeIdString, + Integer maxChildDepth, + Integer ownDepth, + Color color) { RectangleAndLinesResult result = createLinesAndPlaceText(semanticNode, firstPage, rectangle2D, treeIdString, maxChildDepth, ownDepth); // remove bottom line result.pageLines().remove(2); // add string to top line var firstLine = result.pageLines().remove(0); - result.coloredLines().add(new ColoredLine(firstLine, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(firstLine, color, LINE_WIDTH)); for (Line2D line : result.pageLines()) { - result.coloredLines().add(new ColoredLine(line, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(line, color, LINE_WIDTH)); } } - private void handleForMiddlePageOfSection(SemanticNode semanticNode, Page middlePage, Rectangle2D rectangle2D, String treeIdString, Integer maxChildDepth, Integer ownDepth) { + private void handleForMiddlePageOfSection(SemanticNode semanticNode, + Page middlePage, + Rectangle2D rectangle2D, + String treeIdString, + Integer maxChildDepth, + Integer ownDepth, + Color color) { RectangleAndLinesResult result = createLinesAndPlaceText(semanticNode, middlePage, rectangle2D, treeIdString, maxChildDepth, ownDepth); // remove top line @@ -267,23 +272,29 @@ public class LayoutGrid extends LayoutGridLayerConfig { result.pageLines().remove(1); // add string to left line var leftLine = result.pageLines().remove(1); - result.coloredLines().add(new ColoredLine(leftLine, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(leftLine, color, LINE_WIDTH)); for (Line2D line : result.pageLines()) { - result.coloredLines().add(new ColoredLine(line, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(line, color, LINE_WIDTH)); } } - private void handleLastPageOfSection(SemanticNode semanticNode, Page lastPage, Rectangle2D rectangle2D, String treeIdString, Integer maxChildDepth, Integer ownDepth) { + private void handleLastPageOfSection(SemanticNode semanticNode, + Page lastPage, + Rectangle2D rectangle2D, + String treeIdString, + Integer maxChildDepth, + Integer ownDepth, + Color color) { RectangleAndLinesResult result = createLinesAndPlaceText(semanticNode, lastPage, rectangle2D, treeIdString, maxChildDepth, ownDepth); // remove top line result.pageLines().remove(0); // add string to left line var leftLine = result.pageLines().remove(2); - result.coloredLines().add(new ColoredLine(leftLine, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(leftLine, color, LINE_WIDTH)); for (Line2D line : result.pageLines()) { - result.coloredLines().add(new ColoredLine(line, SECTION_COLOR, LINE_WIDTH)); + result.coloredLines().add(new ColoredLine(line, color, LINE_WIDTH)); } } @@ -295,14 +306,14 @@ public class LayoutGrid extends LayoutGridLayerConfig { Integer maxChildDepth, Integer ownDepth) { - List coloredLines = getOrCreateVisualizationsOnPage(page.getNumber(), sections).getColoredLines(); + Visualizations visualizations = semanticNode.getType().equals(NodeTypeProto.NodeType.TABLE_OF_CONTENTS) ? toc : sections; + List coloredLines = getOrCreateVisualizationsOnPage(page.getNumber(), visualizations).getColoredLines(); int lineWidthModifier = maxChildDepth - ownDepth; - Rectangle2D r = RectangleTransformations.pad(semanticNode.getBBox() - .get(page), LINE_WIDTH * (1 + lineWidthModifier), LINE_WIDTH * (1 + lineWidthModifier)); + Rectangle2D r = RectangleTransformations.pad(semanticNode.getBBox().get(page), LINE_WIDTH * (1 + lineWidthModifier), LINE_WIDTH * (1 + lineWidthModifier)); SemanticNode highestParent = semanticNode.getHighestParent(); Rectangle2D highestParentRect = rectangleMap.get(new RectangleIdentifier(highestParent.getTreeId(), page.getNumber())); - addPlacedText(page, rectangle2D, highestParentRect, treeIdString, maxChildDepth, sections, SECTION_COLOR); + addPlacedText(page, rectangle2D, highestParentRect, treeIdString, maxChildDepth, visualizations, SECTION_COLOR); var lastPageLines = createLinesFromRectangle(r, page.getRotation()); if (semanticNode instanceof SuperSection) { @@ -347,8 +358,7 @@ public class LayoutGrid extends LayoutGridLayerConfig { List ys = yStream.collect(Collectors.toList()); ys.remove(0); - Rectangle2D tableBBox = table.getBBox() - .get(page); + Rectangle2D tableBBox = table.getBBox().get(page); List coloredLines = getOrCreateVisualizationsOnPage(page.getNumber(), tables).getColoredLines(); xs.forEach(x -> { @@ -384,6 +394,12 @@ public class LayoutGrid extends LayoutGridLayerConfig { } + public void addTableOfContentsItem(SemanticNode semanticNode) { + + addAsRectangle(semanticNode, toc, PARAGRAPH_COLOR); + } + + private record RectangleAndLinesResult(List coloredLines, Rectangle2D rectangle, List pageLines) { } diff --git a/layoutparser-service/layoutparser-service-server/build.gradle.kts b/layoutparser-service/layoutparser-service-server/build.gradle.kts index 81a8667..9a5c2ea 100644 --- a/layoutparser-service/layoutparser-service-server/build.gradle.kts +++ b/layoutparser-service/layoutparser-service-server/build.gradle.kts @@ -45,7 +45,6 @@ dependencies { // for integration testing only testImplementation(project(":viewer-doc-processor")) testImplementation(project(":layoutparser-service-internal-api")) - testImplementation("com.google.protobuf:protobuf-java-util:4.27.1") testImplementation("org.springframework.boot:spring-boot-starter-amqp:${springBootStarterVersion}") testImplementation("org.springframework.boot:spring-boot-starter-test:${springBootStarterVersion}") diff --git a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/OutlineDetectionTest.java b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/OutlineDetectionTest.java index 374e8f5..7488deb 100644 --- a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/OutlineDetectionTest.java +++ b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/OutlineDetectionTest.java @@ -10,7 +10,6 @@ import java.util.Collection; import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.function.Predicate; import org.apache.commons.lang3.StringUtils; import org.junit.jupiter.api.BeforeEach; @@ -28,7 +27,7 @@ import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Se import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SuperSection; import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineObject; import com.knecon.fforesight.service.layoutparser.processor.model.outline.OutlineObjectTree; -import com.knecon.fforesight.service.layoutparser.processor.model.outline.TableOfContents; +import com.knecon.fforesight.service.layoutparser.processor.model.outline.SectionTree; import com.knecon.fforesight.service.layoutparser.processor.python_api.model.table.TableServiceResponse; import com.knecon.fforesight.service.layoutparser.processor.python_api.model.table.VisualLayoutParsingResponse; import com.knecon.fforesight.service.layoutparser.processor.services.factory.DocumentGraphFactory; @@ -100,10 +99,10 @@ public class OutlineDetectionTest extends AbstractTest { .flatMap(Collection::stream) .allMatch(OutlineObject::isFound)); - TableOfContents tableOfContents = classificationDocument.getTableOfContents(); + SectionTree sectionTree = classificationDocument.getSectionTree(); - assertEquals(tableOfContents.getMainSections().size(), 9); - assertEquals(tableOfContents.getMainSections().subList(1, 9) + assertEquals(sectionTree.getMainSections().size(), 9); + assertEquals(sectionTree.getMainSections().subList(1, 9) .stream() .map(tableOfContentItem -> sanitizeString(tableOfContentItem.getHeadline().toString())) .toList(), @@ -121,14 +120,14 @@ public class OutlineDetectionTest extends AbstractTest { // assertEquals(tableOfContents.getMainSections().get(6).getImages().size(), 1); // assertEquals(tableOfContents.getMainSections().get(8).getChildren().get(2).getChildren().get(0).getChildren().get(2).getImages().size(), 1); - assertTrue(tableOfContents.getAllTableOfContentItems() + assertTrue(sectionTree.getAllTableOfContentItems() .stream() .allMatch(tableOfContentItem -> tableOfContentItem.getSection() != null)); - assertTrue(tableOfContents.getAllTableOfContentItems() + assertTrue(sectionTree.getAllTableOfContentItems() .stream() .filter(tableOfContentItem -> tableOfContentItem.getChildren().isEmpty()) .allMatch(tableOfContentItem -> tableOfContentItem.getSection() instanceof Section)); - assertTrue(tableOfContents.getAllTableOfContentItems() + assertTrue(sectionTree.getAllTableOfContentItems() .stream() .filter(tableOfContentItem -> !tableOfContentItem.getChildren().isEmpty()) .allMatch(tableOfContentItem -> tableOfContentItem.getSection() instanceof SuperSection)); diff --git a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/segmentation/PdfSegmentationServiceTest.java b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/segmentation/PdfSegmentationServiceTest.java index a43edcb..e2e11de 100644 --- a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/segmentation/PdfSegmentationServiceTest.java +++ b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/segmentation/PdfSegmentationServiceTest.java @@ -150,14 +150,14 @@ public class PdfSegmentationServiceTest extends AbstractTest { var tableServiceResponse = objectMapper.readValue(cvTablesResource.getInputStream(), TableServiceResponse.class); ClassificationDocument document = buildClassificationDocument(pdfFileResource.getFile(), tableServiceResponse); - assertThat(document.getTableOfContents().getAllTableOfContentItems() + assertThat(document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() .filter(abstractPageBlock -> abstractPageBlock instanceof TablePageBlock)) .map(abstractPageBlock -> (TablePageBlock) abstractPageBlock) .toList()).isNotEmpty(); - var tables = document.getTableOfContents().getAllTableOfContentItems() + var tables = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -203,14 +203,14 @@ public class PdfSegmentationServiceTest extends AbstractTest { ClassPathResource pdfFileResource = new ClassPathResource("files/syngenta/CustomerFiles/SinglePages/Spanning Cells - Page131_S-Metolachlor_RAR_01_Volume_1_2018-09-06.pdf"); ClassificationDocument document = buildClassificationDocument(pdfFileResource.getFile()); - assertThat(document.getTableOfContents().getAllTableOfContentItems() + assertThat(document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() .filter(abstractPageBlock -> abstractPageBlock instanceof TablePageBlock)) .map(abstractPageBlock -> (TablePageBlock) abstractPageBlock) .toList()).isNotEmpty(); - TablePageBlock table = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock table = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -233,14 +233,14 @@ public class PdfSegmentationServiceTest extends AbstractTest { "files/syngenta/CustomerFiles/SinglePages/Merge Table - Page5_26 A8637C - EU AIR3 - LCP Section 10 - Ecotoxicological studies on the plant protection product - Reference list.pdf"); ClassificationDocument document = buildClassificationDocument(pdfFileResource.getFile()); - assertThat(document.getTableOfContents().getAllTableOfContentItems() + assertThat(document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() .filter(abstractPageBlock -> abstractPageBlock instanceof TablePageBlock)) .map(abstractPageBlock -> (TablePageBlock) abstractPageBlock) .toList()).isNotEmpty(); - TablePageBlock firstTable = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock firstTable = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -250,7 +250,7 @@ public class PdfSegmentationServiceTest extends AbstractTest { .get(0); assertThat(firstTable.getColCount()).isEqualTo(8); assertThat(firstTable.getRowCount()).isEqualTo(1); - TablePageBlock secondTable = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock secondTable = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -280,14 +280,14 @@ public class PdfSegmentationServiceTest extends AbstractTest { "files/syngenta/CustomerFiles/SinglePages/Merge Multi Page Table - Page4_Page5_51 Fludioxonil_RAR_02_Volume_2_2018-02-21.pdf"); ClassificationDocument document = buildClassificationDocument(pdfFileResource.getFile()); - assertThat(document.getTableOfContents().getAllTableOfContentItems() + assertThat(document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() .filter(abstractPageBlock -> abstractPageBlock instanceof TablePageBlock)) .map(abstractPageBlock -> (TablePageBlock) abstractPageBlock) .toList()).isNotEmpty(); - TablePageBlock firstTable = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock firstTable = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -297,7 +297,7 @@ public class PdfSegmentationServiceTest extends AbstractTest { .get(0); assertThat(firstTable.getColCount()).isEqualTo(9); assertThat(firstTable.getRowCount()).isEqualTo(5); - TablePageBlock secondTable = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock secondTable = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -327,14 +327,14 @@ public class PdfSegmentationServiceTest extends AbstractTest { "files/syngenta/CustomerFiles/SinglePages/Rotated Table Headers - Page4_65 Mesotrione - EU AIR3 - LCA Section 1 Supplement Reference List.pdf"); ClassificationDocument document = buildClassificationDocument(pdfFileResource.getFile()); - assertThat(document.getTableOfContents().getAllTableOfContentItems() + assertThat(document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() .filter(abstractPageBlock -> abstractPageBlock instanceof TablePageBlock)) .map(abstractPageBlock -> (TablePageBlock) abstractPageBlock) .toList()).isNotEmpty(); - TablePageBlock firstTable = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock firstTable = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -344,7 +344,7 @@ public class PdfSegmentationServiceTest extends AbstractTest { .get(0); assertThat(firstTable.getColCount()).isEqualTo(8); assertThat(firstTable.getRowCount()).isEqualTo(1); - TablePageBlock secondTable = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock secondTable = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -844,7 +844,7 @@ public class PdfSegmentationServiceTest extends AbstractTest { @SneakyThrows private void toHtml(ClassificationDocument document, String filename) { - var tables = document.getTableOfContents().getAllTableOfContentItems() + var tables = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -871,7 +871,7 @@ public class PdfSegmentationServiceTest extends AbstractTest { private void validateTable(ClassificationDocument document, int tableIndex, int colCount, int rowCount, int emptyCellsCountCorrect, int emptyCellsCountIncorrect) { - TablePageBlock table = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock table = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -901,7 +901,7 @@ public class PdfSegmentationServiceTest extends AbstractTest { private void validateTable(ClassificationDocument document, int tableIndex, List> values) { - TablePageBlock table = document.getTableOfContents().getAllTableOfContentItems() + TablePageBlock table = document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() @@ -929,7 +929,7 @@ public class PdfSegmentationServiceTest extends AbstractTest { private void validateTableSize(ClassificationDocument document, int tableSize) { - assertThat(document.getTableOfContents().getAllTableOfContentItems() + assertThat(document.getSectionTree().getAllTableOfContentItems() .stream() .flatMap(tocItem -> tocItem.getSectionBlocks() .stream() diff --git a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/services/RulingCleaningServiceTest.java b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/services/RulingCleaningServiceTest.java index 747813d..0943b76 100644 --- a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/services/RulingCleaningServiceTest.java +++ b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/services/RulingCleaningServiceTest.java @@ -18,8 +18,8 @@ import org.springframework.core.io.ClassPathResource; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureWrapper; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType; +import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData; import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingType; import com.knecon.fforesight.service.layoutparser.processor.model.PageContents; import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; diff --git a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/utils/visualizations/PdfDraw.java b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/utils/visualizations/PdfDraw.java index 6abba6b..f895a14 100644 --- a/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/utils/visualizations/PdfDraw.java +++ b/layoutparser-service/layoutparser-service-server/src/test/java/com/knecon/fforesight/service/layoutparser/server/utils/visualizations/PdfDraw.java @@ -227,9 +227,9 @@ public class PdfDraw { return DrawingOptions.builder().stroke(true).strokeColor(switch (entry.getType()) { case DOCUMENT -> Color.LIGHT_GRAY; case HEADER, FOOTER -> Color.GREEN; - case PARAGRAPH -> Color.BLUE; + case PARAGRAPH, TABLE_OF_CONTENTS_ITEM -> Color.BLUE; case HEADLINE -> Color.RED; - case SECTION, SUPER_SECTION -> Color.BLACK; + case SECTION, SUPER_SECTION, TABLE_OF_CONTENTS -> Color.BLACK; case TABLE -> Color.ORANGE; case TABLE_CELL -> Color.GRAY; case IMAGE -> Color.MAGENTA; diff --git a/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/LayerIdentifier.java b/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/LayerIdentifier.java index 54f2f07..72a2755 100644 --- a/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/LayerIdentifier.java +++ b/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/LayerIdentifier.java @@ -40,7 +40,7 @@ public record LayerIdentifier(String name, String markedContentName) { public static final LayerIdentifier KNECON_LAYOUT_FIGURES = new LayerIdentifier("Figures", "LAYOUT_FIGURES"); public static final LayerIdentifier KNECON_LAYOUT_IMAGES = new LayerIdentifier("Images", "LAYOUT_IMAGES"); public static final LayerIdentifier KNECON_LAYOUT_TREE_IDs = new LayerIdentifier("Tree IDs", "LAYOUT_TREE_IDs"); - public static final LayerIdentifier OUTLINE_HEADLINES = new LayerIdentifier("Outline Headlines", "OUTLINE_HEADLINES"); + public static final LayerIdentifier KNECON_LAYOUT_TOC = new LayerIdentifier("Table of Contents", "TABLE_OF_CONTENTS"); //layout grid debug public static final LayerIdentifier KNECON_LAYOUT_DEBUG = new LayerIdentifier("Layout elements", "DEBUG_LAYOUT"); @@ -55,6 +55,7 @@ public record LayerIdentifier(String name, String markedContentName) { public static final LayerIdentifier NEIGHBOURS = new LayerIdentifier("Neighbours", "NEIGHBOURS"); public static final LayerIdentifier CHARACTERS = new LayerIdentifier("Characters", "CHARACTERS"); public static final LayerIdentifier OUTLINE_OBJECTS = new LayerIdentifier("Outline Positions", "OUTLINE_OBJECTS"); + public static final LayerIdentifier OUTLINE_HEADLINES = new LayerIdentifier("Outline Headlines", "OUTLINE_HEADLINES"); public static final LayerIdentifier SENTENCES = new LayerIdentifier("Sentences", "SENTENCES"); public static final LayerIdentifier TOC_PAGES = new LayerIdentifier("TOC pages", "TOC_PAGES"); public static final LayerIdentifier TOC_BLOCKS = new LayerIdentifier("TOC blocks", "TOC_BLOCKS"); diff --git a/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutDebugLayerConfig.java b/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutDebugLayerConfig.java index 919a041..e871e8b 100644 --- a/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutDebugLayerConfig.java +++ b/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutDebugLayerConfig.java @@ -32,6 +32,8 @@ public class LayoutDebugLayerConfig extends AbstractLayerGroup { protected static final Color UNDERLINE_RULING_COLOR = new Color(6, 39, 171); protected static final Color STRIKETROUGH_RULING_COLOR = new Color(171, 6, 6); + protected static final Color HEADLINE_COLOR = new Color(162, 56, 56); + protected static final Color CELLS_COLOR = new Color(31, 214, 27); protected static final Color OUTLINE_OBJECT_COLOR = new Color(214, 27, 183); @@ -62,7 +64,7 @@ public class LayoutDebugLayerConfig extends AbstractLayerGroup { protected final Visualizations tocPages = Visualizations.builder().layer(LayerIdentifier.TOC_PAGES).build(); protected final Visualizations tocBlocks = Visualizations.builder().layer(LayerIdentifier.TOC_BLOCKS).build(); protected final Visualizations listIdentifiers = Visualizations.builder().layer(LayerIdentifier.LIST_IDENTIFIERS).build(); - + protected final Visualizations outlineHeadlines = Visualizations.builder().layer(LayerIdentifier.OUTLINE_HEADLINES).build(); public List getVisualizations() { @@ -78,6 +80,7 @@ public class LayoutDebugLayerConfig extends AbstractLayerGroup { mainBody, // markedContent, // outlineObjects, // + outlineHeadlines, // tocPages, // tocBlocks, // listIdentifiers // diff --git a/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutGridLayerConfig.java b/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutGridLayerConfig.java index a959fe1..0cf76a4 100644 --- a/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutGridLayerConfig.java +++ b/layoutparser-service/viewer-doc-processor/src/main/java/com/knecon/fforesight/service/viewerdoc/layers/LayoutGridLayerConfig.java @@ -34,8 +34,10 @@ public class LayoutGridLayerConfig extends AbstractLayerGroup { protected static final Color KEY_VALUE_BBOX_COLOR = new Color(0, 39, 85); protected static final Color KEY_COLOR = new Color(30, 92, 172); protected static final Color VALUE_COLOR = new Color(30, 172, 146); + protected static final Color TOC_COLOR = new Color(0, 86, 198); protected final Visualizations sections = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_SECTION).visibleByDefault(true).build(); + protected final Visualizations toc = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_TOC).visibleByDefault(true).build(); protected final Visualizations paragraphs = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_PARAGRAPH).visibleByDefault(true).build(); protected final Visualizations headlines = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_HEADLINE).visibleByDefault(true).build(); protected final Visualizations tables = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_TABLE).visibleByDefault(true).build(); @@ -44,12 +46,12 @@ public class LayoutGridLayerConfig extends AbstractLayerGroup { protected final Visualizations images = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_IMAGES).build(); protected final Visualizations keyValue = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_KEY_VALUE).build(); protected final Visualizations treeIds = Visualizations.builder().layer(LayerIdentifier.KNECON_LAYOUT_TREE_IDs).build(); - protected final Visualizations outlineHeadlines = Visualizations.builder().layer(LayerIdentifier.OUTLINE_HEADLINES).build(); + @Override public List getVisualizations() { - return List.of(headlines, paragraphs, tables, sections, headerFooter, keyValue, figures, images, treeIds, outlineHeadlines); + return List.of(headlines, paragraphs, tables, sections, headerFooter, toc, keyValue, figures, images, treeIds); } }