com.google.cloud.documentai.v1beta3.Document Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-document-ai-v1beta3 Show documentation
Show all versions of proto-google-cloud-document-ai-v1beta3 Show documentation
PROTO library for proto-google-cloud-document-ai-v1beta3
/*
* Copyright 2020 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/documentai/v1beta3/document.proto
package com.google.cloud.documentai.v1beta3;
/**
*
*
*
* Document represents the canonical document resource in Document Understanding
* AI.
* It is an interchange format that provides insights into documents and allows
* for collaboration between users and Document Understanding AI to iterate and
* optimize for quality.
*
*
* Protobuf type {@code google.cloud.documentai.v1beta3.Document}
*/
public final class Document extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.Document)
DocumentOrBuilder {
private static final long serialVersionUID = 0L;
// Use Document.newBuilder() to construct.
private Document(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Document() {
mimeType_ = "";
text_ = "";
textStyles_ = java.util.Collections.emptyList();
pages_ = java.util.Collections.emptyList();
entities_ = java.util.Collections.emptyList();
entityRelations_ = java.util.Collections.emptyList();
textChanges_ = java.util.Collections.emptyList();
revisions_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Document();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private Document(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
java.lang.String s = input.readStringRequireUtf8();
sourceCase_ = 1;
source_ = s;
break;
}
case 18:
{
sourceCase_ = 2;
source_ = input.readBytes();
break;
}
case 26:
{
java.lang.String s = input.readStringRequireUtf8();
mimeType_ = s;
break;
}
case 34:
{
java.lang.String s = input.readStringRequireUtf8();
text_ = s;
break;
}
case 42:
{
if (!((mutable_bitField0_ & 0x00000001) != 0)) {
textStyles_ =
new java.util.ArrayList();
mutable_bitField0_ |= 0x00000001;
}
textStyles_.add(
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.Style.parser(),
extensionRegistry));
break;
}
case 50:
{
if (!((mutable_bitField0_ & 0x00000002) != 0)) {
pages_ =
new java.util.ArrayList();
mutable_bitField0_ |= 0x00000002;
}
pages_.add(
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.Page.parser(),
extensionRegistry));
break;
}
case 58:
{
if (!((mutable_bitField0_ & 0x00000004) != 0)) {
entities_ =
new java.util.ArrayList();
mutable_bitField0_ |= 0x00000004;
}
entities_.add(
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.Entity.parser(),
extensionRegistry));
break;
}
case 66:
{
if (!((mutable_bitField0_ & 0x00000008) != 0)) {
entityRelations_ =
new java.util.ArrayList<
com.google.cloud.documentai.v1beta3.Document.EntityRelation>();
mutable_bitField0_ |= 0x00000008;
}
entityRelations_.add(
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.EntityRelation.parser(),
extensionRegistry));
break;
}
case 74:
{
com.google.cloud.documentai.v1beta3.Document.ShardInfo.Builder subBuilder = null;
if (shardInfo_ != null) {
subBuilder = shardInfo_.toBuilder();
}
shardInfo_ =
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.ShardInfo.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(shardInfo_);
shardInfo_ = subBuilder.buildPartial();
}
break;
}
case 82:
{
com.google.rpc.Status.Builder subBuilder = null;
if (error_ != null) {
subBuilder = error_.toBuilder();
}
error_ = input.readMessage(com.google.rpc.Status.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(error_);
error_ = subBuilder.buildPartial();
}
break;
}
case 106:
{
if (!((mutable_bitField0_ & 0x00000020) != 0)) {
revisions_ =
new java.util.ArrayList<
com.google.cloud.documentai.v1beta3.Document.Revision>();
mutable_bitField0_ |= 0x00000020;
}
revisions_.add(
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.Revision.parser(),
extensionRegistry));
break;
}
case 114:
{
if (!((mutable_bitField0_ & 0x00000010) != 0)) {
textChanges_ =
new java.util.ArrayList<
com.google.cloud.documentai.v1beta3.Document.TextChange>();
mutable_bitField0_ |= 0x00000010;
}
textChanges_.add(
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.TextChange.parser(),
extensionRegistry));
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) != 0)) {
textStyles_ = java.util.Collections.unmodifiableList(textStyles_);
}
if (((mutable_bitField0_ & 0x00000002) != 0)) {
pages_ = java.util.Collections.unmodifiableList(pages_);
}
if (((mutable_bitField0_ & 0x00000004) != 0)) {
entities_ = java.util.Collections.unmodifiableList(entities_);
}
if (((mutable_bitField0_ & 0x00000008) != 0)) {
entityRelations_ = java.util.Collections.unmodifiableList(entityRelations_);
}
if (((mutable_bitField0_ & 0x00000020) != 0)) {
revisions_ = java.util.Collections.unmodifiableList(revisions_);
}
if (((mutable_bitField0_ & 0x00000010) != 0)) {
textChanges_ = java.util.Collections.unmodifiableList(textChanges_);
}
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.documentai.v1beta3.Document.class,
com.google.cloud.documentai.v1beta3.Document.Builder.class);
}
public interface ShardInfoOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.Document.ShardInfo)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* The 0-based index of this shard.
*
*
* int64 shard_index = 1;
*
* @return The shardIndex.
*/
long getShardIndex();
/**
*
*
*
* Total number of shards.
*
*
* int64 shard_count = 2;
*
* @return The shardCount.
*/
long getShardCount();
/**
*
*
*
* The index of the first character in
* [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
* overall document global text.
*
*
* int64 text_offset = 3;
*
* @return The textOffset.
*/
long getTextOffset();
}
/**
*
*
*
* For a large document, sharding may be performed to produce several
* document shards. Each document shard contains this field to detail which
* shard it is.
*
*
* Protobuf type {@code google.cloud.documentai.v1beta3.Document.ShardInfo}
*/
public static final class ShardInfo extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.Document.ShardInfo)
ShardInfoOrBuilder {
private static final long serialVersionUID = 0L;
// Use ShardInfo.newBuilder() to construct.
private ShardInfo(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private ShardInfo() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new ShardInfo();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private ShardInfo(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8:
{
shardIndex_ = input.readInt64();
break;
}
case 16:
{
shardCount_ = input.readInt64();
break;
}
case 24:
{
textOffset_ = input.readInt64();
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_ShardInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_ShardInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.documentai.v1beta3.Document.ShardInfo.class,
com.google.cloud.documentai.v1beta3.Document.ShardInfo.Builder.class);
}
public static final int SHARD_INDEX_FIELD_NUMBER = 1;
private long shardIndex_;
/**
*
*
*
* The 0-based index of this shard.
*
*
* int64 shard_index = 1;
*
* @return The shardIndex.
*/
@java.lang.Override
public long getShardIndex() {
return shardIndex_;
}
public static final int SHARD_COUNT_FIELD_NUMBER = 2;
private long shardCount_;
/**
*
*
*
* Total number of shards.
*
*
* int64 shard_count = 2;
*
* @return The shardCount.
*/
@java.lang.Override
public long getShardCount() {
return shardCount_;
}
public static final int TEXT_OFFSET_FIELD_NUMBER = 3;
private long textOffset_;
/**
*
*
*
* The index of the first character in
* [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
* overall document global text.
*
*
* int64 text_offset = 3;
*
* @return The textOffset.
*/
@java.lang.Override
public long getTextOffset() {
return textOffset_;
}
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 (shardIndex_ != 0L) {
output.writeInt64(1, shardIndex_);
}
if (shardCount_ != 0L) {
output.writeInt64(2, shardCount_);
}
if (textOffset_ != 0L) {
output.writeInt64(3, textOffset_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (shardIndex_ != 0L) {
size += com.google.protobuf.CodedOutputStream.computeInt64Size(1, shardIndex_);
}
if (shardCount_ != 0L) {
size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, shardCount_);
}
if (textOffset_ != 0L) {
size += com.google.protobuf.CodedOutputStream.computeInt64Size(3, textOffset_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.documentai.v1beta3.Document.ShardInfo)) {
return super.equals(obj);
}
com.google.cloud.documentai.v1beta3.Document.ShardInfo other =
(com.google.cloud.documentai.v1beta3.Document.ShardInfo) obj;
if (getShardIndex() != other.getShardIndex()) return false;
if (getShardCount() != other.getShardCount()) return false;
if (getTextOffset() != other.getTextOffset()) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SHARD_INDEX_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getShardIndex());
hash = (37 * hash) + SHARD_COUNT_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getShardCount());
hash = (37 * hash) + TEXT_OFFSET_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(getTextOffset());
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo 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.documentai.v1beta3.Document.ShardInfo parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo 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.documentai.v1beta3.Document.ShardInfo parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo 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.documentai.v1beta3.Document.ShardInfo parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo 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.documentai.v1beta3.Document.ShardInfo parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo 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.documentai.v1beta3.Document.ShardInfo 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;
}
/**
*
*
*
* For a large document, sharding may be performed to produce several
* document shards. Each document shard contains this field to detail which
* shard it is.
*
*
* Protobuf type {@code google.cloud.documentai.v1beta3.Document.ShardInfo}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.Document.ShardInfo)
com.google.cloud.documentai.v1beta3.Document.ShardInfoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_ShardInfo_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_ShardInfo_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.documentai.v1beta3.Document.ShardInfo.class,
com.google.cloud.documentai.v1beta3.Document.ShardInfo.Builder.class);
}
// Construct using com.google.cloud.documentai.v1beta3.Document.ShardInfo.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
shardIndex_ = 0L;
shardCount_ = 0L;
textOffset_ = 0L;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_ShardInfo_descriptor;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.ShardInfo getDefaultInstanceForType() {
return com.google.cloud.documentai.v1beta3.Document.ShardInfo.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.ShardInfo build() {
com.google.cloud.documentai.v1beta3.Document.ShardInfo result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.ShardInfo buildPartial() {
com.google.cloud.documentai.v1beta3.Document.ShardInfo result =
new com.google.cloud.documentai.v1beta3.Document.ShardInfo(this);
result.shardIndex_ = shardIndex_;
result.shardCount_ = shardCount_;
result.textOffset_ = textOffset_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.documentai.v1beta3.Document.ShardInfo) {
return mergeFrom((com.google.cloud.documentai.v1beta3.Document.ShardInfo) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.documentai.v1beta3.Document.ShardInfo other) {
if (other == com.google.cloud.documentai.v1beta3.Document.ShardInfo.getDefaultInstance())
return this;
if (other.getShardIndex() != 0L) {
setShardIndex(other.getShardIndex());
}
if (other.getShardCount() != 0L) {
setShardCount(other.getShardCount());
}
if (other.getTextOffset() != 0L) {
setTextOffset(other.getTextOffset());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.documentai.v1beta3.Document.ShardInfo parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage =
(com.google.cloud.documentai.v1beta3.Document.ShardInfo) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private long shardIndex_;
/**
*
*
*
* The 0-based index of this shard.
*
*
* int64 shard_index = 1;
*
* @return The shardIndex.
*/
@java.lang.Override
public long getShardIndex() {
return shardIndex_;
}
/**
*
*
*
* The 0-based index of this shard.
*
*
* int64 shard_index = 1;
*
* @param value The shardIndex to set.
* @return This builder for chaining.
*/
public Builder setShardIndex(long value) {
shardIndex_ = value;
onChanged();
return this;
}
/**
*
*
*
* The 0-based index of this shard.
*
*
* int64 shard_index = 1;
*
* @return This builder for chaining.
*/
public Builder clearShardIndex() {
shardIndex_ = 0L;
onChanged();
return this;
}
private long shardCount_;
/**
*
*
*
* Total number of shards.
*
*
* int64 shard_count = 2;
*
* @return The shardCount.
*/
@java.lang.Override
public long getShardCount() {
return shardCount_;
}
/**
*
*
*
* Total number of shards.
*
*
* int64 shard_count = 2;
*
* @param value The shardCount to set.
* @return This builder for chaining.
*/
public Builder setShardCount(long value) {
shardCount_ = value;
onChanged();
return this;
}
/**
*
*
*
* Total number of shards.
*
*
* int64 shard_count = 2;
*
* @return This builder for chaining.
*/
public Builder clearShardCount() {
shardCount_ = 0L;
onChanged();
return this;
}
private long textOffset_;
/**
*
*
*
* The index of the first character in
* [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
* overall document global text.
*
*
* int64 text_offset = 3;
*
* @return The textOffset.
*/
@java.lang.Override
public long getTextOffset() {
return textOffset_;
}
/**
*
*
*
* The index of the first character in
* [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
* overall document global text.
*
*
* int64 text_offset = 3;
*
* @param value The textOffset to set.
* @return This builder for chaining.
*/
public Builder setTextOffset(long value) {
textOffset_ = value;
onChanged();
return this;
}
/**
*
*
*
* The index of the first character in
* [Document.text][google.cloud.documentai.v1beta3.Document.text] in the
* overall document global text.
*
*
* int64 text_offset = 3;
*
* @return This builder for chaining.
*/
public Builder clearTextOffset() {
textOffset_ = 0L;
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.documentai.v1beta3.Document.ShardInfo)
}
// @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.ShardInfo)
private static final com.google.cloud.documentai.v1beta3.Document.ShardInfo DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.Document.ShardInfo();
}
public static com.google.cloud.documentai.v1beta3.Document.ShardInfo getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public ShardInfo parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new ShardInfo(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.ShardInfo getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public interface StyleOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.Document.Style)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*
* @return Whether the textAnchor field is set.
*/
boolean hasTextAnchor();
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*
* @return The textAnchor.
*/
com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor();
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
com.google.cloud.documentai.v1beta3.Document.TextAnchorOrBuilder getTextAnchorOrBuilder();
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*
* @return Whether the color field is set.
*/
boolean hasColor();
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*
* @return The color.
*/
com.google.type.Color getColor();
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
com.google.type.ColorOrBuilder getColorOrBuilder();
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*
* @return Whether the backgroundColor field is set.
*/
boolean hasBackgroundColor();
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*
* @return The backgroundColor.
*/
com.google.type.Color getBackgroundColor();
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
com.google.type.ColorOrBuilder getBackgroundColorOrBuilder();
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @return The fontWeight.
*/
java.lang.String getFontWeight();
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @return The bytes for fontWeight.
*/
com.google.protobuf.ByteString getFontWeightBytes();
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @return The textStyle.
*/
java.lang.String getTextStyle();
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @return The bytes for textStyle.
*/
com.google.protobuf.ByteString getTextStyleBytes();
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @return The textDecoration.
*/
java.lang.String getTextDecoration();
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @return The bytes for textDecoration.
*/
com.google.protobuf.ByteString getTextDecorationBytes();
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*
* @return Whether the fontSize field is set.
*/
boolean hasFontSize();
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*
* @return The fontSize.
*/
com.google.cloud.documentai.v1beta3.Document.Style.FontSize getFontSize();
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
com.google.cloud.documentai.v1beta3.Document.Style.FontSizeOrBuilder getFontSizeOrBuilder();
}
/**
*
*
*
* Annotation for common text style attributes. This adheres to CSS
* conventions as much as possible.
*
*
* Protobuf type {@code google.cloud.documentai.v1beta3.Document.Style}
*/
public static final class Style extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.Document.Style)
StyleOrBuilder {
private static final long serialVersionUID = 0L;
// Use Style.newBuilder() to construct.
private Style(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Style() {
fontWeight_ = "";
textStyle_ = "";
textDecoration_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Style();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private Style(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
com.google.cloud.documentai.v1beta3.Document.TextAnchor.Builder subBuilder = null;
if (textAnchor_ != null) {
subBuilder = textAnchor_.toBuilder();
}
textAnchor_ =
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.TextAnchor.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(textAnchor_);
textAnchor_ = subBuilder.buildPartial();
}
break;
}
case 18:
{
com.google.type.Color.Builder subBuilder = null;
if (color_ != null) {
subBuilder = color_.toBuilder();
}
color_ = input.readMessage(com.google.type.Color.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(color_);
color_ = subBuilder.buildPartial();
}
break;
}
case 26:
{
com.google.type.Color.Builder subBuilder = null;
if (backgroundColor_ != null) {
subBuilder = backgroundColor_.toBuilder();
}
backgroundColor_ =
input.readMessage(com.google.type.Color.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(backgroundColor_);
backgroundColor_ = subBuilder.buildPartial();
}
break;
}
case 34:
{
java.lang.String s = input.readStringRequireUtf8();
fontWeight_ = s;
break;
}
case 42:
{
java.lang.String s = input.readStringRequireUtf8();
textStyle_ = s;
break;
}
case 50:
{
java.lang.String s = input.readStringRequireUtf8();
textDecoration_ = s;
break;
}
case 58:
{
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder subBuilder =
null;
if (fontSize_ != null) {
subBuilder = fontSize_.toBuilder();
}
fontSize_ =
input.readMessage(
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.parser(),
extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(fontSize_);
fontSize_ = subBuilder.buildPartial();
}
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.documentai.v1beta3.Document.Style.class,
com.google.cloud.documentai.v1beta3.Document.Style.Builder.class);
}
public interface FontSizeOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.documentai.v1beta3.Document.Style.FontSize)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* Font size for the text.
*
*
* float size = 1;
*
* @return The size.
*/
float getSize();
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @return The unit.
*/
java.lang.String getUnit();
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @return The bytes for unit.
*/
com.google.protobuf.ByteString getUnitBytes();
}
/**
*
*
*
* Font size with unit.
*
*
* Protobuf type {@code google.cloud.documentai.v1beta3.Document.Style.FontSize}
*/
public static final class FontSize extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.documentai.v1beta3.Document.Style.FontSize)
FontSizeOrBuilder {
private static final long serialVersionUID = 0L;
// Use FontSize.newBuilder() to construct.
private FontSize(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private FontSize() {
unit_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new FontSize();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private FontSize(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 13:
{
size_ = input.readFloat();
break;
}
case 18:
{
java.lang.String s = input.readStringRequireUtf8();
unit_ = s;
break;
}
default:
{
if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_FontSize_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_FontSize_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.class,
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder.class);
}
public static final int SIZE_FIELD_NUMBER = 1;
private float size_;
/**
*
*
*
* Font size for the text.
*
*
* float size = 1;
*
* @return The size.
*/
@java.lang.Override
public float getSize() {
return size_;
}
public static final int UNIT_FIELD_NUMBER = 2;
private volatile java.lang.Object unit_;
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @return The unit.
*/
@java.lang.Override
public java.lang.String getUnit() {
java.lang.Object ref = unit_;
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();
unit_ = s;
return s;
}
}
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @return The bytes for unit.
*/
@java.lang.Override
public com.google.protobuf.ByteString getUnitBytes() {
java.lang.Object ref = unit_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
unit_ = 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 {
if (size_ != 0F) {
output.writeFloat(1, size_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, unit_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (size_ != 0F) {
size += com.google.protobuf.CodedOutputStream.computeFloatSize(1, size_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(unit_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, unit_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.documentai.v1beta3.Document.Style.FontSize)) {
return super.equals(obj);
}
com.google.cloud.documentai.v1beta3.Document.Style.FontSize other =
(com.google.cloud.documentai.v1beta3.Document.Style.FontSize) obj;
if (java.lang.Float.floatToIntBits(getSize())
!= java.lang.Float.floatToIntBits(other.getSize())) return false;
if (!getUnit().equals(other.getUnit())) return false;
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + SIZE_FIELD_NUMBER;
hash = (53 * hash) + java.lang.Float.floatToIntBits(getSize());
hash = (37 * hash) + UNIT_FIELD_NUMBER;
hash = (53 * hash) + getUnit().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize 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.documentai.v1beta3.Document.Style.FontSize parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize 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.documentai.v1beta3.Document.Style.FontSize parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize 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.documentai.v1beta3.Document.Style.FontSize parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize 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.documentai.v1beta3.Document.Style.FontSize parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize 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.documentai.v1beta3.Document.Style.FontSize 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;
}
/**
*
*
*
* Font size with unit.
*
*
* Protobuf type {@code google.cloud.documentai.v1beta3.Document.Style.FontSize}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.Document.Style.FontSize)
com.google.cloud.documentai.v1beta3.Document.Style.FontSizeOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_FontSize_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_FontSize_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.class,
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder.class);
}
// Construct using com.google.cloud.documentai.v1beta3.Document.Style.FontSize.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
size_ = 0F;
unit_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_FontSize_descriptor;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style.FontSize
getDefaultInstanceForType() {
return com.google.cloud.documentai.v1beta3.Document.Style.FontSize.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style.FontSize build() {
com.google.cloud.documentai.v1beta3.Document.Style.FontSize result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style.FontSize buildPartial() {
com.google.cloud.documentai.v1beta3.Document.Style.FontSize result =
new com.google.cloud.documentai.v1beta3.Document.Style.FontSize(this);
result.size_ = size_;
result.unit_ = unit_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.documentai.v1beta3.Document.Style.FontSize) {
return mergeFrom((com.google.cloud.documentai.v1beta3.Document.Style.FontSize) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.documentai.v1beta3.Document.Style.FontSize other) {
if (other
== com.google.cloud.documentai.v1beta3.Document.Style.FontSize.getDefaultInstance())
return this;
if (other.getSize() != 0F) {
setSize(other.getSize());
}
if (!other.getUnit().isEmpty()) {
unit_ = other.unit_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.documentai.v1beta3.Document.Style.FontSize parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage =
(com.google.cloud.documentai.v1beta3.Document.Style.FontSize)
e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private float size_;
/**
*
*
*
* Font size for the text.
*
*
* float size = 1;
*
* @return The size.
*/
@java.lang.Override
public float getSize() {
return size_;
}
/**
*
*
*
* Font size for the text.
*
*
* float size = 1;
*
* @param value The size to set.
* @return This builder for chaining.
*/
public Builder setSize(float value) {
size_ = value;
onChanged();
return this;
}
/**
*
*
*
* Font size for the text.
*
*
* float size = 1;
*
* @return This builder for chaining.
*/
public Builder clearSize() {
size_ = 0F;
onChanged();
return this;
}
private java.lang.Object unit_ = "";
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @return The unit.
*/
public java.lang.String getUnit() {
java.lang.Object ref = unit_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
unit_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @return The bytes for unit.
*/
public com.google.protobuf.ByteString getUnitBytes() {
java.lang.Object ref = unit_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
unit_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @param value The unit to set.
* @return This builder for chaining.
*/
public Builder setUnit(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
unit_ = value;
onChanged();
return this;
}
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @return This builder for chaining.
*/
public Builder clearUnit() {
unit_ = getDefaultInstance().getUnit();
onChanged();
return this;
}
/**
*
*
*
* Unit for the font size. Follows CSS naming (in, px, pt, etc.).
*
*
* string unit = 2;
*
* @param value The bytes for unit to set.
* @return This builder for chaining.
*/
public Builder setUnitBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
unit_ = value;
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.documentai.v1beta3.Document.Style.FontSize)
}
// @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Style.FontSize)
private static final com.google.cloud.documentai.v1beta3.Document.Style.FontSize
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.Document.Style.FontSize();
}
public static com.google.cloud.documentai.v1beta3.Document.Style.FontSize
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public FontSize parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new FontSize(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style.FontSize
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
public static final int TEXT_ANCHOR_FIELD_NUMBER = 1;
private com.google.cloud.documentai.v1beta3.Document.TextAnchor textAnchor_;
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*
* @return Whether the textAnchor field is set.
*/
@java.lang.Override
public boolean hasTextAnchor() {
return textAnchor_ != null;
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*
* @return The textAnchor.
*/
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() {
return textAnchor_ == null
? com.google.cloud.documentai.v1beta3.Document.TextAnchor.getDefaultInstance()
: textAnchor_;
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.TextAnchorOrBuilder
getTextAnchorOrBuilder() {
return getTextAnchor();
}
public static final int COLOR_FIELD_NUMBER = 2;
private com.google.type.Color color_;
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*
* @return Whether the color field is set.
*/
@java.lang.Override
public boolean hasColor() {
return color_ != null;
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*
* @return The color.
*/
@java.lang.Override
public com.google.type.Color getColor() {
return color_ == null ? com.google.type.Color.getDefaultInstance() : color_;
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
@java.lang.Override
public com.google.type.ColorOrBuilder getColorOrBuilder() {
return getColor();
}
public static final int BACKGROUND_COLOR_FIELD_NUMBER = 3;
private com.google.type.Color backgroundColor_;
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*
* @return Whether the backgroundColor field is set.
*/
@java.lang.Override
public boolean hasBackgroundColor() {
return backgroundColor_ != null;
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*
* @return The backgroundColor.
*/
@java.lang.Override
public com.google.type.Color getBackgroundColor() {
return backgroundColor_ == null
? com.google.type.Color.getDefaultInstance()
: backgroundColor_;
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
@java.lang.Override
public com.google.type.ColorOrBuilder getBackgroundColorOrBuilder() {
return getBackgroundColor();
}
public static final int FONT_WEIGHT_FIELD_NUMBER = 4;
private volatile java.lang.Object fontWeight_;
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @return The fontWeight.
*/
@java.lang.Override
public java.lang.String getFontWeight() {
java.lang.Object ref = fontWeight_;
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();
fontWeight_ = s;
return s;
}
}
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @return The bytes for fontWeight.
*/
@java.lang.Override
public com.google.protobuf.ByteString getFontWeightBytes() {
java.lang.Object ref = fontWeight_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
fontWeight_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TEXT_STYLE_FIELD_NUMBER = 5;
private volatile java.lang.Object textStyle_;
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @return The textStyle.
*/
@java.lang.Override
public java.lang.String getTextStyle() {
java.lang.Object ref = textStyle_;
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();
textStyle_ = s;
return s;
}
}
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @return The bytes for textStyle.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTextStyleBytes() {
java.lang.Object ref = textStyle_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
textStyle_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TEXT_DECORATION_FIELD_NUMBER = 6;
private volatile java.lang.Object textDecoration_;
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @return The textDecoration.
*/
@java.lang.Override
public java.lang.String getTextDecoration() {
java.lang.Object ref = textDecoration_;
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();
textDecoration_ = s;
return s;
}
}
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @return The bytes for textDecoration.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTextDecorationBytes() {
java.lang.Object ref = textDecoration_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
textDecoration_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int FONT_SIZE_FIELD_NUMBER = 7;
private com.google.cloud.documentai.v1beta3.Document.Style.FontSize fontSize_;
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*
* @return Whether the fontSize field is set.
*/
@java.lang.Override
public boolean hasFontSize() {
return fontSize_ != null;
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*
* @return The fontSize.
*/
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style.FontSize getFontSize() {
return fontSize_ == null
? com.google.cloud.documentai.v1beta3.Document.Style.FontSize.getDefaultInstance()
: fontSize_;
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style.FontSizeOrBuilder
getFontSizeOrBuilder() {
return getFontSize();
}
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 (textAnchor_ != null) {
output.writeMessage(1, getTextAnchor());
}
if (color_ != null) {
output.writeMessage(2, getColor());
}
if (backgroundColor_ != null) {
output.writeMessage(3, getBackgroundColor());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontWeight_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, fontWeight_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textStyle_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, textStyle_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textDecoration_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, textDecoration_);
}
if (fontSize_ != null) {
output.writeMessage(7, getFontSize());
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (textAnchor_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getTextAnchor());
}
if (color_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, getColor());
}
if (backgroundColor_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getBackgroundColor());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(fontWeight_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, fontWeight_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textStyle_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, textStyle_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(textDecoration_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, textDecoration_);
}
if (fontSize_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(7, getFontSize());
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.documentai.v1beta3.Document.Style)) {
return super.equals(obj);
}
com.google.cloud.documentai.v1beta3.Document.Style other =
(com.google.cloud.documentai.v1beta3.Document.Style) obj;
if (hasTextAnchor() != other.hasTextAnchor()) return false;
if (hasTextAnchor()) {
if (!getTextAnchor().equals(other.getTextAnchor())) return false;
}
if (hasColor() != other.hasColor()) return false;
if (hasColor()) {
if (!getColor().equals(other.getColor())) return false;
}
if (hasBackgroundColor() != other.hasBackgroundColor()) return false;
if (hasBackgroundColor()) {
if (!getBackgroundColor().equals(other.getBackgroundColor())) return false;
}
if (!getFontWeight().equals(other.getFontWeight())) return false;
if (!getTextStyle().equals(other.getTextStyle())) return false;
if (!getTextDecoration().equals(other.getTextDecoration())) return false;
if (hasFontSize() != other.hasFontSize()) return false;
if (hasFontSize()) {
if (!getFontSize().equals(other.getFontSize())) return false;
}
if (!unknownFields.equals(other.unknownFields)) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasTextAnchor()) {
hash = (37 * hash) + TEXT_ANCHOR_FIELD_NUMBER;
hash = (53 * hash) + getTextAnchor().hashCode();
}
if (hasColor()) {
hash = (37 * hash) + COLOR_FIELD_NUMBER;
hash = (53 * hash) + getColor().hashCode();
}
if (hasBackgroundColor()) {
hash = (37 * hash) + BACKGROUND_COLOR_FIELD_NUMBER;
hash = (53 * hash) + getBackgroundColor().hashCode();
}
hash = (37 * hash) + FONT_WEIGHT_FIELD_NUMBER;
hash = (53 * hash) + getFontWeight().hashCode();
hash = (37 * hash) + TEXT_STYLE_FIELD_NUMBER;
hash = (53 * hash) + getTextStyle().hashCode();
hash = (37 * hash) + TEXT_DECORATION_FIELD_NUMBER;
hash = (53 * hash) + getTextDecoration().hashCode();
if (hasFontSize()) {
hash = (37 * hash) + FONT_SIZE_FIELD_NUMBER;
hash = (53 * hash) + getFontSize().hashCode();
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.documentai.v1beta3.Document.Style parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.Style 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.documentai.v1beta3.Document.Style parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.Style 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.documentai.v1beta3.Document.Style parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.documentai.v1beta3.Document.Style parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.documentai.v1beta3.Document.Style parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.Style 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.documentai.v1beta3.Document.Style parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.Style 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.documentai.v1beta3.Document.Style parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.documentai.v1beta3.Document.Style 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.documentai.v1beta3.Document.Style 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;
}
/**
*
*
*
* Annotation for common text style attributes. This adheres to CSS
* conventions as much as possible.
*
*
* Protobuf type {@code google.cloud.documentai.v1beta3.Document.Style}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.documentai.v1beta3.Document.Style)
com.google.cloud.documentai.v1beta3.Document.StyleOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.documentai.v1beta3.Document.Style.class,
com.google.cloud.documentai.v1beta3.Document.Style.Builder.class);
}
// Construct using com.google.cloud.documentai.v1beta3.Document.Style.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
if (textAnchorBuilder_ == null) {
textAnchor_ = null;
} else {
textAnchor_ = null;
textAnchorBuilder_ = null;
}
if (colorBuilder_ == null) {
color_ = null;
} else {
color_ = null;
colorBuilder_ = null;
}
if (backgroundColorBuilder_ == null) {
backgroundColor_ = null;
} else {
backgroundColor_ = null;
backgroundColorBuilder_ = null;
}
fontWeight_ = "";
textStyle_ = "";
textDecoration_ = "";
if (fontSizeBuilder_ == null) {
fontSize_ = null;
} else {
fontSize_ = null;
fontSizeBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.documentai.v1beta3.DocumentProto
.internal_static_google_cloud_documentai_v1beta3_Document_Style_descriptor;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style getDefaultInstanceForType() {
return com.google.cloud.documentai.v1beta3.Document.Style.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style build() {
com.google.cloud.documentai.v1beta3.Document.Style result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.documentai.v1beta3.Document.Style buildPartial() {
com.google.cloud.documentai.v1beta3.Document.Style result =
new com.google.cloud.documentai.v1beta3.Document.Style(this);
if (textAnchorBuilder_ == null) {
result.textAnchor_ = textAnchor_;
} else {
result.textAnchor_ = textAnchorBuilder_.build();
}
if (colorBuilder_ == null) {
result.color_ = color_;
} else {
result.color_ = colorBuilder_.build();
}
if (backgroundColorBuilder_ == null) {
result.backgroundColor_ = backgroundColor_;
} else {
result.backgroundColor_ = backgroundColorBuilder_.build();
}
result.fontWeight_ = fontWeight_;
result.textStyle_ = textStyle_;
result.textDecoration_ = textDecoration_;
if (fontSizeBuilder_ == null) {
result.fontSize_ = fontSize_;
} else {
result.fontSize_ = fontSizeBuilder_.build();
}
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index,
java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.documentai.v1beta3.Document.Style) {
return mergeFrom((com.google.cloud.documentai.v1beta3.Document.Style) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.documentai.v1beta3.Document.Style other) {
if (other == com.google.cloud.documentai.v1beta3.Document.Style.getDefaultInstance())
return this;
if (other.hasTextAnchor()) {
mergeTextAnchor(other.getTextAnchor());
}
if (other.hasColor()) {
mergeColor(other.getColor());
}
if (other.hasBackgroundColor()) {
mergeBackgroundColor(other.getBackgroundColor());
}
if (!other.getFontWeight().isEmpty()) {
fontWeight_ = other.fontWeight_;
onChanged();
}
if (!other.getTextStyle().isEmpty()) {
textStyle_ = other.textStyle_;
onChanged();
}
if (!other.getTextDecoration().isEmpty()) {
textDecoration_ = other.textDecoration_;
onChanged();
}
if (other.hasFontSize()) {
mergeFontSize(other.getFontSize());
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.documentai.v1beta3.Document.Style parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage =
(com.google.cloud.documentai.v1beta3.Document.Style) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private com.google.cloud.documentai.v1beta3.Document.TextAnchor textAnchor_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.documentai.v1beta3.Document.TextAnchor,
com.google.cloud.documentai.v1beta3.Document.TextAnchor.Builder,
com.google.cloud.documentai.v1beta3.Document.TextAnchorOrBuilder>
textAnchorBuilder_;
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*
* @return Whether the textAnchor field is set.
*/
public boolean hasTextAnchor() {
return textAnchorBuilder_ != null || textAnchor_ != null;
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*
* @return The textAnchor.
*/
public com.google.cloud.documentai.v1beta3.Document.TextAnchor getTextAnchor() {
if (textAnchorBuilder_ == null) {
return textAnchor_ == null
? com.google.cloud.documentai.v1beta3.Document.TextAnchor.getDefaultInstance()
: textAnchor_;
} else {
return textAnchorBuilder_.getMessage();
}
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
public Builder setTextAnchor(com.google.cloud.documentai.v1beta3.Document.TextAnchor value) {
if (textAnchorBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
textAnchor_ = value;
onChanged();
} else {
textAnchorBuilder_.setMessage(value);
}
return this;
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
public Builder setTextAnchor(
com.google.cloud.documentai.v1beta3.Document.TextAnchor.Builder builderForValue) {
if (textAnchorBuilder_ == null) {
textAnchor_ = builderForValue.build();
onChanged();
} else {
textAnchorBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
public Builder mergeTextAnchor(
com.google.cloud.documentai.v1beta3.Document.TextAnchor value) {
if (textAnchorBuilder_ == null) {
if (textAnchor_ != null) {
textAnchor_ =
com.google.cloud.documentai.v1beta3.Document.TextAnchor.newBuilder(textAnchor_)
.mergeFrom(value)
.buildPartial();
} else {
textAnchor_ = value;
}
onChanged();
} else {
textAnchorBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
public Builder clearTextAnchor() {
if (textAnchorBuilder_ == null) {
textAnchor_ = null;
onChanged();
} else {
textAnchor_ = null;
textAnchorBuilder_ = null;
}
return this;
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
public com.google.cloud.documentai.v1beta3.Document.TextAnchor.Builder
getTextAnchorBuilder() {
onChanged();
return getTextAnchorFieldBuilder().getBuilder();
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
public com.google.cloud.documentai.v1beta3.Document.TextAnchorOrBuilder
getTextAnchorOrBuilder() {
if (textAnchorBuilder_ != null) {
return textAnchorBuilder_.getMessageOrBuilder();
} else {
return textAnchor_ == null
? com.google.cloud.documentai.v1beta3.Document.TextAnchor.getDefaultInstance()
: textAnchor_;
}
}
/**
*
*
*
* Text anchor indexing into the
* [Document.text][google.cloud.documentai.v1beta3.Document.text].
*
*
* .google.cloud.documentai.v1beta3.Document.TextAnchor text_anchor = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.documentai.v1beta3.Document.TextAnchor,
com.google.cloud.documentai.v1beta3.Document.TextAnchor.Builder,
com.google.cloud.documentai.v1beta3.Document.TextAnchorOrBuilder>
getTextAnchorFieldBuilder() {
if (textAnchorBuilder_ == null) {
textAnchorBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.documentai.v1beta3.Document.TextAnchor,
com.google.cloud.documentai.v1beta3.Document.TextAnchor.Builder,
com.google.cloud.documentai.v1beta3.Document.TextAnchorOrBuilder>(
getTextAnchor(), getParentForChildren(), isClean());
textAnchor_ = null;
}
return textAnchorBuilder_;
}
private com.google.type.Color color_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder>
colorBuilder_;
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*
* @return Whether the color field is set.
*/
public boolean hasColor() {
return colorBuilder_ != null || color_ != null;
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*
* @return The color.
*/
public com.google.type.Color getColor() {
if (colorBuilder_ == null) {
return color_ == null ? com.google.type.Color.getDefaultInstance() : color_;
} else {
return colorBuilder_.getMessage();
}
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
public Builder setColor(com.google.type.Color value) {
if (colorBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
color_ = value;
onChanged();
} else {
colorBuilder_.setMessage(value);
}
return this;
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
public Builder setColor(com.google.type.Color.Builder builderForValue) {
if (colorBuilder_ == null) {
color_ = builderForValue.build();
onChanged();
} else {
colorBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
public Builder mergeColor(com.google.type.Color value) {
if (colorBuilder_ == null) {
if (color_ != null) {
color_ = com.google.type.Color.newBuilder(color_).mergeFrom(value).buildPartial();
} else {
color_ = value;
}
onChanged();
} else {
colorBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
public Builder clearColor() {
if (colorBuilder_ == null) {
color_ = null;
onChanged();
} else {
color_ = null;
colorBuilder_ = null;
}
return this;
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
public com.google.type.Color.Builder getColorBuilder() {
onChanged();
return getColorFieldBuilder().getBuilder();
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
public com.google.type.ColorOrBuilder getColorOrBuilder() {
if (colorBuilder_ != null) {
return colorBuilder_.getMessageOrBuilder();
} else {
return color_ == null ? com.google.type.Color.getDefaultInstance() : color_;
}
}
/**
*
*
*
* Text color.
*
*
* .google.type.Color color = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder>
getColorFieldBuilder() {
if (colorBuilder_ == null) {
colorBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color,
com.google.type.Color.Builder,
com.google.type.ColorOrBuilder>(getColor(), getParentForChildren(), isClean());
color_ = null;
}
return colorBuilder_;
}
private com.google.type.Color backgroundColor_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder>
backgroundColorBuilder_;
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*
* @return Whether the backgroundColor field is set.
*/
public boolean hasBackgroundColor() {
return backgroundColorBuilder_ != null || backgroundColor_ != null;
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*
* @return The backgroundColor.
*/
public com.google.type.Color getBackgroundColor() {
if (backgroundColorBuilder_ == null) {
return backgroundColor_ == null
? com.google.type.Color.getDefaultInstance()
: backgroundColor_;
} else {
return backgroundColorBuilder_.getMessage();
}
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
public Builder setBackgroundColor(com.google.type.Color value) {
if (backgroundColorBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
backgroundColor_ = value;
onChanged();
} else {
backgroundColorBuilder_.setMessage(value);
}
return this;
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
public Builder setBackgroundColor(com.google.type.Color.Builder builderForValue) {
if (backgroundColorBuilder_ == null) {
backgroundColor_ = builderForValue.build();
onChanged();
} else {
backgroundColorBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
public Builder mergeBackgroundColor(com.google.type.Color value) {
if (backgroundColorBuilder_ == null) {
if (backgroundColor_ != null) {
backgroundColor_ =
com.google.type.Color.newBuilder(backgroundColor_).mergeFrom(value).buildPartial();
} else {
backgroundColor_ = value;
}
onChanged();
} else {
backgroundColorBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
public Builder clearBackgroundColor() {
if (backgroundColorBuilder_ == null) {
backgroundColor_ = null;
onChanged();
} else {
backgroundColor_ = null;
backgroundColorBuilder_ = null;
}
return this;
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
public com.google.type.Color.Builder getBackgroundColorBuilder() {
onChanged();
return getBackgroundColorFieldBuilder().getBuilder();
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
public com.google.type.ColorOrBuilder getBackgroundColorOrBuilder() {
if (backgroundColorBuilder_ != null) {
return backgroundColorBuilder_.getMessageOrBuilder();
} else {
return backgroundColor_ == null
? com.google.type.Color.getDefaultInstance()
: backgroundColor_;
}
}
/**
*
*
*
* Text background color.
*
*
* .google.type.Color background_color = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color, com.google.type.Color.Builder, com.google.type.ColorOrBuilder>
getBackgroundColorFieldBuilder() {
if (backgroundColorBuilder_ == null) {
backgroundColorBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.type.Color,
com.google.type.Color.Builder,
com.google.type.ColorOrBuilder>(
getBackgroundColor(), getParentForChildren(), isClean());
backgroundColor_ = null;
}
return backgroundColorBuilder_;
}
private java.lang.Object fontWeight_ = "";
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @return The fontWeight.
*/
public java.lang.String getFontWeight() {
java.lang.Object ref = fontWeight_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
fontWeight_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @return The bytes for fontWeight.
*/
public com.google.protobuf.ByteString getFontWeightBytes() {
java.lang.Object ref = fontWeight_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
fontWeight_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @param value The fontWeight to set.
* @return This builder for chaining.
*/
public Builder setFontWeight(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
fontWeight_ = value;
onChanged();
return this;
}
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @return This builder for chaining.
*/
public Builder clearFontWeight() {
fontWeight_ = getDefaultInstance().getFontWeight();
onChanged();
return this;
}
/**
*
*
*
* Font weight. Possible values are normal, bold, bolder, and lighter.
* https://www.w3schools.com/cssref/pr_font_weight.asp
*
*
* string font_weight = 4;
*
* @param value The bytes for fontWeight to set.
* @return This builder for chaining.
*/
public Builder setFontWeightBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
fontWeight_ = value;
onChanged();
return this;
}
private java.lang.Object textStyle_ = "";
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @return The textStyle.
*/
public java.lang.String getTextStyle() {
java.lang.Object ref = textStyle_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
textStyle_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @return The bytes for textStyle.
*/
public com.google.protobuf.ByteString getTextStyleBytes() {
java.lang.Object ref = textStyle_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
textStyle_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @param value The textStyle to set.
* @return This builder for chaining.
*/
public Builder setTextStyle(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
textStyle_ = value;
onChanged();
return this;
}
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @return This builder for chaining.
*/
public Builder clearTextStyle() {
textStyle_ = getDefaultInstance().getTextStyle();
onChanged();
return this;
}
/**
*
*
*
* Text style. Possible values are normal, italic, and oblique.
* https://www.w3schools.com/cssref/pr_font_font-style.asp
*
*
* string text_style = 5;
*
* @param value The bytes for textStyle to set.
* @return This builder for chaining.
*/
public Builder setTextStyleBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
textStyle_ = value;
onChanged();
return this;
}
private java.lang.Object textDecoration_ = "";
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @return The textDecoration.
*/
public java.lang.String getTextDecoration() {
java.lang.Object ref = textDecoration_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
textDecoration_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @return The bytes for textDecoration.
*/
public com.google.protobuf.ByteString getTextDecorationBytes() {
java.lang.Object ref = textDecoration_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
textDecoration_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @param value The textDecoration to set.
* @return This builder for chaining.
*/
public Builder setTextDecoration(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
textDecoration_ = value;
onChanged();
return this;
}
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @return This builder for chaining.
*/
public Builder clearTextDecoration() {
textDecoration_ = getDefaultInstance().getTextDecoration();
onChanged();
return this;
}
/**
*
*
*
* Text decoration. Follows CSS standard.
* <text-decoration-line> <text-decoration-color> <text-decoration-style>
* https://www.w3schools.com/cssref/pr_text_text-decoration.asp
*
*
* string text_decoration = 6;
*
* @param value The bytes for textDecoration to set.
* @return This builder for chaining.
*/
public Builder setTextDecorationBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
textDecoration_ = value;
onChanged();
return this;
}
private com.google.cloud.documentai.v1beta3.Document.Style.FontSize fontSize_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.documentai.v1beta3.Document.Style.FontSize,
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder,
com.google.cloud.documentai.v1beta3.Document.Style.FontSizeOrBuilder>
fontSizeBuilder_;
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*
* @return Whether the fontSize field is set.
*/
public boolean hasFontSize() {
return fontSizeBuilder_ != null || fontSize_ != null;
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*
* @return The fontSize.
*/
public com.google.cloud.documentai.v1beta3.Document.Style.FontSize getFontSize() {
if (fontSizeBuilder_ == null) {
return fontSize_ == null
? com.google.cloud.documentai.v1beta3.Document.Style.FontSize.getDefaultInstance()
: fontSize_;
} else {
return fontSizeBuilder_.getMessage();
}
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
public Builder setFontSize(
com.google.cloud.documentai.v1beta3.Document.Style.FontSize value) {
if (fontSizeBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
fontSize_ = value;
onChanged();
} else {
fontSizeBuilder_.setMessage(value);
}
return this;
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
public Builder setFontSize(
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder builderForValue) {
if (fontSizeBuilder_ == null) {
fontSize_ = builderForValue.build();
onChanged();
} else {
fontSizeBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
public Builder mergeFontSize(
com.google.cloud.documentai.v1beta3.Document.Style.FontSize value) {
if (fontSizeBuilder_ == null) {
if (fontSize_ != null) {
fontSize_ =
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.newBuilder(fontSize_)
.mergeFrom(value)
.buildPartial();
} else {
fontSize_ = value;
}
onChanged();
} else {
fontSizeBuilder_.mergeFrom(value);
}
return this;
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
public Builder clearFontSize() {
if (fontSizeBuilder_ == null) {
fontSize_ = null;
onChanged();
} else {
fontSize_ = null;
fontSizeBuilder_ = null;
}
return this;
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
public com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder
getFontSizeBuilder() {
onChanged();
return getFontSizeFieldBuilder().getBuilder();
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
public com.google.cloud.documentai.v1beta3.Document.Style.FontSizeOrBuilder
getFontSizeOrBuilder() {
if (fontSizeBuilder_ != null) {
return fontSizeBuilder_.getMessageOrBuilder();
} else {
return fontSize_ == null
? com.google.cloud.documentai.v1beta3.Document.Style.FontSize.getDefaultInstance()
: fontSize_;
}
}
/**
*
*
*
* Font size.
*
*
* .google.cloud.documentai.v1beta3.Document.Style.FontSize font_size = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.documentai.v1beta3.Document.Style.FontSize,
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder,
com.google.cloud.documentai.v1beta3.Document.Style.FontSizeOrBuilder>
getFontSizeFieldBuilder() {
if (fontSizeBuilder_ == null) {
fontSizeBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.documentai.v1beta3.Document.Style.FontSize,
com.google.cloud.documentai.v1beta3.Document.Style.FontSize.Builder,
com.google.cloud.documentai.v1beta3.Document.Style.FontSizeOrBuilder>(
getFontSize(), getParentForChildren(), isClean());
fontSize_ = null;
}
return fontSizeBuilder_;
}
@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.documentai.v1beta3.Document.Style)
}
// @@protoc_insertion_point(class_scope:google.cloud.documentai.v1beta3.Document.Style)
private static final com.google.cloud.documentai.v1beta3.Document.Style DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.documentai.v1beta3.Document.Style();
}
public static com.google.cloud.documentai.v1beta3.Document.Style getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser