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

com.google.cloud.vision.v1.Word Maven / Gradle / Ivy

There is a newer version: 3.47.0
Show newest version
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/vision/v1/text_annotation.proto

package com.google.cloud.vision.v1;

/**
 * 
 * A word representation.
 * 
* * Protobuf type {@code google.cloud.vision.v1.Word} */ public final class Word extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.vision.v1.Word) WordOrBuilder { private static final long serialVersionUID = 0L; // Use Word.newBuilder() to construct. private Word(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private Word() { symbols_ = java.util.Collections.emptyList(); confidence_ = 0F; } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private Word( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; default: { if (!parseUnknownFieldProto3( input, unknownFields, extensionRegistry, tag)) { done = true; } break; } case 10: { com.google.cloud.vision.v1.TextAnnotation.TextProperty.Builder subBuilder = null; if (property_ != null) { subBuilder = property_.toBuilder(); } property_ = input.readMessage(com.google.cloud.vision.v1.TextAnnotation.TextProperty.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(property_); property_ = subBuilder.buildPartial(); } break; } case 18: { com.google.cloud.vision.v1.BoundingPoly.Builder subBuilder = null; if (boundingBox_ != null) { subBuilder = boundingBox_.toBuilder(); } boundingBox_ = input.readMessage(com.google.cloud.vision.v1.BoundingPoly.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom(boundingBox_); boundingBox_ = subBuilder.buildPartial(); } break; } case 26: { if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) { symbols_ = new java.util.ArrayList(); mutable_bitField0_ |= 0x00000004; } symbols_.add( input.readMessage(com.google.cloud.vision.v1.Symbol.parser(), extensionRegistry)); break; } case 37: { confidence_ = input.readFloat(); break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException( e).setUnfinishedMessage(this); } finally { if (((mutable_bitField0_ & 0x00000004) == 0x00000004)) { symbols_ = java.util.Collections.unmodifiableList(symbols_); } this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vision.v1.TextAnnotationProto.internal_static_google_cloud_vision_v1_Word_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.vision.v1.TextAnnotationProto.internal_static_google_cloud_vision_v1_Word_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.vision.v1.Word.class, com.google.cloud.vision.v1.Word.Builder.class); } private int bitField0_; public static final int PROPERTY_FIELD_NUMBER = 1; private com.google.cloud.vision.v1.TextAnnotation.TextProperty property_; /** *
   * Additional information detected for the word.
   * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public boolean hasProperty() { return property_ != null; } /** *
   * Additional information detected for the word.
   * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public com.google.cloud.vision.v1.TextAnnotation.TextProperty getProperty() { return property_ == null ? com.google.cloud.vision.v1.TextAnnotation.TextProperty.getDefaultInstance() : property_; } /** *
   * Additional information detected for the word.
   * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public com.google.cloud.vision.v1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { return getProperty(); } public static final int BOUNDING_BOX_FIELD_NUMBER = 2; private com.google.cloud.vision.v1.BoundingPoly boundingBox_; /** *
   * The bounding box for the word.
   * The vertices are in the order of top-left, top-right, bottom-right,
   * bottom-left. When a rotation of the bounding box is detected the rotation
   * is represented as around the top-left corner as defined when the text is
   * read in the 'natural' orientation.
   * For example:
   *   * when the text is horizontal it might look like:
   *      0----1
   *      |    |
   *      3----2
   *   * when it's rotated 180 degrees around the top-left corner it becomes:
   *      2----3
   *      |    |
   *      1----0
   *   and the vertice order will still be (0, 1, 2, 3).
   * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public boolean hasBoundingBox() { return boundingBox_ != null; } /** *
   * The bounding box for the word.
   * The vertices are in the order of top-left, top-right, bottom-right,
   * bottom-left. When a rotation of the bounding box is detected the rotation
   * is represented as around the top-left corner as defined when the text is
   * read in the 'natural' orientation.
   * For example:
   *   * when the text is horizontal it might look like:
   *      0----1
   *      |    |
   *      3----2
   *   * when it's rotated 180 degrees around the top-left corner it becomes:
   *      2----3
   *      |    |
   *      1----0
   *   and the vertice order will still be (0, 1, 2, 3).
   * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public com.google.cloud.vision.v1.BoundingPoly getBoundingBox() { return boundingBox_ == null ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() : boundingBox_; } /** *
   * The bounding box for the word.
   * The vertices are in the order of top-left, top-right, bottom-right,
   * bottom-left. When a rotation of the bounding box is detected the rotation
   * is represented as around the top-left corner as defined when the text is
   * read in the 'natural' orientation.
   * For example:
   *   * when the text is horizontal it might look like:
   *      0----1
   *      |    |
   *      3----2
   *   * when it's rotated 180 degrees around the top-left corner it becomes:
   *      2----3
   *      |    |
   *      1----0
   *   and the vertice order will still be (0, 1, 2, 3).
   * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { return getBoundingBox(); } public static final int SYMBOLS_FIELD_NUMBER = 3; private java.util.List symbols_; /** *
   * List of symbols in the word.
   * The order of the symbols follows the natural reading order.
   * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public java.util.List getSymbolsList() { return symbols_; } /** *
   * List of symbols in the word.
   * The order of the symbols follows the natural reading order.
   * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public java.util.List getSymbolsOrBuilderList() { return symbols_; } /** *
   * List of symbols in the word.
   * The order of the symbols follows the natural reading order.
   * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public int getSymbolsCount() { return symbols_.size(); } /** *
   * List of symbols in the word.
   * The order of the symbols follows the natural reading order.
   * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public com.google.cloud.vision.v1.Symbol getSymbols(int index) { return symbols_.get(index); } /** *
   * List of symbols in the word.
   * The order of the symbols follows the natural reading order.
   * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public com.google.cloud.vision.v1.SymbolOrBuilder getSymbolsOrBuilder( int index) { return symbols_.get(index); } public static final int CONFIDENCE_FIELD_NUMBER = 4; private float confidence_; /** *
   * Confidence of the OCR results for the word. Range [0, 1].
   * 
* * float confidence = 4; */ public float getConfidence() { return confidence_; } private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (property_ != null) { output.writeMessage(1, getProperty()); } if (boundingBox_ != null) { output.writeMessage(2, getBoundingBox()); } for (int i = 0; i < symbols_.size(); i++) { output.writeMessage(3, symbols_.get(i)); } if (confidence_ != 0F) { output.writeFloat(4, confidence_); } unknownFields.writeTo(output); } public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (property_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(1, getProperty()); } if (boundingBox_ != null) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(2, getBoundingBox()); } for (int i = 0; i < symbols_.size(); i++) { size += com.google.protobuf.CodedOutputStream .computeMessageSize(3, symbols_.get(i)); } if (confidence_ != 0F) { size += com.google.protobuf.CodedOutputStream .computeFloatSize(4, confidence_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.vision.v1.Word)) { return super.equals(obj); } com.google.cloud.vision.v1.Word other = (com.google.cloud.vision.v1.Word) obj; boolean result = true; result = result && (hasProperty() == other.hasProperty()); if (hasProperty()) { result = result && getProperty() .equals(other.getProperty()); } result = result && (hasBoundingBox() == other.hasBoundingBox()); if (hasBoundingBox()) { result = result && getBoundingBox() .equals(other.getBoundingBox()); } result = result && getSymbolsList() .equals(other.getSymbolsList()); result = result && ( java.lang.Float.floatToIntBits(getConfidence()) == java.lang.Float.floatToIntBits( other.getConfidence())); result = result && unknownFields.equals(other.unknownFields); return result; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasProperty()) { hash = (37 * hash) + PROPERTY_FIELD_NUMBER; hash = (53 * hash) + getProperty().hashCode(); } if (hasBoundingBox()) { hash = (37 * hash) + BOUNDING_BOX_FIELD_NUMBER; hash = (53 * hash) + getBoundingBox().hashCode(); } if (getSymbolsCount() > 0) { hash = (37 * hash) + SYMBOLS_FIELD_NUMBER; hash = (53 * hash) + getSymbolsList().hashCode(); } hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER; hash = (53 * hash) + java.lang.Float.floatToIntBits( getConfidence()); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.vision.v1.Word parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.Word parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.Word parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.Word parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.Word parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.vision.v1.Word parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.vision.v1.Word parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.vision.v1.Word parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.vision.v1.Word parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.vision.v1.Word parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static com.google.cloud.vision.v1.Word parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input); } public static com.google.cloud.vision.v1.Word parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3 .parseWithIOException(PARSER, input, extensionRegistry); } public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.cloud.vision.v1.Word prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** *
   * A word representation.
   * 
* * Protobuf type {@code google.cloud.vision.v1.Word} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.vision.v1.Word) com.google.cloud.vision.v1.WordOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.vision.v1.TextAnnotationProto.internal_static_google_cloud_vision_v1_Word_descriptor; } protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.vision.v1.TextAnnotationProto.internal_static_google_cloud_vision_v1_Word_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.vision.v1.Word.class, com.google.cloud.vision.v1.Word.Builder.class); } // Construct using com.google.cloud.vision.v1.Word.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3 .alwaysUseFieldBuilders) { getSymbolsFieldBuilder(); } } public Builder clear() { super.clear(); if (propertyBuilder_ == null) { property_ = null; } else { property_ = null; propertyBuilder_ = null; } if (boundingBoxBuilder_ == null) { boundingBox_ = null; } else { boundingBox_ = null; boundingBoxBuilder_ = null; } if (symbolsBuilder_ == null) { symbols_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); } else { symbolsBuilder_.clear(); } confidence_ = 0F; return this; } public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.vision.v1.TextAnnotationProto.internal_static_google_cloud_vision_v1_Word_descriptor; } public com.google.cloud.vision.v1.Word getDefaultInstanceForType() { return com.google.cloud.vision.v1.Word.getDefaultInstance(); } public com.google.cloud.vision.v1.Word build() { com.google.cloud.vision.v1.Word result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } public com.google.cloud.vision.v1.Word buildPartial() { com.google.cloud.vision.v1.Word result = new com.google.cloud.vision.v1.Word(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (propertyBuilder_ == null) { result.property_ = property_; } else { result.property_ = propertyBuilder_.build(); } if (boundingBoxBuilder_ == null) { result.boundingBox_ = boundingBox_; } else { result.boundingBox_ = boundingBoxBuilder_.build(); } if (symbolsBuilder_ == null) { if (((bitField0_ & 0x00000004) == 0x00000004)) { symbols_ = java.util.Collections.unmodifiableList(symbols_); bitField0_ = (bitField0_ & ~0x00000004); } result.symbols_ = symbols_; } else { result.symbols_ = symbolsBuilder_.build(); } result.confidence_ = confidence_; result.bitField0_ = to_bitField0_; onBuilt(); return result; } public Builder clone() { return (Builder) super.clone(); } public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.setField(field, value); } public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.vision.v1.Word) { return mergeFrom((com.google.cloud.vision.v1.Word)other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.vision.v1.Word other) { if (other == com.google.cloud.vision.v1.Word.getDefaultInstance()) return this; if (other.hasProperty()) { mergeProperty(other.getProperty()); } if (other.hasBoundingBox()) { mergeBoundingBox(other.getBoundingBox()); } if (symbolsBuilder_ == null) { if (!other.symbols_.isEmpty()) { if (symbols_.isEmpty()) { symbols_ = other.symbols_; bitField0_ = (bitField0_ & ~0x00000004); } else { ensureSymbolsIsMutable(); symbols_.addAll(other.symbols_); } onChanged(); } } else { if (!other.symbols_.isEmpty()) { if (symbolsBuilder_.isEmpty()) { symbolsBuilder_.dispose(); symbolsBuilder_ = null; symbols_ = other.symbols_; bitField0_ = (bitField0_ & ~0x00000004); symbolsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSymbolsFieldBuilder() : null; } else { symbolsBuilder_.addAllMessages(other.symbols_); } } } if (other.getConfidence() != 0F) { setConfidence(other.getConfidence()); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } public final boolean isInitialized() { return true; } public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.vision.v1.Word parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.vision.v1.Word) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int bitField0_; private com.google.cloud.vision.v1.TextAnnotation.TextProperty property_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.TextAnnotation.TextProperty, com.google.cloud.vision.v1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1.TextAnnotation.TextPropertyOrBuilder> propertyBuilder_; /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public boolean hasProperty() { return propertyBuilder_ != null || property_ != null; } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public com.google.cloud.vision.v1.TextAnnotation.TextProperty getProperty() { if (propertyBuilder_ == null) { return property_ == null ? com.google.cloud.vision.v1.TextAnnotation.TextProperty.getDefaultInstance() : property_; } else { return propertyBuilder_.getMessage(); } } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public Builder setProperty(com.google.cloud.vision.v1.TextAnnotation.TextProperty value) { if (propertyBuilder_ == null) { if (value == null) { throw new NullPointerException(); } property_ = value; onChanged(); } else { propertyBuilder_.setMessage(value); } return this; } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public Builder setProperty( com.google.cloud.vision.v1.TextAnnotation.TextProperty.Builder builderForValue) { if (propertyBuilder_ == null) { property_ = builderForValue.build(); onChanged(); } else { propertyBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public Builder mergeProperty(com.google.cloud.vision.v1.TextAnnotation.TextProperty value) { if (propertyBuilder_ == null) { if (property_ != null) { property_ = com.google.cloud.vision.v1.TextAnnotation.TextProperty.newBuilder(property_).mergeFrom(value).buildPartial(); } else { property_ = value; } onChanged(); } else { propertyBuilder_.mergeFrom(value); } return this; } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public Builder clearProperty() { if (propertyBuilder_ == null) { property_ = null; onChanged(); } else { property_ = null; propertyBuilder_ = null; } return this; } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public com.google.cloud.vision.v1.TextAnnotation.TextProperty.Builder getPropertyBuilder() { onChanged(); return getPropertyFieldBuilder().getBuilder(); } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ public com.google.cloud.vision.v1.TextAnnotation.TextPropertyOrBuilder getPropertyOrBuilder() { if (propertyBuilder_ != null) { return propertyBuilder_.getMessageOrBuilder(); } else { return property_ == null ? com.google.cloud.vision.v1.TextAnnotation.TextProperty.getDefaultInstance() : property_; } } /** *
     * Additional information detected for the word.
     * 
* * .google.cloud.vision.v1.TextAnnotation.TextProperty property = 1; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.TextAnnotation.TextProperty, com.google.cloud.vision.v1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1.TextAnnotation.TextPropertyOrBuilder> getPropertyFieldBuilder() { if (propertyBuilder_ == null) { propertyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.TextAnnotation.TextProperty, com.google.cloud.vision.v1.TextAnnotation.TextProperty.Builder, com.google.cloud.vision.v1.TextAnnotation.TextPropertyOrBuilder>( getProperty(), getParentForChildren(), isClean()); property_ = null; } return propertyBuilder_; } private com.google.cloud.vision.v1.BoundingPoly boundingBox_ = null; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder> boundingBoxBuilder_; /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public boolean hasBoundingBox() { return boundingBoxBuilder_ != null || boundingBox_ != null; } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public com.google.cloud.vision.v1.BoundingPoly getBoundingBox() { if (boundingBoxBuilder_ == null) { return boundingBox_ == null ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() : boundingBox_; } else { return boundingBoxBuilder_.getMessage(); } } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public Builder setBoundingBox(com.google.cloud.vision.v1.BoundingPoly value) { if (boundingBoxBuilder_ == null) { if (value == null) { throw new NullPointerException(); } boundingBox_ = value; onChanged(); } else { boundingBoxBuilder_.setMessage(value); } return this; } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public Builder setBoundingBox( com.google.cloud.vision.v1.BoundingPoly.Builder builderForValue) { if (boundingBoxBuilder_ == null) { boundingBox_ = builderForValue.build(); onChanged(); } else { boundingBoxBuilder_.setMessage(builderForValue.build()); } return this; } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public Builder mergeBoundingBox(com.google.cloud.vision.v1.BoundingPoly value) { if (boundingBoxBuilder_ == null) { if (boundingBox_ != null) { boundingBox_ = com.google.cloud.vision.v1.BoundingPoly.newBuilder(boundingBox_).mergeFrom(value).buildPartial(); } else { boundingBox_ = value; } onChanged(); } else { boundingBoxBuilder_.mergeFrom(value); } return this; } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public Builder clearBoundingBox() { if (boundingBoxBuilder_ == null) { boundingBox_ = null; onChanged(); } else { boundingBox_ = null; boundingBoxBuilder_ = null; } return this; } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public com.google.cloud.vision.v1.BoundingPoly.Builder getBoundingBoxBuilder() { onChanged(); return getBoundingBoxFieldBuilder().getBuilder(); } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ public com.google.cloud.vision.v1.BoundingPolyOrBuilder getBoundingBoxOrBuilder() { if (boundingBoxBuilder_ != null) { return boundingBoxBuilder_.getMessageOrBuilder(); } else { return boundingBox_ == null ? com.google.cloud.vision.v1.BoundingPoly.getDefaultInstance() : boundingBox_; } } /** *
     * The bounding box for the word.
     * The vertices are in the order of top-left, top-right, bottom-right,
     * bottom-left. When a rotation of the bounding box is detected the rotation
     * is represented as around the top-left corner as defined when the text is
     * read in the 'natural' orientation.
     * For example:
     *   * when the text is horizontal it might look like:
     *      0----1
     *      |    |
     *      3----2
     *   * when it's rotated 180 degrees around the top-left corner it becomes:
     *      2----3
     *      |    |
     *      1----0
     *   and the vertice order will still be (0, 1, 2, 3).
     * 
* * .google.cloud.vision.v1.BoundingPoly bounding_box = 2; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder> getBoundingBoxFieldBuilder() { if (boundingBoxBuilder_ == null) { boundingBoxBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.vision.v1.BoundingPoly, com.google.cloud.vision.v1.BoundingPoly.Builder, com.google.cloud.vision.v1.BoundingPolyOrBuilder>( getBoundingBox(), getParentForChildren(), isClean()); boundingBox_ = null; } return boundingBoxBuilder_; } private java.util.List symbols_ = java.util.Collections.emptyList(); private void ensureSymbolsIsMutable() { if (!((bitField0_ & 0x00000004) == 0x00000004)) { symbols_ = new java.util.ArrayList(symbols_); bitField0_ |= 0x00000004; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.vision.v1.Symbol, com.google.cloud.vision.v1.Symbol.Builder, com.google.cloud.vision.v1.SymbolOrBuilder> symbolsBuilder_; /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public java.util.List getSymbolsList() { if (symbolsBuilder_ == null) { return java.util.Collections.unmodifiableList(symbols_); } else { return symbolsBuilder_.getMessageList(); } } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public int getSymbolsCount() { if (symbolsBuilder_ == null) { return symbols_.size(); } else { return symbolsBuilder_.getCount(); } } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public com.google.cloud.vision.v1.Symbol getSymbols(int index) { if (symbolsBuilder_ == null) { return symbols_.get(index); } else { return symbolsBuilder_.getMessage(index); } } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder setSymbols( int index, com.google.cloud.vision.v1.Symbol value) { if (symbolsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSymbolsIsMutable(); symbols_.set(index, value); onChanged(); } else { symbolsBuilder_.setMessage(index, value); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder setSymbols( int index, com.google.cloud.vision.v1.Symbol.Builder builderForValue) { if (symbolsBuilder_ == null) { ensureSymbolsIsMutable(); symbols_.set(index, builderForValue.build()); onChanged(); } else { symbolsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder addSymbols(com.google.cloud.vision.v1.Symbol value) { if (symbolsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSymbolsIsMutable(); symbols_.add(value); onChanged(); } else { symbolsBuilder_.addMessage(value); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder addSymbols( int index, com.google.cloud.vision.v1.Symbol value) { if (symbolsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSymbolsIsMutable(); symbols_.add(index, value); onChanged(); } else { symbolsBuilder_.addMessage(index, value); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder addSymbols( com.google.cloud.vision.v1.Symbol.Builder builderForValue) { if (symbolsBuilder_ == null) { ensureSymbolsIsMutable(); symbols_.add(builderForValue.build()); onChanged(); } else { symbolsBuilder_.addMessage(builderForValue.build()); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder addSymbols( int index, com.google.cloud.vision.v1.Symbol.Builder builderForValue) { if (symbolsBuilder_ == null) { ensureSymbolsIsMutable(); symbols_.add(index, builderForValue.build()); onChanged(); } else { symbolsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder addAllSymbols( java.lang.Iterable values) { if (symbolsBuilder_ == null) { ensureSymbolsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll( values, symbols_); onChanged(); } else { symbolsBuilder_.addAllMessages(values); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder clearSymbols() { if (symbolsBuilder_ == null) { symbols_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000004); onChanged(); } else { symbolsBuilder_.clear(); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public Builder removeSymbols(int index) { if (symbolsBuilder_ == null) { ensureSymbolsIsMutable(); symbols_.remove(index); onChanged(); } else { symbolsBuilder_.remove(index); } return this; } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public com.google.cloud.vision.v1.Symbol.Builder getSymbolsBuilder( int index) { return getSymbolsFieldBuilder().getBuilder(index); } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public com.google.cloud.vision.v1.SymbolOrBuilder getSymbolsOrBuilder( int index) { if (symbolsBuilder_ == null) { return symbols_.get(index); } else { return symbolsBuilder_.getMessageOrBuilder(index); } } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public java.util.List getSymbolsOrBuilderList() { if (symbolsBuilder_ != null) { return symbolsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(symbols_); } } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public com.google.cloud.vision.v1.Symbol.Builder addSymbolsBuilder() { return getSymbolsFieldBuilder().addBuilder( com.google.cloud.vision.v1.Symbol.getDefaultInstance()); } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public com.google.cloud.vision.v1.Symbol.Builder addSymbolsBuilder( int index) { return getSymbolsFieldBuilder().addBuilder( index, com.google.cloud.vision.v1.Symbol.getDefaultInstance()); } /** *
     * List of symbols in the word.
     * The order of the symbols follows the natural reading order.
     * 
* * repeated .google.cloud.vision.v1.Symbol symbols = 3; */ public java.util.List getSymbolsBuilderList() { return getSymbolsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.vision.v1.Symbol, com.google.cloud.vision.v1.Symbol.Builder, com.google.cloud.vision.v1.SymbolOrBuilder> getSymbolsFieldBuilder() { if (symbolsBuilder_ == null) { symbolsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.vision.v1.Symbol, com.google.cloud.vision.v1.Symbol.Builder, com.google.cloud.vision.v1.SymbolOrBuilder>( symbols_, ((bitField0_ & 0x00000004) == 0x00000004), getParentForChildren(), isClean()); symbols_ = null; } return symbolsBuilder_; } private float confidence_ ; /** *
     * Confidence of the OCR results for the word. Range [0, 1].
     * 
* * float confidence = 4; */ public float getConfidence() { return confidence_; } /** *
     * Confidence of the OCR results for the word. Range [0, 1].
     * 
* * float confidence = 4; */ public Builder setConfidence(float value) { confidence_ = value; onChanged(); return this; } /** *
     * Confidence of the OCR results for the word. Range [0, 1].
     * 
* * float confidence = 4; */ public Builder clearConfidence() { confidence_ = 0F; onChanged(); return this; } public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFieldsProto3(unknownFields); } public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.vision.v1.Word) } // @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Word) private static final com.google.cloud.vision.v1.Word DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.vision.v1.Word(); } public static com.google.cloud.vision.v1.Word getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { public Word parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new Word(input, extensionRegistry); } }; public static com.google.protobuf.Parser parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser getParserForType() { return PARSER; } public com.google.cloud.vision.v1.Word getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy