com.google.cloud.vision.v1p1beta1.TextAnnotation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-vision-v1p1beta1 Show documentation
Show all versions of proto-google-cloud-vision-v1p1beta1 Show documentation
PROTO library for proto-google-cloud-vision-v1p1beta1
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/vision/v1p1beta1/text_annotation.proto
// Protobuf Java Version: 3.25.5
package com.google.cloud.vision.v1p1beta1;
/**
*
*
*
* TextAnnotation contains a structured representation of OCR extracted text.
* The hierarchy of an OCR extracted text structure is like this:
* TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
* Each structural component, starting from Page, may further have their own
* properties. Properties describe detected languages, breaks etc.. Please refer
* to the
* [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty]
* message definition below for more detail.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation}
*/
public final class TextAnnotation extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.vision.v1p1beta1.TextAnnotation)
TextAnnotationOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextAnnotation.newBuilder() to construct.
private TextAnnotation(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TextAnnotation() {
pages_ = java.util.Collections.emptyList();
text_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new TextAnnotation();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.Builder.class);
}
public interface DetectedLanguageOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @return The languageCode.
*/
java.lang.String getLanguageCode();
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @return The bytes for languageCode.
*/
com.google.protobuf.ByteString getLanguageCodeBytes();
/**
*
*
*
* Confidence of detected language. Range [0, 1].
*
*
* float confidence = 2;
*
* @return The confidence.
*/
float getConfidence();
}
/**
*
*
*
* Detected language for a structural component.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage}
*/
public static final class DetectedLanguage extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage)
DetectedLanguageOrBuilder {
private static final long serialVersionUID = 0L;
// Use DetectedLanguage.newBuilder() to construct.
private DetectedLanguage(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private DetectedLanguage() {
languageCode_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new DetectedLanguage();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedLanguage_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder.class);
}
public static final int LANGUAGE_CODE_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object languageCode_ = "";
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @return The languageCode.
*/
@java.lang.Override
public java.lang.String getLanguageCode() {
java.lang.Object ref = languageCode_;
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();
languageCode_ = s;
return s;
}
}
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @return The bytes for languageCode.
*/
@java.lang.Override
public com.google.protobuf.ByteString getLanguageCodeBytes() {
java.lang.Object ref = languageCode_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
languageCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CONFIDENCE_FIELD_NUMBER = 2;
private float confidence_ = 0F;
/**
*
*
*
* Confidence of detected language. Range [0, 1].
*
*
* float confidence = 2;
*
* @return The confidence.
*/
@java.lang.Override
public float getConfidence() {
return confidence_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, languageCode_);
}
if (java.lang.Float.floatToRawIntBits(confidence_) != 0) {
output.writeFloat(2, confidence_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(languageCode_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, languageCode_);
}
if (java.lang.Float.floatToRawIntBits(confidence_) != 0) {
size += com.google.protobuf.CodedOutputStream.computeFloatSize(2, confidence_);
}
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.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage)) {
return super.equals(obj);
}
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage other =
(com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage) obj;
if (!getLanguageCode().equals(other.getLanguageCode())) return false;
if (java.lang.Float.floatToIntBits(getConfidence())
!= java.lang.Float.floatToIntBits(other.getConfidence())) 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) + LANGUAGE_CODE_FIELD_NUMBER;
hash = (53 * hash) + getLanguageCode().hashCode();
hash = (37 * hash) + CONFIDENCE_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(getConfidence());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage 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.v1p1beta1.TextAnnotation.DetectedLanguage parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage 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.v1p1beta1.TextAnnotation.DetectedLanguage parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage 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.v1p1beta1.TextAnnotation.DetectedLanguage
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
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.v1p1beta1.TextAnnotation.DetectedLanguage parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* Detected language for a structural component.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage)
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedLanguage_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedLanguage_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder.class);
}
// Construct using
// com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
languageCode_ = "";
confidence_ = 0F;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedLanguage_descriptor;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
getDefaultInstanceForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage build() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage buildPartial() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage result =
new com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.languageCode_ = languageCode_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.confidence_ = confidence_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage) {
return mergeFrom(
(com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage other) {
if (other
== com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
.getDefaultInstance()) return this;
if (!other.getLanguageCode().isEmpty()) {
languageCode_ = other.languageCode_;
bitField0_ |= 0x00000001;
onChanged();
}
if (other.getConfidence() != 0F) {
setConfidence(other.getConfidence());
}
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:
{
languageCode_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 21:
{
confidence_ = input.readFloat();
bitField0_ |= 0x00000002;
break;
} // case 21
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.lang.Object languageCode_ = "";
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @return The languageCode.
*/
public java.lang.String getLanguageCode() {
java.lang.Object ref = languageCode_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
languageCode_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @return The bytes for languageCode.
*/
public com.google.protobuf.ByteString getLanguageCodeBytes() {
java.lang.Object ref = languageCode_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
languageCode_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @param value The languageCode to set.
* @return This builder for chaining.
*/
public Builder setLanguageCode(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
languageCode_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @return This builder for chaining.
*/
public Builder clearLanguageCode() {
languageCode_ = getDefaultInstance().getLanguageCode();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* The BCP-47 language code, such as "en-US" or "sr-Latn". For more
* information, see
* http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
*
*
* string language_code = 1;
*
* @param value The bytes for languageCode to set.
* @return This builder for chaining.
*/
public Builder setLanguageCodeBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
languageCode_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private float confidence_;
/**
*
*
*
* Confidence of detected language. Range [0, 1].
*
*
* float confidence = 2;
*
* @return The confidence.
*/
@java.lang.Override
public float getConfidence() {
return confidence_;
}
/**
*
*
*
* Confidence of detected language. Range [0, 1].
*
*
* float confidence = 2;
*
* @param value The confidence to set.
* @return This builder for chaining.
*/
public Builder setConfidence(float value) {
confidence_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Confidence of detected language. Range [0, 1].
*
*
* float confidence = 2;
*
* @return This builder for chaining.
*/
public Builder clearConfidence() {
bitField0_ = (bitField0_ & ~0x00000002);
confidence_ = 0F;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage)
}
// @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage)
private static final com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage();
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public DetectedLanguage 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.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface DetectedBreakOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
* @return The enum numeric value on the wire for type.
*/
int getTypeValue();
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
* @return The type.
*/
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType getType();
/**
*
*
*
* True if break prepends the element.
*
*
* bool is_prefix = 2;
*
* @return The isPrefix.
*/
boolean getIsPrefix();
}
/**
*
*
*
* Detected start or end of a structural component.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak}
*/
public static final class DetectedBreak extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak)
DetectedBreakOrBuilder {
private static final long serialVersionUID = 0L;
// Use DetectedBreak.newBuilder() to construct.
private DetectedBreak(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private DetectedBreak() {
type_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new DetectedBreak();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedBreak_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedBreak_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.Builder.class);
}
/**
*
*
*
* Enum to denote the type of break found. New line, space etc.
*
*
* Protobuf enum {@code google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType}
*/
public enum BreakType implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* Unknown break label type.
*
*
* UNKNOWN = 0;
*/
UNKNOWN(0),
/**
*
*
*
* Regular space.
*
*
* SPACE = 1;
*/
SPACE(1),
/**
*
*
*
* Sure space (very wide).
*
*
* SURE_SPACE = 2;
*/
SURE_SPACE(2),
/**
*
*
*
* Line-wrapping break.
*
*
* EOL_SURE_SPACE = 3;
*/
EOL_SURE_SPACE(3),
/**
*
*
*
* End-line hyphen that is not present in text; does not co-occur with
* `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
*
*
* HYPHEN = 4;
*/
HYPHEN(4),
/**
*
*
*
* Line break that ends a paragraph.
*
*
* LINE_BREAK = 5;
*/
LINE_BREAK(5),
UNRECOGNIZED(-1),
;
/**
*
*
*
* Unknown break label type.
*
*
* UNKNOWN = 0;
*/
public static final int UNKNOWN_VALUE = 0;
/**
*
*
*
* Regular space.
*
*
* SPACE = 1;
*/
public static final int SPACE_VALUE = 1;
/**
*
*
*
* Sure space (very wide).
*
*
* SURE_SPACE = 2;
*/
public static final int SURE_SPACE_VALUE = 2;
/**
*
*
*
* Line-wrapping break.
*
*
* EOL_SURE_SPACE = 3;
*/
public static final int EOL_SURE_SPACE_VALUE = 3;
/**
*
*
*
* End-line hyphen that is not present in text; does not co-occur with
* `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`.
*
*
* HYPHEN = 4;
*/
public static final int HYPHEN_VALUE = 4;
/**
*
*
*
* Line break that ends a paragraph.
*
*
* LINE_BREAK = 5;
*/
public static final int LINE_BREAK_VALUE = 5;
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 BreakType 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 BreakType forNumber(int value) {
switch (value) {
case 0:
return UNKNOWN;
case 1:
return SPACE;
case 2:
return SURE_SPACE;
case 3:
return EOL_SURE_SPACE;
case 4:
return HYPHEN;
case 5:
return LINE_BREAK;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public BreakType findValueByNumber(int number) {
return BreakType.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.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.getDescriptor()
.getEnumTypes()
.get(0);
}
private static final BreakType[] VALUES = values();
public static BreakType 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 BreakType(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType)
}
public static final int TYPE_FIELD_NUMBER = 1;
private int type_ = 0;
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType getType() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType result =
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType.forNumber(type_);
return result == null
? com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType.UNRECOGNIZED
: result;
}
public static final int IS_PREFIX_FIELD_NUMBER = 2;
private boolean isPrefix_ = false;
/**
*
*
*
* True if break prepends the element.
*
*
* bool is_prefix = 2;
*
* @return The isPrefix.
*/
@java.lang.Override
public boolean getIsPrefix() {
return isPrefix_;
}
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 (type_
!= com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType.UNKNOWN
.getNumber()) {
output.writeEnum(1, type_);
}
if (isPrefix_ != false) {
output.writeBool(2, isPrefix_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_
!= com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType.UNKNOWN
.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, type_);
}
if (isPrefix_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(2, isPrefix_);
}
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.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak)) {
return super.equals(obj);
}
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak other =
(com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak) obj;
if (type_ != other.type_) return false;
if (getIsPrefix() != other.getIsPrefix()) 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_;
hash = (37 * hash) + IS_PREFIX_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getIsPrefix());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak 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.v1p1beta1.TextAnnotation.DetectedBreak parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak 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.v1p1beta1.TextAnnotation.DetectedBreak parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak 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.v1p1beta1.TextAnnotation.DetectedBreak parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak 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.v1p1beta1.TextAnnotation.DetectedBreak parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* Detected start or end of a structural component.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak)
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreakOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedBreak_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedBreak_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.Builder.class);
}
// Construct using com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
type_ = 0;
isPrefix_ = false;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_DetectedBreak_descriptor;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak
getDefaultInstanceForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak build() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak buildPartial() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak result =
new com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.type_ = type_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.isPrefix_ = isPrefix_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak) {
return mergeFrom((com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak other) {
if (other
== com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.getDefaultInstance())
return this;
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (other.getIsPrefix() != false) {
setIsPrefix(other.getIsPrefix());
}
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:
{
isPrefix_ = input.readBool();
bitField0_ |= 0x00000002;
break;
} // case 16
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;
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType 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;
}
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType getType() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType result =
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType.forNumber(
type_);
return result == null
? com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType.UNRECOGNIZED
: result;
}
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
*
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000001;
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* Detected break type.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType type = 1;
*
*
* @return This builder for chaining.
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000001);
type_ = 0;
onChanged();
return this;
}
private boolean isPrefix_;
/**
*
*
*
* True if break prepends the element.
*
*
* bool is_prefix = 2;
*
* @return The isPrefix.
*/
@java.lang.Override
public boolean getIsPrefix() {
return isPrefix_;
}
/**
*
*
*
* True if break prepends the element.
*
*
* bool is_prefix = 2;
*
* @param value The isPrefix to set.
* @return This builder for chaining.
*/
public Builder setIsPrefix(boolean value) {
isPrefix_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* True if break prepends the element.
*
*
* bool is_prefix = 2;
*
* @return This builder for chaining.
*/
public Builder clearIsPrefix() {
bitField0_ = (bitField0_ & ~0x00000002);
isPrefix_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak)
}
// @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak)
private static final com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak();
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public DetectedBreak 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.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface TextPropertyOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
java.util.List
getDetectedLanguagesList();
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage getDetectedLanguages(
int index);
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
int getDetectedLanguagesCount();
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
java.util.List<
? extends com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder>
getDetectedLanguagesOrBuilderList();
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder
getDetectedLanguagesOrBuilder(int index);
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
* @return Whether the detectedBreak field is set.
*/
boolean hasDetectedBreak();
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
* @return The detectedBreak.
*/
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak getDetectedBreak();
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*/
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreakOrBuilder
getDetectedBreakOrBuilder();
}
/**
*
*
*
* Additional information detected on the structural component.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty}
*/
public static final class TextProperty extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty)
TextPropertyOrBuilder {
private static final long serialVersionUID = 0L;
// Use TextProperty.newBuilder() to construct.
private TextProperty(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TextProperty() {
detectedLanguages_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new TextProperty();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_TextProperty_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_TextProperty_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.Builder.class);
}
private int bitField0_;
public static final int DETECTED_LANGUAGES_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private java.util.List
detectedLanguages_;
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
@java.lang.Override
public java.util.List
getDetectedLanguagesList() {
return detectedLanguages_;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
@java.lang.Override
public java.util.List<
? extends com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder>
getDetectedLanguagesOrBuilderList() {
return detectedLanguages_;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
@java.lang.Override
public int getDetectedLanguagesCount() {
return detectedLanguages_.size();
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage getDetectedLanguages(
int index) {
return detectedLanguages_.get(index);
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder
getDetectedLanguagesOrBuilder(int index) {
return detectedLanguages_.get(index);
}
public static final int DETECTED_BREAK_FIELD_NUMBER = 2;
private com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detectedBreak_;
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
* @return Whether the detectedBreak field is set.
*/
@java.lang.Override
public boolean hasDetectedBreak() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
* @return The detectedBreak.
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak getDetectedBreak() {
return detectedBreak_ == null
? com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.getDefaultInstance()
: detectedBreak_;
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreakOrBuilder
getDetectedBreakOrBuilder() {
return detectedBreak_ == null
? com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.getDefaultInstance()
: detectedBreak_;
}
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 < detectedLanguages_.size(); i++) {
output.writeMessage(1, detectedLanguages_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(2, getDetectedBreak());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < detectedLanguages_.size(); i++) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(1, detectedLanguages_.get(i));
}
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getDetectedBreak());
}
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.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty)) {
return super.equals(obj);
}
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty other =
(com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty) obj;
if (!getDetectedLanguagesList().equals(other.getDetectedLanguagesList())) return false;
if (hasDetectedBreak() != other.hasDetectedBreak()) return false;
if (hasDetectedBreak()) {
if (!getDetectedBreak().equals(other.getDetectedBreak())) 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 (getDetectedLanguagesCount() > 0) {
hash = (37 * hash) + DETECTED_LANGUAGES_FIELD_NUMBER;
hash = (53 * hash) + getDetectedLanguagesList().hashCode();
}
if (hasDetectedBreak()) {
hash = (37 * hash) + DETECTED_BREAK_FIELD_NUMBER;
hash = (53 * hash) + getDetectedBreak().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty 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.v1p1beta1.TextAnnotation.TextProperty parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty 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.v1p1beta1.TextAnnotation.TextProperty parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty 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.v1p1beta1.TextAnnotation.TextProperty parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty 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.v1p1beta1.TextAnnotation.TextProperty parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* Additional information detected on the structural component.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty)
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextPropertyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_TextProperty_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_TextProperty_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.Builder.class);
}
// Construct using com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getDetectedLanguagesFieldBuilder();
getDetectedBreakFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (detectedLanguagesBuilder_ == null) {
detectedLanguages_ = java.util.Collections.emptyList();
} else {
detectedLanguages_ = null;
detectedLanguagesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
detectedBreak_ = null;
if (detectedBreakBuilder_ != null) {
detectedBreakBuilder_.dispose();
detectedBreakBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_TextProperty_descriptor;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty
getDefaultInstanceForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty build() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty buildPartial() {
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty result =
new com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty result) {
if (detectedLanguagesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
detectedLanguages_ = java.util.Collections.unmodifiableList(detectedLanguages_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.detectedLanguages_ = detectedLanguages_;
} else {
result.detectedLanguages_ = detectedLanguagesBuilder_.build();
}
}
private void buildPartial0(
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.detectedBreak_ =
detectedBreakBuilder_ == null ? detectedBreak_ : detectedBreakBuilder_.build();
to_bitField0_ |= 0x00000001;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty) {
return mergeFrom((com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty other) {
if (other
== com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.getDefaultInstance())
return this;
if (detectedLanguagesBuilder_ == null) {
if (!other.detectedLanguages_.isEmpty()) {
if (detectedLanguages_.isEmpty()) {
detectedLanguages_ = other.detectedLanguages_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureDetectedLanguagesIsMutable();
detectedLanguages_.addAll(other.detectedLanguages_);
}
onChanged();
}
} else {
if (!other.detectedLanguages_.isEmpty()) {
if (detectedLanguagesBuilder_.isEmpty()) {
detectedLanguagesBuilder_.dispose();
detectedLanguagesBuilder_ = null;
detectedLanguages_ = other.detectedLanguages_;
bitField0_ = (bitField0_ & ~0x00000001);
detectedLanguagesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getDetectedLanguagesFieldBuilder()
: null;
} else {
detectedLanguagesBuilder_.addAllMessages(other.detectedLanguages_);
}
}
}
if (other.hasDetectedBreak()) {
mergeDetectedBreak(other.getDetectedBreak());
}
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.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage m =
input.readMessage(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
.parser(),
extensionRegistry);
if (detectedLanguagesBuilder_ == null) {
ensureDetectedLanguagesIsMutable();
detectedLanguages_.add(m);
} else {
detectedLanguagesBuilder_.addMessage(m);
}
break;
} // case 10
case 18:
{
input.readMessage(getDetectedBreakFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000002;
break;
} // case 18
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
detectedLanguages_ = java.util.Collections.emptyList();
private void ensureDetectedLanguagesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
detectedLanguages_ =
new java.util.ArrayList<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage>(
detectedLanguages_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder>
detectedLanguagesBuilder_;
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public java.util.List
getDetectedLanguagesList() {
if (detectedLanguagesBuilder_ == null) {
return java.util.Collections.unmodifiableList(detectedLanguages_);
} else {
return detectedLanguagesBuilder_.getMessageList();
}
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public int getDetectedLanguagesCount() {
if (detectedLanguagesBuilder_ == null) {
return detectedLanguages_.size();
} else {
return detectedLanguagesBuilder_.getCount();
}
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage getDetectedLanguages(
int index) {
if (detectedLanguagesBuilder_ == null) {
return detectedLanguages_.get(index);
} else {
return detectedLanguagesBuilder_.getMessage(index);
}
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder setDetectedLanguages(
int index, com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage value) {
if (detectedLanguagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDetectedLanguagesIsMutable();
detectedLanguages_.set(index, value);
onChanged();
} else {
detectedLanguagesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder setDetectedLanguages(
int index,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder
builderForValue) {
if (detectedLanguagesBuilder_ == null) {
ensureDetectedLanguagesIsMutable();
detectedLanguages_.set(index, builderForValue.build());
onChanged();
} else {
detectedLanguagesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder addDetectedLanguages(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage value) {
if (detectedLanguagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDetectedLanguagesIsMutable();
detectedLanguages_.add(value);
onChanged();
} else {
detectedLanguagesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder addDetectedLanguages(
int index, com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage value) {
if (detectedLanguagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureDetectedLanguagesIsMutable();
detectedLanguages_.add(index, value);
onChanged();
} else {
detectedLanguagesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder addDetectedLanguages(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder
builderForValue) {
if (detectedLanguagesBuilder_ == null) {
ensureDetectedLanguagesIsMutable();
detectedLanguages_.add(builderForValue.build());
onChanged();
} else {
detectedLanguagesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder addDetectedLanguages(
int index,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder
builderForValue) {
if (detectedLanguagesBuilder_ == null) {
ensureDetectedLanguagesIsMutable();
detectedLanguages_.add(index, builderForValue.build());
onChanged();
} else {
detectedLanguagesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder addAllDetectedLanguages(
java.lang.Iterable<
? extends com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage>
values) {
if (detectedLanguagesBuilder_ == null) {
ensureDetectedLanguagesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, detectedLanguages_);
onChanged();
} else {
detectedLanguagesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder clearDetectedLanguages() {
if (detectedLanguagesBuilder_ == null) {
detectedLanguages_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
detectedLanguagesBuilder_.clear();
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public Builder removeDetectedLanguages(int index) {
if (detectedLanguagesBuilder_ == null) {
ensureDetectedLanguagesIsMutable();
detectedLanguages_.remove(index);
onChanged();
} else {
detectedLanguagesBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder
getDetectedLanguagesBuilder(int index) {
return getDetectedLanguagesFieldBuilder().getBuilder(index);
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder
getDetectedLanguagesOrBuilder(int index) {
if (detectedLanguagesBuilder_ == null) {
return detectedLanguages_.get(index);
} else {
return detectedLanguagesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public java.util.List<
? extends com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder>
getDetectedLanguagesOrBuilderList() {
if (detectedLanguagesBuilder_ != null) {
return detectedLanguagesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(detectedLanguages_);
}
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder
addDetectedLanguagesBuilder() {
return getDetectedLanguagesFieldBuilder()
.addBuilder(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
.getDefaultInstance());
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder
addDetectedLanguagesBuilder(int index) {
return getDetectedLanguagesFieldBuilder()
.addBuilder(
index,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage
.getDefaultInstance());
}
/**
*
*
*
* A list of detected languages together with confidence.
*
*
*
* repeated .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage detected_languages = 1;
*
*/
public java.util.List<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder>
getDetectedLanguagesBuilderList() {
return getDetectedLanguagesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder>
getDetectedLanguagesFieldBuilder() {
if (detectedLanguagesBuilder_ == null) {
detectedLanguagesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.Builder,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguageOrBuilder>(
detectedLanguages_,
((bitField0_ & 0x00000001) != 0),
getParentForChildren(),
isClean());
detectedLanguages_ = null;
}
return detectedLanguagesBuilder_;
}
private com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detectedBreak_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.Builder,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreakOrBuilder>
detectedBreakBuilder_;
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*
* @return Whether the detectedBreak field is set.
*/
public boolean hasDetectedBreak() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*
* @return The detectedBreak.
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak getDetectedBreak() {
if (detectedBreakBuilder_ == null) {
return detectedBreak_ == null
? com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.getDefaultInstance()
: detectedBreak_;
} else {
return detectedBreakBuilder_.getMessage();
}
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*/
public Builder setDetectedBreak(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak value) {
if (detectedBreakBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
detectedBreak_ = value;
} else {
detectedBreakBuilder_.setMessage(value);
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*/
public Builder setDetectedBreak(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.Builder builderForValue) {
if (detectedBreakBuilder_ == null) {
detectedBreak_ = builderForValue.build();
} else {
detectedBreakBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*/
public Builder mergeDetectedBreak(
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak value) {
if (detectedBreakBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)
&& detectedBreak_ != null
&& detectedBreak_
!= com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak
.getDefaultInstance()) {
getDetectedBreakBuilder().mergeFrom(value);
} else {
detectedBreak_ = value;
}
} else {
detectedBreakBuilder_.mergeFrom(value);
}
if (detectedBreak_ != null) {
bitField0_ |= 0x00000002;
onChanged();
}
return this;
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*/
public Builder clearDetectedBreak() {
bitField0_ = (bitField0_ & ~0x00000002);
detectedBreak_ = null;
if (detectedBreakBuilder_ != null) {
detectedBreakBuilder_.dispose();
detectedBreakBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.Builder
getDetectedBreakBuilder() {
bitField0_ |= 0x00000002;
onChanged();
return getDetectedBreakFieldBuilder().getBuilder();
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*/
public com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreakOrBuilder
getDetectedBreakOrBuilder() {
if (detectedBreakBuilder_ != null) {
return detectedBreakBuilder_.getMessageOrBuilder();
} else {
return detectedBreak_ == null
? com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.getDefaultInstance()
: detectedBreak_;
}
}
/**
*
*
*
* Detected start or end of a text segment.
*
*
* .google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak detected_break = 2;
*
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.Builder,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreakOrBuilder>
getDetectedBreakFieldBuilder() {
if (detectedBreakBuilder_ == null) {
detectedBreakBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.Builder,
com.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreakOrBuilder>(
getDetectedBreak(), getParentForChildren(), isClean());
detectedBreak_ = null;
}
return detectedBreakBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty)
}
// @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty)
private static final com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty();
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TextProperty 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.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int PAGES_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private java.util.List pages_;
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
@java.lang.Override
public java.util.List getPagesList() {
return pages_;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
@java.lang.Override
public java.util.List extends com.google.cloud.vision.v1p1beta1.PageOrBuilder>
getPagesOrBuilderList() {
return pages_;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
@java.lang.Override
public int getPagesCount() {
return pages_.size();
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.Page getPages(int index) {
return pages_.get(index);
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.PageOrBuilder getPagesOrBuilder(int index) {
return pages_.get(index);
}
public static final int TEXT_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object text_ = "";
/**
*
*
*
* UTF-8 text detected on the pages.
*
*
* string text = 2;
*
* @return The text.
*/
@java.lang.Override
public java.lang.String getText() {
java.lang.Object ref = text_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
text_ = s;
return s;
}
}
/**
*
*
*
* UTF-8 text detected on the pages.
*
*
* string text = 2;
*
* @return The bytes for text.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTextBytes() {
java.lang.Object ref = text_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
text_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
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 < pages_.size(); i++) {
output.writeMessage(1, pages_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, text_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < pages_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, pages_.get(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(text_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, text_);
}
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.google.cloud.vision.v1p1beta1.TextAnnotation)) {
return super.equals(obj);
}
com.google.cloud.vision.v1p1beta1.TextAnnotation other =
(com.google.cloud.vision.v1p1beta1.TextAnnotation) obj;
if (!getPagesList().equals(other.getPagesList())) return false;
if (!getText().equals(other.getText())) 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 (getPagesCount() > 0) {
hash = (37 * hash) + PAGES_FIELD_NUMBER;
hash = (53 * hash) + getPagesList().hashCode();
}
hash = (37 * hash) + TEXT_FIELD_NUMBER;
hash = (53 * hash) + getText().hashCode();
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation 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.v1p1beta1.TextAnnotation parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation 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.v1p1beta1.TextAnnotation parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation 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.v1p1beta1.TextAnnotation parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation 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.v1p1beta1.TextAnnotation parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.vision.v1p1beta1.TextAnnotation prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* TextAnnotation contains a structured representation of OCR extracted text.
* The hierarchy of an OCR extracted text structure is like this:
* TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol
* Each structural component, starting from Page, may further have their own
* properties. Properties describe detected languages, breaks etc.. Please refer
* to the
* [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty]
* message definition below for more detail.
*
*
* Protobuf type {@code google.cloud.vision.v1p1beta1.TextAnnotation}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.vision.v1p1beta1.TextAnnotation)
com.google.cloud.vision.v1p1beta1.TextAnnotationOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.vision.v1p1beta1.TextAnnotation.class,
com.google.cloud.vision.v1p1beta1.TextAnnotation.Builder.class);
}
// Construct using com.google.cloud.vision.v1p1beta1.TextAnnotation.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (pagesBuilder_ == null) {
pages_ = java.util.Collections.emptyList();
} else {
pages_ = null;
pagesBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000001);
text_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotationProto
.internal_static_google_cloud_vision_v1p1beta1_TextAnnotation_descriptor;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation getDefaultInstanceForType() {
return com.google.cloud.vision.v1p1beta1.TextAnnotation.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation build() {
com.google.cloud.vision.v1p1beta1.TextAnnotation result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.vision.v1p1beta1.TextAnnotation buildPartial() {
com.google.cloud.vision.v1p1beta1.TextAnnotation result =
new com.google.cloud.vision.v1p1beta1.TextAnnotation(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.vision.v1p1beta1.TextAnnotation result) {
if (pagesBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)) {
pages_ = java.util.Collections.unmodifiableList(pages_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.pages_ = pages_;
} else {
result.pages_ = pagesBuilder_.build();
}
}
private void buildPartial0(com.google.cloud.vision.v1p1beta1.TextAnnotation result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000002) != 0)) {
result.text_ = text_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.vision.v1p1beta1.TextAnnotation) {
return mergeFrom((com.google.cloud.vision.v1p1beta1.TextAnnotation) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.vision.v1p1beta1.TextAnnotation other) {
if (other == com.google.cloud.vision.v1p1beta1.TextAnnotation.getDefaultInstance())
return this;
if (pagesBuilder_ == null) {
if (!other.pages_.isEmpty()) {
if (pages_.isEmpty()) {
pages_ = other.pages_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensurePagesIsMutable();
pages_.addAll(other.pages_);
}
onChanged();
}
} else {
if (!other.pages_.isEmpty()) {
if (pagesBuilder_.isEmpty()) {
pagesBuilder_.dispose();
pagesBuilder_ = null;
pages_ = other.pages_;
bitField0_ = (bitField0_ & ~0x00000001);
pagesBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getPagesFieldBuilder()
: null;
} else {
pagesBuilder_.addAllMessages(other.pages_);
}
}
}
if (!other.getText().isEmpty()) {
text_ = other.text_;
bitField0_ |= 0x00000002;
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 10:
{
com.google.cloud.vision.v1p1beta1.Page m =
input.readMessage(
com.google.cloud.vision.v1p1beta1.Page.parser(), extensionRegistry);
if (pagesBuilder_ == null) {
ensurePagesIsMutable();
pages_.add(m);
} else {
pagesBuilder_.addMessage(m);
}
break;
} // case 10
case 18:
{
text_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
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 pages_ =
java.util.Collections.emptyList();
private void ensurePagesIsMutable() {
if (!((bitField0_ & 0x00000001) != 0)) {
pages_ = new java.util.ArrayList(pages_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.Page,
com.google.cloud.vision.v1p1beta1.Page.Builder,
com.google.cloud.vision.v1p1beta1.PageOrBuilder>
pagesBuilder_;
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public java.util.List getPagesList() {
if (pagesBuilder_ == null) {
return java.util.Collections.unmodifiableList(pages_);
} else {
return pagesBuilder_.getMessageList();
}
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public int getPagesCount() {
if (pagesBuilder_ == null) {
return pages_.size();
} else {
return pagesBuilder_.getCount();
}
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public com.google.cloud.vision.v1p1beta1.Page getPages(int index) {
if (pagesBuilder_ == null) {
return pages_.get(index);
} else {
return pagesBuilder_.getMessage(index);
}
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder setPages(int index, com.google.cloud.vision.v1p1beta1.Page value) {
if (pagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePagesIsMutable();
pages_.set(index, value);
onChanged();
} else {
pagesBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder setPages(
int index, com.google.cloud.vision.v1p1beta1.Page.Builder builderForValue) {
if (pagesBuilder_ == null) {
ensurePagesIsMutable();
pages_.set(index, builderForValue.build());
onChanged();
} else {
pagesBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder addPages(com.google.cloud.vision.v1p1beta1.Page value) {
if (pagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePagesIsMutable();
pages_.add(value);
onChanged();
} else {
pagesBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder addPages(int index, com.google.cloud.vision.v1p1beta1.Page value) {
if (pagesBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensurePagesIsMutable();
pages_.add(index, value);
onChanged();
} else {
pagesBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder addPages(com.google.cloud.vision.v1p1beta1.Page.Builder builderForValue) {
if (pagesBuilder_ == null) {
ensurePagesIsMutable();
pages_.add(builderForValue.build());
onChanged();
} else {
pagesBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder addPages(
int index, com.google.cloud.vision.v1p1beta1.Page.Builder builderForValue) {
if (pagesBuilder_ == null) {
ensurePagesIsMutable();
pages_.add(index, builderForValue.build());
onChanged();
} else {
pagesBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder addAllPages(
java.lang.Iterable extends com.google.cloud.vision.v1p1beta1.Page> values) {
if (pagesBuilder_ == null) {
ensurePagesIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, pages_);
onChanged();
} else {
pagesBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder clearPages() {
if (pagesBuilder_ == null) {
pages_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
pagesBuilder_.clear();
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public Builder removePages(int index) {
if (pagesBuilder_ == null) {
ensurePagesIsMutable();
pages_.remove(index);
onChanged();
} else {
pagesBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public com.google.cloud.vision.v1p1beta1.Page.Builder getPagesBuilder(int index) {
return getPagesFieldBuilder().getBuilder(index);
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public com.google.cloud.vision.v1p1beta1.PageOrBuilder getPagesOrBuilder(int index) {
if (pagesBuilder_ == null) {
return pages_.get(index);
} else {
return pagesBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public java.util.List extends com.google.cloud.vision.v1p1beta1.PageOrBuilder>
getPagesOrBuilderList() {
if (pagesBuilder_ != null) {
return pagesBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(pages_);
}
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public com.google.cloud.vision.v1p1beta1.Page.Builder addPagesBuilder() {
return getPagesFieldBuilder()
.addBuilder(com.google.cloud.vision.v1p1beta1.Page.getDefaultInstance());
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public com.google.cloud.vision.v1p1beta1.Page.Builder addPagesBuilder(int index) {
return getPagesFieldBuilder()
.addBuilder(index, com.google.cloud.vision.v1p1beta1.Page.getDefaultInstance());
}
/**
*
*
*
* List of pages detected by OCR.
*
*
* repeated .google.cloud.vision.v1p1beta1.Page pages = 1;
*/
public java.util.List getPagesBuilderList() {
return getPagesFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.Page,
com.google.cloud.vision.v1p1beta1.Page.Builder,
com.google.cloud.vision.v1p1beta1.PageOrBuilder>
getPagesFieldBuilder() {
if (pagesBuilder_ == null) {
pagesBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.vision.v1p1beta1.Page,
com.google.cloud.vision.v1p1beta1.Page.Builder,
com.google.cloud.vision.v1p1beta1.PageOrBuilder>(
pages_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean());
pages_ = null;
}
return pagesBuilder_;
}
private java.lang.Object text_ = "";
/**
*
*
*
* UTF-8 text detected on the pages.
*
*
* string text = 2;
*
* @return The text.
*/
public java.lang.String getText() {
java.lang.Object ref = text_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
text_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* UTF-8 text detected on the pages.
*
*
* string text = 2;
*
* @return The bytes for text.
*/
public com.google.protobuf.ByteString getTextBytes() {
java.lang.Object ref = text_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
text_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* UTF-8 text detected on the pages.
*
*
* string text = 2;
*
* @param value The text to set.
* @return This builder for chaining.
*/
public Builder setText(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
text_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* UTF-8 text detected on the pages.
*
*
* string text = 2;
*
* @return This builder for chaining.
*/
public Builder clearText() {
text_ = getDefaultInstance().getText();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* UTF-8 text detected on the pages.
*
*
* string text = 2;
*
* @param value The bytes for text to set.
* @return This builder for chaining.
*/
public Builder setTextBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
text_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.vision.v1p1beta1.TextAnnotation)
}
// @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation)
private static final com.google.cloud.vision.v1p1beta1.TextAnnotation DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.vision.v1p1beta1.TextAnnotation();
}
public static com.google.cloud.vision.v1p1beta1.TextAnnotation getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TextAnnotation 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.google.cloud.vision.v1p1beta1.TextAnnotation getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy