diff --git a/buildSrc/src/main/kotlin/com.knecon.fforesight.java-conventions.gradle.kts b/buildSrc/src/main/kotlin/com.knecon.fforesight.java-conventions.gradle.kts index 9448262..4153ec7 100644 --- a/buildSrc/src/main/kotlin/com.knecon.fforesight.java-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/com.knecon.fforesight.java-conventions.gradle.kts @@ -8,6 +8,8 @@ plugins { group = "com.knecon.fforesight" +val documentVersion by rootProject.extra { "document7" } + java.sourceCompatibility = JavaVersion.VERSION_17 java.targetCompatibility = JavaVersion.VERSION_17 diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentData.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentData.java deleted file mode 100644 index 8131ae4..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentData.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -import java.io.Serializable; - -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.AllDocumentPages; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.AllDocumentPositionData; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.AllDocumentTextData; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.experimental.FieldDefaults; - -@Data -@Builder -@AllArgsConstructor -@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE) -@Schema(description = "Object containing the complete document layout parsing information. It is split into 4 categories, structure, text, positions and pages: " - + "The document tree structure of SemanticNodes such as Section, Paragraph, Headline, etc. " - + "The text, which is stored as separate blocks of data. " - + "The text positions, which are also stored as separate blocks. The Blocks are equal to the text blocks in length and order. " - + "The page information.") -public class DocumentData implements Serializable { - - @Schema(description = "Contains information about the document's pages.") - AllDocumentPages documentPages; - @Schema(description = "Contains information about the document's text.") - AllDocumentTextData documentTextData; - @Schema(description = "Contains information about the document's text positions.") - AllDocumentPositionData documentPositions; - @Schema(description = "Contains information about the document's semantic structure.") - DocumentStructureWrapper documentStructureWrapper; - - - public DocumentStructure getDocumentStructure() { - - return documentStructureWrapper.getDocumentStructure(); - } - -} diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPage.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPage.java deleted file mode 100644 index f104118..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPage.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -import java.io.Serializable; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.FieldDefaults; - -@Deprecated -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@FieldDefaults(level = AccessLevel.PRIVATE) -@Schema(description = "Object containing information about the document's pages.") -public class DocumentPage implements Serializable { - - @Schema(description = "The page number, starting with 1.") - int number; - @Schema(description = "The page height in PDF user units.", example = "792") - int height; - @Schema(description = "The page width in PDF user units.", example = "694") - int width; - @Schema(description = "The page rotation as specified by the PDF.", example = "90", allowableValues = {"0", "90", "180", "270"}) - int rotation; - -} 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 deleted file mode 100644 index 14df3f9..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPageProto.java +++ /dev/null @@ -1,1545 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: DocumentPage.proto -// 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) { - } - - 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= */ 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 final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.internal_static_AllDocumentPages_descriptor; - } - - @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 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 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; - } - - @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); - } - - // 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; - } - - @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; - } - - @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 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); - } - 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(); - } - } 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: { - 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_; - - 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< - 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(); - } - 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(); - } - ensureDocumentPagesIsMutable(); - documentPages_.add(value); - onChanged(); - } else { - documentPagesBuilder_.addMessage(value); - } - 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); - } - 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()); - } - 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()); - } - 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 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); - } - } - /** - * 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 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) - } - - // @@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 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; - } - - @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); - } - - // 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; - } - - @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; - } - - 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_; - } - 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 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 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()); - } - 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; - 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; - 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; - 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; - 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 com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPageProto.DocumentPage(); - } - - 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/DocumentPositionData.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPositionData.java deleted file mode 100644 index 0a1f315..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPositionData.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -import java.io.Serializable; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.FieldDefaults; - -@Deprecated -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@FieldDefaults(level = AccessLevel.PRIVATE) -@Schema(description = "Object containing text positional information of a specific text block. A document is split into multiple text blocks, which are supposed to be read in order. Every text block can only occur on a single page.") -public class DocumentPositionData implements Serializable { - - @Schema(description = "Identifier of the text block.") - Long id; - @Schema(description = "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.") - int[] stringIdxToPositionIdx; - @Schema(description = "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.") - float[][] positions; - -} 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 deleted file mode 100644 index 2848ea4..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentPositionDataProto.java +++ /dev/null @@ -1,2653 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: DocumentPositionData.proto -// 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) { - } - - 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= */ 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 final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_AllDocumentPositionData_descriptor; - } - - @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 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 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; - } - - @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); - } - - // 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; - } - - @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; - } - - @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 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_; - } - - @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 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() { - - } - - 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 com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.internal_static_DocumentPositionData_Position_descriptor; - } - - @java.lang.Override - 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(); - } - - @java.lang.Override - 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; - } - - @java.lang.Override - 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_; - } - } - - @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; - } - - @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 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 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; - } - - @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); - } - - // 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; - } - - @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; - } - - @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); - } - 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); - } - 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_); - } - 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: { - 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) { - 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; - 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) { - - 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) { - - 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(); - } - } - /** - *
-       * 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(); - } - } - /** - *
-       * 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); - } - } - /** - *
-       * 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); - } - 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) - } - - // @@protoc_insertion_point(class_scope:DocumentPositionData) - private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentPositionDataProto.DocumentPositionData(); - } - - 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/DocumentStructure.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructure.java deleted file mode 100644 index 4bf9558..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructure.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -import java.awt.geom.Rectangle2D; -import java.io.Serializable; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Stream; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.FieldDefaults; - -@Deprecated -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@FieldDefaults(level = AccessLevel.PRIVATE) -@Schema(description = "Object containing information about the parsed tree structure of the SemanticNodes, such as Section, Paragraph, Headline etc inside of the document.") -public class DocumentStructure implements Serializable { - - @Schema(description = "The root EntryData represents the Document.") - EntryData root; - - @Schema(description = "Object containing the extra field names, a table has in its properties field.") - public static class TableProperties implements Serializable { - - public static final String NUMBER_OF_ROWS = "numberOfRows"; - public static final String NUMBER_OF_COLS = "numberOfCols"; - - } - - @Schema(description = "Object containing the extra field names, an Image has in its properties field.") - public static class ImageProperties implements Serializable { - - public static final String TRANSPARENT = "transparent"; - public static final String IMAGE_TYPE = "imageType"; - public static final String POSITION = "position"; - public static final String ID = "id"; - - public static final String REPRESENTATION_HASH = "representationHash"; - - } - - @Schema(description = "Object containing the extra field names, a table cell has in its properties field.") - public static class TableCellProperties implements Serializable { - - public static final String B_BOX = "bBox"; - public static final String ROW = "row"; - public static final String COL = "col"; - public static final String HEADER = "header"; - - } - - @Schema(description = "Object containing the extra field names, a duplicate paragraph has in its properties field.") - public static class DuplicateParagraphProperties implements Serializable { - - public static final String UNSORTED_TEXTBLOCK_ID = "utbid"; - - } - - public static final String RECTANGLE_DELIMITER = ";"; - - - public static Rectangle2D parseRectangle2D(String bBox) { - - List floats = Arrays.stream(bBox.split(RECTANGLE_DELIMITER)) - .map(Float::parseFloat) - .toList(); - return new Rectangle2D.Float(floats.get(0), floats.get(1), floats.get(2), floats.get(3)); - } - - - public static double[] parseRepresentationVector(String representationHash) { - - String[] stringArray = representationHash.split("[,\\s]+"); - double[] doubleArray = new double[stringArray.length]; - for (int i = 0; i < stringArray.length; i++) { - doubleArray[i] = Double.parseDouble(stringArray[i]); - } - - return doubleArray; - } - - - public EntryData get(List tocId) { - - if (tocId.isEmpty()) { - return root; - } - EntryData entry = root.children.get(tocId.get(0)); - for (int id : tocId.subList(1, tocId.size())) { - entry = entry.children.get(id); - } - return entry; - } - - - public Stream streamAllEntries() { - - return Stream.concat(Stream.of(root), root.children.stream()) - .flatMap(DocumentStructure::flatten); - } - - - public String toString() { - - return String.join("\n", - streamAllEntries().map(EntryData::toString) - .toList()); - } - - - private static Stream flatten(EntryData entry) { - - return Stream.concat(Stream.of(entry), - entry.children.stream() - .flatMap(DocumentStructure::flatten)); - } - - - @Data - @Builder - @NoArgsConstructor - @AllArgsConstructor - @FieldDefaults(level = AccessLevel.PRIVATE) - @Schema(description = "Object containing information of a SemanticNode and also structuring the layout with children.") - public static class EntryData implements Serializable { - - @Schema(description = "Type of the semantic node.", allowableValues = {"DOCUMENT", "SECTION", "PARAGRAPH", "HEADLINE", "TABLE", "TABLE_CELL", "HEADER", "FOOTER", "IMAGE"}) - NodeType type; - @Schema(description = "Specifies the position in the parsed tree structure.", example = "[1, 0, 2]") - int[] treeId; - @Schema(description = "Specifies the text block IDs associated with this semantic node. The value should be joined with the DocumentTextData/DocumentPositionData. Is empty, if no text block is directly associated with this semantic node. Only Paragraph, Headline, Header or Footer is directly associated with a text block.", example = "[1]") - Long[] atomicBlockIds; - @Schema(description = "Specifies the pages this semantic node appears on. The value should be joined with the PageData.", example = "[1, 2, 3]") - Long[] pageNumbers; - @Schema(description = "Some semantic nodes have additional information, this information is stored in this Map. The extra fields are specified by the Properties subclasses.", example = "For a Table: {\"numberOfRows\": 3, \"numberOfCols\": 4}") - Map properties; - @Schema(description = "All child Entries of this Entry.", example = "[1, 2, 3]") - List children; - @Schema(description = "Describes the origin of the semantic node", example = "[ALGORITHM]") - Set engines; - - - @Override - public String toString() { - - StringBuilder sb = new StringBuilder(); - sb.append("["); - for (int i : treeId) { - sb.append(i); - sb.append(","); - } - sb.delete(sb.length() - 1, sb.length()); - sb.append("]: "); - - sb.append(type); - sb.append(" atbs = "); - sb.append(atomicBlockIds.length); - - return sb.toString(); - } - - } - -} 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 deleted file mode 100644 index 7604748..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureProto.java +++ /dev/null @@ -1,694 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: DocumentStructure.proto -// 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) { - } - - 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= */ 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 final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.internal_static_DocumentStructure_descriptor; - } - - @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); - } - - 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 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; - } - - @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); - } - - // 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(); - } - } - @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; - } - - @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; - } - - 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_; - } - - @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; - } - } - - 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; - } - - @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: { - 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 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(); - } - } - /** - *
-       * 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); - } - 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()); - } - 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); - } - 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 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) - } - - // @@protoc_insertion_point(class_scope:DocumentStructure) - private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentStructureProto.DocumentStructure(); - } - - 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 deleted file mode 100644 index 98a65a5..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentStructureWrapper.java +++ /dev/null @@ -1,124 +0,0 @@ -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.Serializable; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Stream; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AllArgsConstructor; -import lombok.Getter; - -@Getter -@AllArgsConstructor -public class DocumentStructureWrapper implements Serializable { - - private final DocumentStructure documentStructure; - - - @Schema(description = "Object containing the extra field names, a table has in its properties field.") - public static class TableProperties implements Serializable { - - public static final String NUMBER_OF_ROWS = "numberOfRows"; - public static final String NUMBER_OF_COLS = "numberOfCols"; - - } - - @Schema(description = "Object containing the extra field names, an Image has in its properties field.") - public static class ImageProperties implements Serializable { - - public static final String TRANSPARENT = "transparent"; - public static final String IMAGE_TYPE = "imageType"; - public static final String POSITION = "position"; - public static final String ID = "id"; - - public static final String REPRESENTATION_HASH = "representationHash"; - - } - - @Schema(description = "Object containing the extra field names, a table cell has in its properties field.") - public static class TableCellProperties implements Serializable { - - public static final String B_BOX = "bBox"; - public static final String ROW = "row"; - public static final String COL = "col"; - public static final String HEADER = "header"; - - } - - @Schema(description = "Object containing the extra field names, a duplicate paragraph has in its properties field.") - public static class DuplicateParagraphProperties implements Serializable { - - public static final String UNSORTED_TEXTBLOCK_ID = "utbid"; - - } - - public static final String RECTANGLE_DELIMITER = ";"; - - - public static Rectangle2D parseRectangle2D(String bBox) { - - List floats = Arrays.stream(bBox.split(RECTANGLE_DELIMITER)) - .map(Float::parseFloat) - .toList(); - return new Rectangle2D.Float(floats.get(0), floats.get(1), floats.get(2), floats.get(3)); - } - - - public static double[] parseRepresentationVector(String representationHash) { - - String[] stringArray = representationHash.split("[,\\s]+"); - double[] doubleArray = new double[stringArray.length]; - for (int i = 0; i < stringArray.length; i++) { - doubleArray[i] = Double.parseDouble(stringArray[i]); - } - - return doubleArray; - } - - - public EntryData get(List tocId) { - - if (tocId.isEmpty()) { - return documentStructure.getRoot(); - } - EntryData entry = documentStructure.getRoot().getChildrenList() - .get(tocId.get(0)); - for (int id : tocId.subList(1, tocId.size())) { - entry = entry.getChildrenList() - .get(id); - } - return entry; - } - - - public Stream streamAllEntries() { - - return Stream.concat(Stream.of(documentStructure.getRoot()), - documentStructure.getRoot().getChildrenList() - .stream()) - .flatMap(DocumentStructureWrapper::flatten); - } - - - public String toString() { - - return String.join("\n", - streamAllEntries().map(EntryData::toString) - .toList()); - } - - - private static Stream flatten(EntryData entry) { - - return Stream.concat(Stream.of(entry), - entry.getChildrenList() - .stream() - .flatMap(DocumentStructureWrapper::flatten)); - } - -} diff --git a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextData.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextData.java deleted file mode 100644 index 3b13eb3..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextData.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -import java.io.Serializable; - -import io.swagger.v3.oas.annotations.media.Schema; -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.NoArgsConstructor; -import lombok.experimental.FieldDefaults; - -@Deprecated -@Data -@Builder -@NoArgsConstructor -@AllArgsConstructor -@FieldDefaults(level = AccessLevel.PRIVATE) -@Schema(description = "Object containing text information of a specific text block. A document is split into multiple text blocks, which are supposed to be read in order. Every text block can only occur on a single page.") -public class DocumentTextData implements Serializable { - - @Schema(description = "Identifier of the text block.") - Long id; - @Schema(description = "The page the text block occurs on.") - Long page; - @Schema(description = "The text the text block.") - String searchText; - @Schema(description = "Each text block is assigned a number on a page, starting from 0.") - int numberOnPage; - @Schema(description = "The text blocks are ordered, this number represents the start of the text block as a string offset.") - int start; - @Schema(description = "The text blocks are ordered, this number represents the end of the text block as a string offset.") - int end; - @Schema(description = "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.", example = "[5, 10]") - int[] lineBreaks; - -} 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 deleted file mode 100644 index 81e57d9..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/DocumentTextDataProto.java +++ /dev/null @@ -1,2069 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: DocumentTextData.proto -// 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) { - } - - 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= */ 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 final com.google.protobuf.Descriptors.Descriptor - getDescriptor() { - return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.internal_static_AllDocumentTextData_descriptor; - } - - @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 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 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; - } - - @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); - } - - // 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; - } - - @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; - } - - @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 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); - } - 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(); - } - } 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; - } - - @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.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_; - - 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< - 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(); - } - 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(); - } - ensureDocumentTextDataIsMutable(); - documentTextData_.add(value); - onChanged(); - } else { - documentTextDataBuilder_.addMessage(value); - } - 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); - } - 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()); - } - 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()); - } - 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); - } - 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 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); - } - } - /** - * 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 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) - } - - // @@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 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; - } - - @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); - } - - // 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; - } - - @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; - } - - 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_; - } - 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_; - } - } - - @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 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()); - } - 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; - } - - @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: { - 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. - */ - @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; - 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. - */ - @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; - } - } - /** - *
-       * 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) { - - 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; - } - - 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) - } - - // @@protoc_insertion_point(class_scope:DocumentTextData) - private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentTextDataProto.DocumentTextData(); - } - - 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 deleted file mode 100644 index 38b657e..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/EntryDataProto.java +++ /dev/null @@ -1,2557 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: EntryData.proto -// 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) { - } - - 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(); - - /** - *
-     * 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( - 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 */ -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); - - /** - *
-     * 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 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; - } - - @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); - } - } - @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 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; - } - - @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(); - } - - @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); - } - 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); - } - 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_); - } - 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; - } - - @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: { - 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: { - 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) { - ensureChildrenIsMutable(); - children_.add(m); - } else { - childrenBuilder_.addMessage(m); - } - break; - } // case 50 - case 56: { - int tmpRaw = input.readEnum(); - ensureEnginesIsMutable(); - 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); - } - 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. - */ - @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; - } - - 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) { - - 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) { - - 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) { - - 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; - } - - 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) { - - 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; - } - - 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_; - } - 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) - } - - // @@protoc_insertion_point(class_scope:EntryData) - private static final com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData DEFAULT_INSTANCE; - static { - DEFAULT_INSTANCE = new com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.EntryDataProto.EntryData(); - } - - 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/LayoutEngine.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngine.java deleted file mode 100644 index a6e8c03..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngine.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -@Deprecated -public enum LayoutEngine { - ALGORITHM, - AI, - OUTLINE -} 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 deleted file mode 100644 index 572243b..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/LayoutEngineProto.java +++ /dev/null @@ -1,177 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: LayoutEngine.proto -// 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) { - } - - 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= */ 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 final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static 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< - LayoutEngine> internalValueMap = - new com.google.protobuf.Internal.EnumLiteMap() { - public LayoutEngine findValueByNumber(int number) { - return LayoutEngine.forNumber(number); - } - }; - - public final com.google.protobuf.Descriptors.EnumValueDescriptor - getValueDescriptor() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalStateException( - "Can't get the descriptor of an unrecognized enum value."); - } - return getDescriptor().getValues().get(ordinal()); - } - public final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptorForType() { - return getDescriptor(); - } - public static final com.google.protobuf.Descriptors.EnumDescriptor - getDescriptor() { - return com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.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 java.lang.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 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/NodeType.java b/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeType.java deleted file mode 100644 index cc1df4d..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeType.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.internal.api.data.redaction; - -import java.io.Serializable; -import java.util.Locale; - -@Deprecated -public enum NodeType implements Serializable { - DOCUMENT, - SECTION, - SUPER_SECTION, - HEADLINE, - PARAGRAPH, - TABLE, - TABLE_CELL, - IMAGE, - HEADER, - FOOTER; - - - public String toString() { - - return this.name().charAt(0) + this.name().substring(1).toLowerCase(Locale.ROOT); - } -} 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 deleted file mode 100644 index edbd9d1..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/java/com/knecon/fforesight/service/layoutparser/internal/api/data/redaction/NodeTypeProto.java +++ /dev/null @@ -1,261 +0,0 @@ -// Generated by the protocol buffer compiler. DO NOT EDIT! -// NO CHECKED-IN PROTOBUF GENCODE -// source: NodeType.proto -// 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) { - } - - 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= */ 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 final int getNumber() { - if (this == UNRECOGNIZED) { - throw new java.lang.IllegalArgumentException( - "Can't get the number of an unknown enum value."); - } - return value; - } - - /** - * @param value The numeric wire value of the corresponding enum entry. - * @return The enum associated with the given numeric wire value. - * @deprecated Use {@link #forNumber(int)} instead. - */ - @java.lang.Deprecated - public static 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 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); - } - }; - - 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 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 NodeType(int value) { - this.value = value; - } - - // @@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 deleted file mode 100644 index d7ff489..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPage.proto +++ /dev/null @@ -1,25 +0,0 @@ -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; -} - -message DocumentPage { - // The page number, starting with 1. - int32 number = 1; - - // The page height in PDF user units. - int32 height = 2; - - // The page width in PDF user units. - int32 width = 3; - - // The page rotation as specified by the PDF. - int32 rotation = 4; -} - 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 deleted file mode 100644 index e597175..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentPositionData.proto +++ /dev/null @@ -1,28 +0,0 @@ -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; -} - -message DocumentPositionData { - // Identifier of the text block. - int64 id = 1; - - // 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; - - // 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 Position positions = 3; - - // Definition of a BoundingBox that contains x, y, width, and height. - message Position { - repeated float value = 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 deleted file mode 100644 index ab1cea1..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentStructure.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; - -option java_outer_classname = "DocumentStructureProto"; -option java_package = "com.knecon.fforesight.service.layoutparser.internal.api.data.redaction"; - - -import "EntryData.proto"; - -message DocumentStructure { - // The root EntryData represents the Document. - EntryData root = 1; -} 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 deleted file mode 100644 index c162279..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/DocumentTextData.proto +++ /dev/null @@ -1,32 +0,0 @@ -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; -} - -message DocumentTextData { - // Identifier of the text block. - int64 id = 1; - - // The page the text block occurs on. - int64 page = 2; - - // The text of the text block. - string searchText = 3; - - // Each text block is assigned a number on a page, starting from 0. - int32 numberOnPage = 4; - - // The text blocks are ordered, this number represents the start of the text block as a string offset. - int32 start = 5; - - // The text blocks are ordered, this number represents the end of the text block as a string offset. - int32 end = 6; - - // 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; -} 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 deleted file mode 100644 index cc6900c..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/EntryData.proto +++ /dev/null @@ -1,30 +0,0 @@ -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; - - // Specifies the position in the parsed tree structure. - repeated int32 treeId = 2; - - // Specifies the text block IDs associated with this semantic node. - repeated int64 atomicBlockIds = 3; - - // Specifies the pages this semantic node appears on. - repeated int64 pageNumbers = 4; - - // Some semantic nodes have additional information, this information is stored in this Map. - map properties = 5; - - // All child Entries of this Entry. - repeated EntryData children = 6; - - // Describes the origin of the semantic node. - repeated LayoutEngine engines = 7; -} 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 deleted file mode 100644 index a668134..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/LayoutEngine.proto +++ /dev/null @@ -1,8 +0,0 @@ -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; - OUTLINE = 2; -} 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 deleted file mode 100644 index ce58aaa..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/NodeType.proto +++ /dev/null @@ -1,19 +0,0 @@ -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; - SUPER_SECTION = 2; - HEADLINE = 3; - PARAGRAPH = 4; - TABLE = 5; - TABLE_CELL = 6; - 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 deleted file mode 100644 index 4a929be..0000000 --- a/layoutparser-service/layoutparser-service-internal-api/src/main/resources/generate_proto_files.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/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 ea4772c..fc94408 100644 --- a/layoutparser-service/layoutparser-service-processor/build.gradle.kts +++ b/layoutparser-service/layoutparser-service-processor/build.gradle.kts @@ -8,10 +8,12 @@ description = "layoutparser-service-processor" val jacksonVersion = "2.15.2" val pdfBoxVersion = "3.0.0" + dependencies { implementation(project(":layoutparser-service-internal-api")) implementation(project(":viewer-doc-processor")) + implementation("com.iqser.red.service:document:${rootProject.extra.get("documentVersion")}") implementation("com.iqser.red.service:persistence-service-shared-api-v1:2.564.0-RED9010.0") { exclude("org.springframework.boot", "spring-boot-starter-security") exclude("org.springframework.boot", "spring-boot-starter-validation") 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 890862d..470fd9c 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 @@ -22,11 +22,14 @@ import org.apache.pdfbox.pdmodel.common.PDRectangle; import org.apache.pdfbox.pdmodel.documentinterchange.markedcontent.PDMarkedContent; import org.springframework.stereotype.Service; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType; +import com.iqser.red.service.redaction.v1.server.mapper.DocumentDataMapper; +import com.iqser.red.service.redaction.v1.server.model.document.nodes.ImageType; +import com.iqser.red.service.redaction.v1.server.model.document.nodes.NodeType; import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingFinishedEvent; import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingRequest; import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingType; import com.knecon.fforesight.service.layoutparser.processor.docstrum.model.Character; +import com.knecon.fforesight.service.layoutparser.processor.model.DocumentWithVisualization; import com.knecon.fforesight.service.layoutparser.processor.model.table.Ruling; import com.knecon.fforesight.service.layoutparser.processor.model.text.RedTextPosition; import com.knecon.fforesight.service.layoutparser.processor.model.text.TextDirection; @@ -35,8 +38,7 @@ import com.knecon.fforesight.service.layoutparser.processor.services.mapper.Mark import com.knecon.fforesight.service.layoutparser.processor.model.AbstractPageBlock; import com.knecon.fforesight.service.layoutparser.processor.model.ClassificationDocument; import com.knecon.fforesight.service.layoutparser.processor.model.ClassificationPage; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; -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.SectionTreeBuilderService; @@ -65,7 +67,6 @@ import com.knecon.fforesight.service.layoutparser.processor.services.blockificat import com.knecon.fforesight.service.layoutparser.processor.services.factory.DocumentGraphFactory; import com.knecon.fforesight.service.layoutparser.processor.services.graphics.Box; import com.knecon.fforesight.service.layoutparser.processor.services.graphics.GraphicExtractorService; -import com.knecon.fforesight.service.layoutparser.processor.services.mapper.DocumentDataMapper; import com.knecon.fforesight.service.layoutparser.processor.services.mapper.TaasDocumentDataMapper; import com.knecon.fforesight.service.layoutparser.processor.services.parsing.PDFLinesTextStripper; import com.knecon.fforesight.service.layoutparser.processor.services.visualization.LayoutGridService; @@ -136,25 +137,25 @@ public class LayoutParsingPipeline { log.info("Building document graph for {}", layoutParsingRequest.identifier()); - Document documentGraph = observeBuildDocumentGraph(settings.getLayoutParsingTypeOverride() == null // + DocumentWithVisualization documentWithVisualization = observeBuildDocumentGraph(settings.getLayoutParsingTypeOverride() == null // ? layoutParsingRequest.layoutParsingType() : settings.getLayoutParsingTypeOverride(), classificationDocument); log.info("Creating viewer document for {}", layoutParsingRequest.identifier()); - layoutGridService.addLayoutGrid(viewerDocumentFile, documentGraph, viewerDocumentFile, false); + layoutGridService.addLayoutGrid(viewerDocumentFile, documentWithVisualization, viewerDocumentFile, false); log.info("Storing resulting files for {}", layoutParsingRequest.identifier()); - layoutParsingStorageService.storeDocumentData(layoutParsingRequest, DocumentDataMapper.toDocumentData(documentGraph)); + layoutParsingStorageService.storeDocumentData(layoutParsingRequest, DocumentDataMapper.toDocumentData(documentWithVisualization.document())); if (layoutParsingRequest.documentMarkdownFileStorageId().isPresent()) { - layoutParsingStorageService.storeMarkdownFile(layoutParsingRequest.documentMarkdownFileStorageId().get(), new MarkdownMapper().toMarkdownContent(documentGraph)); + layoutParsingStorageService.storeMarkdownFile(layoutParsingRequest.documentMarkdownFileStorageId().get(), new MarkdownMapper().toMarkdownContent(documentWithVisualization.document())); } - layoutParsingStorageService.storeSimplifiedText(layoutParsingRequest, simplifiedSectionTextService.toSimplifiedText(documentGraph)); + layoutParsingStorageService.storeSimplifiedText(layoutParsingRequest, simplifiedSectionTextService.toSimplifiedText(documentWithVisualization.document())); layoutParsingStorageService.storeViewerDocument(layoutParsingRequest, viewerDocumentFile); if (layoutParsingRequest.researchDocumentStorageId() != null) { log.info("Building research document data for {}", layoutParsingRequest.identifier()); - var researchDocumentData = TaasDocumentDataMapper.fromDocument(documentGraph); + var researchDocumentData = TaasDocumentDataMapper.fromDocument(documentWithVisualization.document()); layoutParsingStorageService.storeResearchDocumentData(layoutParsingRequest, researchDocumentData); } @@ -165,7 +166,7 @@ public class LayoutParsingPipeline { return LayoutParsingFinishedEvent.builder() .identifier(layoutParsingRequest.identifier()) - .numberOfPages(documentGraph.getNumberOfPages()) + .numberOfPages(documentWithVisualization.document().getNumberOfPages()) .duration(System.currentTimeMillis() - start) .message(format(""" Layout parsing has finished in %.02f s. @@ -180,7 +181,7 @@ public class LayoutParsingPipeline { Viewer Doc: %s""", ((float) (System.currentTimeMillis() - start)) / 1000, layoutParsingRequest.identifier(), - buildSemanticNodeCountMessage(documentGraph.getNumberOfPages(), documentGraph.buildSemanticNodeCounts()), + buildSemanticNodeCountMessage(documentWithVisualization.document().getNumberOfPages(), documentWithVisualization.buildSemanticNodeCounts()), layoutParsingRequest.structureFileStorageId(), layoutParsingRequest.textBlockFileStorageId(), layoutParsingRequest.positionBlockFileStorageId(), @@ -192,9 +193,9 @@ public class LayoutParsingPipeline { } - private Document observeBuildDocumentGraph(LayoutParsingType layoutParsingType, ClassificationDocument classificationDocument) { + private DocumentWithVisualization observeBuildDocumentGraph(LayoutParsingType layoutParsingType, ClassificationDocument classificationDocument) { - AtomicReference documentReference = new AtomicReference<>(); + AtomicReference documentReference = new AtomicReference<>(); Observation.createNotStarted("LayoutParsingPipeline", observationRegistry) .contextualName("build-document-graph") diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java index a84fccc..857382b 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/LayoutParsingStorageService.java @@ -17,8 +17,8 @@ import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Service; import com.fasterxml.jackson.databind.ObjectMapper; +import com.iqser.red.service.redaction.v1.server.data.DocumentData; import com.iqser.red.storage.commons.service.StorageService; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.DocumentData; import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.SimplifiedText; import com.knecon.fforesight.service.layoutparser.internal.api.data.taas.ResearchDocumentData; import com.knecon.fforesight.service.layoutparser.internal.api.queue.LayoutParsingRequest; @@ -122,7 +122,7 @@ public class LayoutParsingStorageService { Runnable storeDocumentPositionsRunnable = () -> storageService.storeProtoObject(TenantContext.getTenantId(), layoutParsingRequest.positionBlockFileStorageId(), - documentData.getDocumentPositions()); + documentData.getDocumentPositionData()); CompletableFuture storeDocumentPositionsFuture = CompletableFuture.runAsync(storeDocumentPositionsRunnable, taskExecutor); diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java index 54a1cb1..9c2cccb 100644 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/AbstractPageBlock.java @@ -4,7 +4,7 @@ import java.util.HashSet; import java.util.Set; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.LayoutEngineProto.LayoutEngine; +import com.iqser.red.service.redaction.v1.server.data.LayoutEngineProto.LayoutEngine; import com.knecon.fforesight.service.layoutparser.processor.docstrum.model.BoundingBox; import com.knecon.fforesight.service.layoutparser.processor.model.text.TextPageBlock; diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/DocumentWithVisualization.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/DocumentWithVisualization.java new file mode 100644 index 0000000..1f8825b --- /dev/null +++ b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/DocumentWithVisualization.java @@ -0,0 +1,19 @@ +package com.knecon.fforesight.service.layoutparser.processor.model; + +import java.util.Map; +import java.util.stream.Collectors; + +import com.iqser.red.service.redaction.v1.server.model.document.nodes.Document; +import com.iqser.red.service.redaction.v1.server.model.document.nodes.NodeType; +import com.iqser.red.service.redaction.v1.server.model.document.nodes.SemanticNode; +import com.knecon.fforesight.service.layoutparser.processor.visualization.LayoutDebugLayer; + +public record DocumentWithVisualization(Document document, LayoutDebugLayer layoutDebugLayer) { + + public Map buildSemanticNodeCounts() { + + return document.streamAllSubNodes() + .collect(Collectors.groupingBy(SemanticNode::getType, Collectors.counting())); + } + +} 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 deleted file mode 100644 index 30f2a95..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/AbstractNodeVisitor.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph; - -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Footer; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Header; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Headline; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Image; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Paragraph; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Section; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SemanticNode; -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 { - - @Override - public void visit(Document document) { - - visitChildren(document); - } - - - @Override - public void visit(SuperSection superSection) { - - visitChildren(superSection); - } - - - @Override - public void visit(Section section) { - - visitChildren(section); - } - - - @Override - public void visit(Headline headline) { - - visitChildren(headline); - } - - - @Override - public void visit(Paragraph paragraph) { - - visitChildren(paragraph); - } - - - @Override - public void visit(Footer footer) { - - visitChildren(footer); - } - - - @Override - public void visit(Header header) { - - visitChildren(header); - } - - - @Override - public void visit(Image image) { - - visitChildren(image); - } - - - @Override - public void visit(Table table) { - - visitChildren(table); - } - - - @Override - public void visit(TableCell tableCell) { - - visitChildren(tableCell); - } - - @Override - public void visit(TableOfContents toc) { - - visitChildren(toc); - } - - @Override - public void visit(TableOfContentsItem toci) { - - visitChildren(toci); - } - - - protected void visitChildren(SemanticNode semanticNode) { - - semanticNode.streamChildren() - .forEach(node -> node.accept(this)); - - } - -} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/DocumentTree.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/DocumentTree.java deleted file mode 100644 index 9552b8f..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/DocumentTree.java +++ /dev/null @@ -1,230 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph; - -import static java.lang.String.format; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.stream.Stream; - -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.GenericSemanticNode; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SemanticNode; -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.graph.textblock.TextBlockCollector; - -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.Getter; -import lombok.experimental.FieldDefaults; - -@Data -@EqualsAndHashCode -public class DocumentTree { - - private final Entry root; - - - public DocumentTree(Document document) { - - root = Entry.builder().treeId(Collections.emptyList()).children(new LinkedList<>()).node(document).build(); - } - - - public TextBlock buildTextBlock() { - - return allEntriesInOrder().map(Entry::getNode) - .filter(SemanticNode::isLeaf) - .map(SemanticNode::getLeafTextBlock) - .collect(new TextBlockCollector()); - } - - - public List createNewMainEntryAndReturnId(GenericSemanticNode node) { - - return createNewChildEntryAndReturnIdImpl(Collections.emptyList(), node); - } - - - public List createNewChildEntryAndReturnId(GenericSemanticNode parentNode, GenericSemanticNode node) { - - return createNewChildEntryAndReturnIdImpl(parentNode.getTreeId(), node); - } - - - public List createNewChildEntryAndReturnId(GenericSemanticNode parentNode, Table node) { - - return createNewChildEntryAndReturnIdImpl(parentNode.getTreeId(), node); - } - - - public List createNewTableChildEntryAndReturnId(Table parentTable, TableCell tableCell) { - - return createNewChildEntryAndReturnIdImpl(parentTable.getTreeId(), tableCell); - } - - - @SuppressWarnings("PMD.UnusedPrivateMethod") // PMD actually flags this wrong - private List createNewChildEntryAndReturnIdImpl(List parentId, SemanticNode node) { - - if (!entryExists(parentId)) { - throw new IllegalArgumentException(format("parentId %s does not exist!", parentId)); - } - - Entry parent = getEntryById(parentId); - List newId = new LinkedList<>(parentId); - newId.add(parent.children.size()); - parent.children.add(Entry.builder().treeId(newId).node(node).build()); - - return newId; - } - - - private boolean entryExists(List treeId) { - - if (treeId.isEmpty()) { - return root != null; - } - Entry entry = root.children.get(treeId.get(0)); - for (int id : treeId.subList(1, treeId.size())) { - if (id >= entry.children.size() || 0 > id) { - return false; - } - entry = entry.children.get(id); - } - return true; - } - - - public Entry getParentEntryById(List treeId) { - - return getEntryById(getParentId(treeId)); - } - - - public boolean hasParentById(List treeId) { - - return !treeId.isEmpty(); - } - - - public Stream childNodes(List treeId) { - - return getEntryById(treeId).children.stream() - .map(Entry::getNode); - } - - - public Stream childNodesOfType(List treeId, NodeType nodeType) { - - return getEntryById(treeId).children.stream() - .filter(entry -> entry.node.getType().equals(nodeType)) - .map(Entry::getNode); - } - - - private static List getParentId(List treeId) { - - if (treeId.isEmpty()) { - throw new UnsupportedOperationException("Root has no parent!"); - } - if (treeId.size() < 2) { - return Collections.emptyList(); - } - return treeId.subList(0, treeId.size() - 1); - } - - - public Entry getEntryById(List treeId) { - - if (treeId.isEmpty()) { - return root; - } - Entry entry = root; - for (int id : treeId) { - entry = entry.children.get(id); - } - return entry; - } - - - public Stream mainEntries() { - - return root.children.stream(); - } - - - public Stream allEntriesInOrder() { - - return Stream.of(root) - .flatMap(DocumentTree::flatten); - } - - - public Stream allSubEntriesInOrder(List parentId) { - - return getEntryById(parentId).children.stream() - .flatMap(DocumentTree::flatten); - } - - - @Override - public String toString() { - - return String.join("\n", - allEntriesInOrder().map(Entry::toString) - .toList()); - } - - - private static Stream flatten(Entry entry) { - - return Stream.concat(Stream.of(entry), - entry.children.stream() - .flatMap(DocumentTree::flatten)); - } - - - public SemanticNode getHighestParentById(List treeId) { - - if (treeId.isEmpty()) { - return root.node; - } - return root.children.get(treeId.get(0)).node; - } - - - @Builder - @Getter - @AllArgsConstructor - @FieldDefaults(level = AccessLevel.PRIVATE, makeFinal = true) - public static class Entry { - - List treeId; - SemanticNode node; - @Builder.Default - List children = new LinkedList<>(); - - - @Override - public String toString() { - - return node.toString(); - } - - - public NodeType getType() { - - return node.getType(); - } - - } - -} 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 deleted file mode 100644 index 61086a9..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/NodeVisitor.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph; - -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Document; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Footer; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Header; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Headline; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Image; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Paragraph; -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.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 { - - void visit(Document document); - - - void visit(SuperSection superSection); - - - void visit(Section section); - - - void visit(Headline headline); - - - void visit(Paragraph paragraph); - - - void visit(Footer footer); - - - void visit(Header header); - - - void visit(Image image); - - - void visit(Table table); - - - 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/TextRange.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/TextRange.java deleted file mode 100644 index eda21dc..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/TextRange.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph; - -import static java.lang.String.format; - -import java.util.Collection; -import java.util.LinkedList; -import java.util.List; -import java.util.stream.IntStream; - -import lombok.EqualsAndHashCode; -import lombok.Setter; - -@Setter -@EqualsAndHashCode -@SuppressWarnings("PMD.AvoidFieldNameMatchingMethodName") -public class TextRange implements Comparable { - - private int start; - private int end; - - - public TextRange(int start, int end) { - - if (start > end) { - throw new IllegalArgumentException(format("start: %d > end: %d", start, end)); - } - this.start = start; - this.end = end; - } - - - public int length() { - - return end - start; - } - - - public int start() { - - return start; - } - - - public int end() { - - return end; - } - - - public boolean contains(TextRange textRange) { - - return start <= textRange.start() && textRange.end() <= end; - } - - - public boolean containedBy(TextRange textRange) { - - return textRange.contains(this); - } - - - public boolean contains(int start, int end) { - - if (start > end) { - throw new IllegalArgumentException(format("start: %d > end: %d", start, end)); - } - return this.start <= start && end <= this.end; - } - - - public boolean containedBy(int start, int end) { - - if (start > end) { - throw new IllegalArgumentException(format("start: %d > end: %d", start, end)); - } - return start <= this.start && this.end <= end; - } - - - public boolean contains(int index) { - - return start <= index && index <= end; - } - - - public boolean containsExclusive(int index) { - - return start <= index && index < end; - } - - - public boolean intersects(TextRange textRange) { - - return textRange.start() < this.end && this.start < textRange.end(); - } - - - public List split(List splitIndices) { - - if (splitIndices.stream() - .anyMatch(idx -> !this.contains(idx))) { - throw new IndexOutOfBoundsException(format("%s splitting indices are out of range for %s", - splitIndices.stream() - .filter(idx -> !this.contains(idx)) - .toList(), - this)); - } - List splitBoundaries = new LinkedList<>(); - int previousIndex = start; - for (int splitIndex : splitIndices) { - - // skip split if it would produce a boundary of length 0 - if (splitIndex == previousIndex) { - continue; - } - splitBoundaries.add(new TextRange(previousIndex, splitIndex)); - previousIndex = splitIndex; - } - if (previousIndex != end) { - splitBoundaries.add(new TextRange(previousIndex, end)); - } - return splitBoundaries; - } - - - public IntStream intStream() { - - return IntStream.range(start, end); - } - - - public static TextRange merge(Collection boundaries) { - - int minStart = boundaries.stream() - .mapToInt(TextRange::start) - .min() - .orElseThrow(IllegalArgumentException::new); - int maxEnd = boundaries.stream() - .mapToInt(TextRange::end) - .max() - .orElseThrow(IllegalArgumentException::new); - return new TextRange(minStart, maxEnd); - } - - - @Override - public String toString() { - - return format("Boundary [%d|%d)", start, end); - } - - - @Override - public int compareTo(TextRange textRange) { - - if (end < textRange.end() && start < textRange.start()) { - return -1; - } - if (start > textRange.start() && end > textRange.end()) { - return 1; - } - - return 0; - } - -} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/EntityType.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/EntityType.java deleted file mode 100644 index 838996d..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/EntityType.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph.entity; - -public enum EntityType { - ENTITY, - RECOMMENDATION, - FALSE_POSITIVE, - FALSE_RECOMMENDATION -} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/RedactionPosition.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/RedactionPosition.java deleted file mode 100644 index dbf104c..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/RedactionPosition.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph.entity; - -import java.awt.geom.Rectangle2D; -import java.util.List; - -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Page; - -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.experimental.FieldDefaults; - -@Data -@AllArgsConstructor -@FieldDefaults(level = AccessLevel.PRIVATE) -public class RedactionPosition { - - final String id; - Page page; - // Each entry in this list corresponds to an entry in the redaction log, this means: - // An entity might be represented by multiple redaction log entries - List rectanglePerLine; - -} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/TextEntity.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/TextEntity.java deleted file mode 100644 index 7d4d6f3..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/entity/TextEntity.java +++ /dev/null @@ -1,228 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph.entity; - -import java.awt.geom.Rectangle2D; -import java.util.Collection; -import java.util.Comparator; -import java.util.Deque; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import com.iqser.red.service.persistence.service.v1.api.shared.model.redactionlog.Engine; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.TextRange; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.Page; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes.SemanticNode; -import com.knecon.fforesight.service.layoutparser.processor.utils.IdBuilder; - -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.experimental.FieldDefaults; - -@Data -@Builder -@AllArgsConstructor -@FieldDefaults(level = AccessLevel.PRIVATE) -@EqualsAndHashCode(onlyExplicitlyIncluded = true) -public class TextEntity { - - // initial values - @EqualsAndHashCode.Include - final TextRange textRange; - @EqualsAndHashCode.Include - final String type; - @EqualsAndHashCode.Include - final EntityType entityType; - - // empty defaults - boolean redaction; - boolean removed; - boolean ignored; - boolean resized; - boolean skipRemoveEntitiesContainedInLarger; - boolean dictionaryEntry; - boolean dossierDictionaryEntry; - Set engines; - Set references; - @Builder.Default - Deque matchedRules = new LinkedList<>(); - String redactionReason; - String legalBasis; - - // inferred on graph insertion - @EqualsAndHashCode.Include - String value; - String textBefore; - String textAfter; - @Builder.Default - Set pages = new HashSet<>(); - List redactionPositionsPerPage; - @Builder.Default - List intersectingNodes = new LinkedList<>(); - SemanticNode deepestFullyContainingNode; - - - public static TextEntity initialEntityNode(TextRange textRange, String type, EntityType entityType) { - - return TextEntity.builder().type(type).entityType(entityType).textRange(textRange).engines(new HashSet<>()).references(new HashSet<>()).build(); - } - - - public boolean occursInNodeOfType(Class clazz) { - - return intersectingNodes.stream().anyMatch(clazz::isInstance); - } - - - public boolean occursInNode(SemanticNode semanticNode) { - - return intersectingNodes.stream().anyMatch(node -> node.equals(semanticNode)); - } - - - public boolean isType(String type) { - - return this.type.equals(type); - } - - - public boolean isAnyType(List types) { - - return types.contains(type); - } - - - public void addIntersectingNode(SemanticNode containingNode) { - - intersectingNodes.add(containingNode); - } - - - public void removeFromGraph() { - - intersectingNodes.forEach(node -> node.getEntities().remove(this)); - pages.forEach(page -> page.getEntities().remove(this)); - intersectingNodes = new LinkedList<>(); - deepestFullyContainingNode = null; - pages = new HashSet<>(); - removed = true; - ignored = true; - } - - - public void addMatchedRule(int ruleNumber) { - - matchedRules.add(ruleNumber); - } - - - public int getMatchedRule() { - - if (matchedRules.isEmpty()) { - return 0; - } - return matchedRules.getLast(); - } - - - public List getRedactionPositionsPerPage() { - - if (redactionPositionsPerPage == null || redactionPositionsPerPage.isEmpty()) { - Map> rectanglesPerLinePerPage = deepestFullyContainingNode.getTextBlock().getPositionsPerPage(textRange); - - Page firstPage = rectanglesPerLinePerPage.keySet() - .stream() - .min(Comparator.comparingInt(Page::getNumber)) - .orElseThrow(() -> new RuntimeException("No Positions found on any page!")); - String id = IdBuilder.buildId(pages, rectanglesPerLinePerPage.values().stream().flatMap(Collection::stream).toList()); - redactionPositionsPerPage = rectanglesPerLinePerPage.entrySet().stream().map(entry -> buildRedactionPosition(firstPage, id, entry)).toList(); - } - return redactionPositionsPerPage; - } - - - private static RedactionPosition buildRedactionPosition(Page firstPage, String id, Map.Entry> entry) { - - if (entry.getKey().equals(firstPage)) { - return new RedactionPosition(id, entry.getKey(), entry.getValue()); - } else { - return new RedactionPosition(id + "-" + entry.getKey().getNumber(), entry.getKey(), entry.getValue()); - } - } - - - public boolean containedBy(TextEntity textEntity) { - - return this.textRange.containedBy(textEntity.getTextRange()); - } - - - public boolean contains(TextEntity textEntity) { - - return this.textRange.contains(textEntity.getTextRange()); - } - - - public boolean intersects(TextEntity textEntity) { - - return this.textRange.intersects(textEntity.getTextRange()); - } - - - public void addEngine(Engine engine) { - - engines.add(engine); - } - - - public void addEngines(Set engines) { - - this.engines.addAll(engines); - } - - - public void addReference(TextEntity reference) { - - references.add(reference); - } - - - public void addReferences(List references) { - - this.references.addAll(references); - } - - - public boolean matchesAnnotationId(String manualRedactionId) { - - return getRedactionPositionsPerPage().stream().anyMatch(entityPosition -> entityPosition.getId().equals(manualRedactionId)); - } - - - @Override - public String toString() { - - StringBuilder sb = new StringBuilder(); - sb.append("Entity[\""); - sb.append(value); - sb.append("\", "); - sb.append(textRange); - sb.append(", pages["); - pages.forEach(page -> { - sb.append(page.getNumber()); - sb.append(", "); - }); - sb.delete(sb.length() - 2, sb.length()); - sb.append("], type = \""); - sb.append(type); - sb.append("\", EntityType."); - sb.append(entityType); - sb.append("]"); - return sb.toString(); - } - -} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/AbstractSemanticNode.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/AbstractSemanticNode.java deleted file mode 100644 index 52be80d..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/AbstractSemanticNode.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes; - -import java.awt.geom.Rectangle2D; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -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.entity.TextEntity; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock; - -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Builder; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.FieldDefaults; -import lombok.experimental.SuperBuilder; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@Data -@SuperBuilder -@AllArgsConstructor -@NoArgsConstructor -@FieldDefaults(level = AccessLevel.PRIVATE) -public abstract class AbstractSemanticNode implements GenericSemanticNode { - - @Builder.Default - Set engines = new HashSet<>(Set.of(LayoutEngine.ALGORITHM)); - List treeId; - - TextBlock textBlock; - @EqualsAndHashCode.Exclude - DocumentTree documentTree; - - @Builder.Default - @EqualsAndHashCode.Exclude - Set entities = new HashSet<>(); - - @EqualsAndHashCode.Exclude - Map bBoxCache; - - - @Override - public TextBlock getTextBlock() { - - if (textBlock == null) { - textBlock = GenericSemanticNode.super.getTextBlock(); - } - return textBlock; - } - - - @Override - public String toString() { - - return treeId.toString() + ": " + getType() + ": " + this.getTextBlock().buildSummary(); - } - - - @Override - public Map getBBox() { - - if (bBoxCache == null) { - bBoxCache = GenericSemanticNode.super.getBBox(); - } - return bBoxCache; - } - -} diff --git a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/Document.java b/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/Document.java deleted file mode 100644 index 7d4f86d..0000000 --- a/layoutparser-service/layoutparser-service-processor/src/main/java/com/knecon/fforesight/service/layoutparser/processor/model/graph/nodes/Document.java +++ /dev/null @@ -1,173 +0,0 @@ -package com.knecon.fforesight.service.layoutparser.processor.model.graph.nodes; - -import java.awt.geom.Rectangle2D; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; - -import com.knecon.fforesight.service.layoutparser.internal.api.data.redaction.NodeTypeProto.NodeType; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.DocumentTree; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.NodeVisitor; -import com.knecon.fforesight.service.layoutparser.processor.model.graph.textblock.TextBlock; -import com.knecon.fforesight.service.layoutparser.processor.visualization.LayoutDebugLayer; - -import lombok.AccessLevel; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.EqualsAndHashCode; -import lombok.NoArgsConstructor; -import lombok.experimental.FieldDefaults; -import lombok.experimental.SuperBuilder; - -@Data -@SuperBuilder -@AllArgsConstructor -@NoArgsConstructor -@EqualsAndHashCode(callSuper = true) -@FieldDefaults(level = AccessLevel.PRIVATE) -public class Document extends AbstractSemanticNode { - - Set pages; - Integer numberOfPages; - - LayoutDebugLayer layoutDebugLayer; - - - @Override - public NodeType getType() { - - return NodeType.DOCUMENT; - } - - - /** - * Gets the sections of the document as a list. - * - * @return A list of all sections within the document. - */ - public List
getAllSections() { - - return streamAllSubNodesOfType(NodeType.SECTION).map(node -> (Section) node) - .collect(Collectors.toList()); - } - - - /** - * Gets the main sections of the document as a list. - * - * @return A list of main sections within the document - * @deprecated This method is marked for removal. - * Use {@link #streamChildrenOfType(NodeType)} instead, - * or {@link #getChildrenOfTypeSectionOrSuperSection()} which returns children of type SECTION as well as SUPER_SECTION. - */ - @Deprecated(forRemoval = true) - public List
getMainSections() { - - return streamChildrenOfType(NodeType.SECTION).map(node -> (Section) node) - .collect(Collectors.toList()); - } - - - /** - * Gets the direct children of type SECTION or SUPER_SECTION of the document as a list of SemanticNode objects. - * - * @return A list of all children of type SECTION or SUPER_SECTION. - */ - public List getChildrenOfTypeSectionOrSuperSection() { - - return streamChildren().filter(semanticNode -> semanticNode.getType().equals(NodeType.SECTION) || semanticNode.getType().equals(NodeType.SUPER_SECTION)) - .toList(); - } - - - public List
getHeaders() { - - return streamChildrenOfType(NodeType.HEADER).map(node -> (Header) node) - .collect(Collectors.toList()); - } - - - public List