
com.google.cloud.visionai.v1.AnnotationMatchingResult Maven / Gradle / Ivy
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/visionai/v1/warehouse.proto
// Protobuf Java Version: 3.25.3
package com.google.cloud.visionai.v1;
/**
*
*
*
* Stores the criteria-annotation matching results for each search result item.
*
*
* Protobuf type {@code google.cloud.visionai.v1.AnnotationMatchingResult}
*/
public final class AnnotationMatchingResult extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.visionai.v1.AnnotationMatchingResult)
AnnotationMatchingResultOrBuilder {
private static final long serialVersionUID = 0L;
// Use AnnotationMatchingResult.newBuilder() to construct.
private AnnotationMatchingResult(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private AnnotationMatchingResult() {
matchedAnnotations_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new AnnotationMatchingResult();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_AnnotationMatchingResult_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_AnnotationMatchingResult_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.visionai.v1.AnnotationMatchingResult.class,
com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder.class);
}
private int bitField0_;
public static final int CRITERIA_FIELD_NUMBER = 1;
private com.google.cloud.visionai.v1.Criteria criteria_;
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*
* @return Whether the criteria field is set.
*/
@java.lang.Override
public boolean hasCriteria() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*
* @return The criteria.
*/
@java.lang.Override
public com.google.cloud.visionai.v1.Criteria getCriteria() {
return criteria_ == null
? com.google.cloud.visionai.v1.Criteria.getDefaultInstance()
: criteria_;
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
@java.lang.Override
public com.google.cloud.visionai.v1.CriteriaOrBuilder getCriteriaOrBuilder() {
return criteria_ == null
? com.google.cloud.visionai.v1.Criteria.getDefaultInstance()
: criteria_;
}
public static final int MATCHED_ANNOTATIONS_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private java.util.List matchedAnnotations_;
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
@java.lang.Override
public java.util.List getMatchedAnnotationsList() {
return matchedAnnotations_;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
@java.lang.Override
public java.util.List extends com.google.cloud.visionai.v1.AnnotationOrBuilder>
getMatchedAnnotationsOrBuilderList() {
return matchedAnnotations_;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
@java.lang.Override
public int getMatchedAnnotationsCount() {
return matchedAnnotations_.size();
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
@java.lang.Override
public com.google.cloud.visionai.v1.Annotation getMatchedAnnotations(int index) {
return matchedAnnotations_.get(index);
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
@java.lang.Override
public com.google.cloud.visionai.v1.AnnotationOrBuilder getMatchedAnnotationsOrBuilder(
int index) {
return matchedAnnotations_.get(index);
}
public static final int STATUS_FIELD_NUMBER = 3;
private com.google.rpc.Status status_;
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*
* @return Whether the status field is set.
*/
@java.lang.Override
public boolean hasStatus() {
return ((bitField0_ & 0x00000002) != 0);
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*
* @return The status.
*/
@java.lang.Override
public com.google.rpc.Status getStatus() {
return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
@java.lang.Override
public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (((bitField0_ & 0x00000001) != 0)) {
output.writeMessage(1, getCriteria());
}
for (int i = 0; i < matchedAnnotations_.size(); i++) {
output.writeMessage(2, matchedAnnotations_.get(i));
}
if (((bitField0_ & 0x00000002) != 0)) {
output.writeMessage(3, getStatus());
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (((bitField0_ & 0x00000001) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, getCriteria());
}
for (int i = 0; i < matchedAnnotations_.size(); i++) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(2, matchedAnnotations_.get(i));
}
if (((bitField0_ & 0x00000002) != 0)) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, getStatus());
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.visionai.v1.AnnotationMatchingResult)) {
return super.equals(obj);
}
com.google.cloud.visionai.v1.AnnotationMatchingResult other =
(com.google.cloud.visionai.v1.AnnotationMatchingResult) obj;
if (hasCriteria() != other.hasCriteria()) return false;
if (hasCriteria()) {
if (!getCriteria().equals(other.getCriteria())) return false;
}
if (!getMatchedAnnotationsList().equals(other.getMatchedAnnotationsList())) return false;
if (hasStatus() != other.hasStatus()) return false;
if (hasStatus()) {
if (!getStatus().equals(other.getStatus())) return false;
}
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
if (hasCriteria()) {
hash = (37 * hash) + CRITERIA_FIELD_NUMBER;
hash = (53 * hash) + getCriteria().hashCode();
}
if (getMatchedAnnotationsCount() > 0) {
hash = (37 * hash) + MATCHED_ANNOTATIONS_FIELD_NUMBER;
hash = (53 * hash) + getMatchedAnnotationsList().hashCode();
}
if (hasStatus()) {
hash = (37 * hash) + STATUS_FIELD_NUMBER;
hash = (53 * hash) + getStatus().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult 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.visionai.v1.AnnotationMatchingResult parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult 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.visionai.v1.AnnotationMatchingResult parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult 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.visionai.v1.AnnotationMatchingResult parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult 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.visionai.v1.AnnotationMatchingResult parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult 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.visionai.v1.AnnotationMatchingResult 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;
}
/**
*
*
*
* Stores the criteria-annotation matching results for each search result item.
*
*
* Protobuf type {@code google.cloud.visionai.v1.AnnotationMatchingResult}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.visionai.v1.AnnotationMatchingResult)
com.google.cloud.visionai.v1.AnnotationMatchingResultOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_AnnotationMatchingResult_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_AnnotationMatchingResult_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.visionai.v1.AnnotationMatchingResult.class,
com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder.class);
}
// Construct using com.google.cloud.visionai.v1.AnnotationMatchingResult.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {
getCriteriaFieldBuilder();
getMatchedAnnotationsFieldBuilder();
getStatusFieldBuilder();
}
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
criteria_ = null;
if (criteriaBuilder_ != null) {
criteriaBuilder_.dispose();
criteriaBuilder_ = null;
}
if (matchedAnnotationsBuilder_ == null) {
matchedAnnotations_ = java.util.Collections.emptyList();
} else {
matchedAnnotations_ = null;
matchedAnnotationsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000002);
status_ = null;
if (statusBuilder_ != null) {
statusBuilder_.dispose();
statusBuilder_ = null;
}
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_AnnotationMatchingResult_descriptor;
}
@java.lang.Override
public com.google.cloud.visionai.v1.AnnotationMatchingResult getDefaultInstanceForType() {
return com.google.cloud.visionai.v1.AnnotationMatchingResult.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.visionai.v1.AnnotationMatchingResult build() {
com.google.cloud.visionai.v1.AnnotationMatchingResult result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.visionai.v1.AnnotationMatchingResult buildPartial() {
com.google.cloud.visionai.v1.AnnotationMatchingResult result =
new com.google.cloud.visionai.v1.AnnotationMatchingResult(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(
com.google.cloud.visionai.v1.AnnotationMatchingResult result) {
if (matchedAnnotationsBuilder_ == null) {
if (((bitField0_ & 0x00000002) != 0)) {
matchedAnnotations_ = java.util.Collections.unmodifiableList(matchedAnnotations_);
bitField0_ = (bitField0_ & ~0x00000002);
}
result.matchedAnnotations_ = matchedAnnotations_;
} else {
result.matchedAnnotations_ = matchedAnnotationsBuilder_.build();
}
}
private void buildPartial0(com.google.cloud.visionai.v1.AnnotationMatchingResult result) {
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.criteria_ = criteriaBuilder_ == null ? criteria_ : criteriaBuilder_.build();
to_bitField0_ |= 0x00000001;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.status_ = statusBuilder_ == null ? status_ : statusBuilder_.build();
to_bitField0_ |= 0x00000002;
}
result.bitField0_ |= to_bitField0_;
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.visionai.v1.AnnotationMatchingResult) {
return mergeFrom((com.google.cloud.visionai.v1.AnnotationMatchingResult) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.visionai.v1.AnnotationMatchingResult other) {
if (other == com.google.cloud.visionai.v1.AnnotationMatchingResult.getDefaultInstance())
return this;
if (other.hasCriteria()) {
mergeCriteria(other.getCriteria());
}
if (matchedAnnotationsBuilder_ == null) {
if (!other.matchedAnnotations_.isEmpty()) {
if (matchedAnnotations_.isEmpty()) {
matchedAnnotations_ = other.matchedAnnotations_;
bitField0_ = (bitField0_ & ~0x00000002);
} else {
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.addAll(other.matchedAnnotations_);
}
onChanged();
}
} else {
if (!other.matchedAnnotations_.isEmpty()) {
if (matchedAnnotationsBuilder_.isEmpty()) {
matchedAnnotationsBuilder_.dispose();
matchedAnnotationsBuilder_ = null;
matchedAnnotations_ = other.matchedAnnotations_;
bitField0_ = (bitField0_ & ~0x00000002);
matchedAnnotationsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getMatchedAnnotationsFieldBuilder()
: null;
} else {
matchedAnnotationsBuilder_.addAllMessages(other.matchedAnnotations_);
}
}
}
if (other.hasStatus()) {
mergeStatus(other.getStatus());
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
input.readMessage(getCriteriaFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
com.google.cloud.visionai.v1.Annotation m =
input.readMessage(
com.google.cloud.visionai.v1.Annotation.parser(), extensionRegistry);
if (matchedAnnotationsBuilder_ == null) {
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.add(m);
} else {
matchedAnnotationsBuilder_.addMessage(m);
}
break;
} // case 18
case 26:
{
input.readMessage(getStatusFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000004;
break;
} // case 26
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private com.google.cloud.visionai.v1.Criteria criteria_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.visionai.v1.Criteria,
com.google.cloud.visionai.v1.Criteria.Builder,
com.google.cloud.visionai.v1.CriteriaOrBuilder>
criteriaBuilder_;
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*
* @return Whether the criteria field is set.
*/
public boolean hasCriteria() {
return ((bitField0_ & 0x00000001) != 0);
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*
* @return The criteria.
*/
public com.google.cloud.visionai.v1.Criteria getCriteria() {
if (criteriaBuilder_ == null) {
return criteria_ == null
? com.google.cloud.visionai.v1.Criteria.getDefaultInstance()
: criteria_;
} else {
return criteriaBuilder_.getMessage();
}
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
public Builder setCriteria(com.google.cloud.visionai.v1.Criteria value) {
if (criteriaBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
criteria_ = value;
} else {
criteriaBuilder_.setMessage(value);
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
public Builder setCriteria(com.google.cloud.visionai.v1.Criteria.Builder builderForValue) {
if (criteriaBuilder_ == null) {
criteria_ = builderForValue.build();
} else {
criteriaBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
public Builder mergeCriteria(com.google.cloud.visionai.v1.Criteria value) {
if (criteriaBuilder_ == null) {
if (((bitField0_ & 0x00000001) != 0)
&& criteria_ != null
&& criteria_ != com.google.cloud.visionai.v1.Criteria.getDefaultInstance()) {
getCriteriaBuilder().mergeFrom(value);
} else {
criteria_ = value;
}
} else {
criteriaBuilder_.mergeFrom(value);
}
if (criteria_ != null) {
bitField0_ |= 0x00000001;
onChanged();
}
return this;
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
public Builder clearCriteria() {
bitField0_ = (bitField0_ & ~0x00000001);
criteria_ = null;
if (criteriaBuilder_ != null) {
criteriaBuilder_.dispose();
criteriaBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
public com.google.cloud.visionai.v1.Criteria.Builder getCriteriaBuilder() {
bitField0_ |= 0x00000001;
onChanged();
return getCriteriaFieldBuilder().getBuilder();
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
public com.google.cloud.visionai.v1.CriteriaOrBuilder getCriteriaOrBuilder() {
if (criteriaBuilder_ != null) {
return criteriaBuilder_.getMessageOrBuilder();
} else {
return criteria_ == null
? com.google.cloud.visionai.v1.Criteria.getDefaultInstance()
: criteria_;
}
}
/**
*
*
*
* The criteria used for matching. It can be an input search criteria or a
* criteria converted from a facet selection.
*
*
* .google.cloud.visionai.v1.Criteria criteria = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.visionai.v1.Criteria,
com.google.cloud.visionai.v1.Criteria.Builder,
com.google.cloud.visionai.v1.CriteriaOrBuilder>
getCriteriaFieldBuilder() {
if (criteriaBuilder_ == null) {
criteriaBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.visionai.v1.Criteria,
com.google.cloud.visionai.v1.Criteria.Builder,
com.google.cloud.visionai.v1.CriteriaOrBuilder>(
getCriteria(), getParentForChildren(), isClean());
criteria_ = null;
}
return criteriaBuilder_;
}
private java.util.List matchedAnnotations_ =
java.util.Collections.emptyList();
private void ensureMatchedAnnotationsIsMutable() {
if (!((bitField0_ & 0x00000002) != 0)) {
matchedAnnotations_ =
new java.util.ArrayList(matchedAnnotations_);
bitField0_ |= 0x00000002;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.visionai.v1.Annotation,
com.google.cloud.visionai.v1.Annotation.Builder,
com.google.cloud.visionai.v1.AnnotationOrBuilder>
matchedAnnotationsBuilder_;
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public java.util.List getMatchedAnnotationsList() {
if (matchedAnnotationsBuilder_ == null) {
return java.util.Collections.unmodifiableList(matchedAnnotations_);
} else {
return matchedAnnotationsBuilder_.getMessageList();
}
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public int getMatchedAnnotationsCount() {
if (matchedAnnotationsBuilder_ == null) {
return matchedAnnotations_.size();
} else {
return matchedAnnotationsBuilder_.getCount();
}
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public com.google.cloud.visionai.v1.Annotation getMatchedAnnotations(int index) {
if (matchedAnnotationsBuilder_ == null) {
return matchedAnnotations_.get(index);
} else {
return matchedAnnotationsBuilder_.getMessage(index);
}
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder setMatchedAnnotations(int index, com.google.cloud.visionai.v1.Annotation value) {
if (matchedAnnotationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.set(index, value);
onChanged();
} else {
matchedAnnotationsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder setMatchedAnnotations(
int index, com.google.cloud.visionai.v1.Annotation.Builder builderForValue) {
if (matchedAnnotationsBuilder_ == null) {
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.set(index, builderForValue.build());
onChanged();
} else {
matchedAnnotationsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder addMatchedAnnotations(com.google.cloud.visionai.v1.Annotation value) {
if (matchedAnnotationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.add(value);
onChanged();
} else {
matchedAnnotationsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder addMatchedAnnotations(int index, com.google.cloud.visionai.v1.Annotation value) {
if (matchedAnnotationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.add(index, value);
onChanged();
} else {
matchedAnnotationsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder addMatchedAnnotations(
com.google.cloud.visionai.v1.Annotation.Builder builderForValue) {
if (matchedAnnotationsBuilder_ == null) {
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.add(builderForValue.build());
onChanged();
} else {
matchedAnnotationsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder addMatchedAnnotations(
int index, com.google.cloud.visionai.v1.Annotation.Builder builderForValue) {
if (matchedAnnotationsBuilder_ == null) {
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.add(index, builderForValue.build());
onChanged();
} else {
matchedAnnotationsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder addAllMatchedAnnotations(
java.lang.Iterable extends com.google.cloud.visionai.v1.Annotation> values) {
if (matchedAnnotationsBuilder_ == null) {
ensureMatchedAnnotationsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, matchedAnnotations_);
onChanged();
} else {
matchedAnnotationsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder clearMatchedAnnotations() {
if (matchedAnnotationsBuilder_ == null) {
matchedAnnotations_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
} else {
matchedAnnotationsBuilder_.clear();
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public Builder removeMatchedAnnotations(int index) {
if (matchedAnnotationsBuilder_ == null) {
ensureMatchedAnnotationsIsMutable();
matchedAnnotations_.remove(index);
onChanged();
} else {
matchedAnnotationsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public com.google.cloud.visionai.v1.Annotation.Builder getMatchedAnnotationsBuilder(int index) {
return getMatchedAnnotationsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public com.google.cloud.visionai.v1.AnnotationOrBuilder getMatchedAnnotationsOrBuilder(
int index) {
if (matchedAnnotationsBuilder_ == null) {
return matchedAnnotations_.get(index);
} else {
return matchedAnnotationsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public java.util.List extends com.google.cloud.visionai.v1.AnnotationOrBuilder>
getMatchedAnnotationsOrBuilderList() {
if (matchedAnnotationsBuilder_ != null) {
return matchedAnnotationsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(matchedAnnotations_);
}
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public com.google.cloud.visionai.v1.Annotation.Builder addMatchedAnnotationsBuilder() {
return getMatchedAnnotationsFieldBuilder()
.addBuilder(com.google.cloud.visionai.v1.Annotation.getDefaultInstance());
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public com.google.cloud.visionai.v1.Annotation.Builder addMatchedAnnotationsBuilder(int index) {
return getMatchedAnnotationsFieldBuilder()
.addBuilder(index, com.google.cloud.visionai.v1.Annotation.getDefaultInstance());
}
/**
*
*
*
* Matched annotations for the criteria.
*
*
* repeated .google.cloud.visionai.v1.Annotation matched_annotations = 2;
*/
public java.util.List
getMatchedAnnotationsBuilderList() {
return getMatchedAnnotationsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.visionai.v1.Annotation,
com.google.cloud.visionai.v1.Annotation.Builder,
com.google.cloud.visionai.v1.AnnotationOrBuilder>
getMatchedAnnotationsFieldBuilder() {
if (matchedAnnotationsBuilder_ == null) {
matchedAnnotationsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.visionai.v1.Annotation,
com.google.cloud.visionai.v1.Annotation.Builder,
com.google.cloud.visionai.v1.AnnotationOrBuilder>(
matchedAnnotations_,
((bitField0_ & 0x00000002) != 0),
getParentForChildren(),
isClean());
matchedAnnotations_ = null;
}
return matchedAnnotationsBuilder_;
}
private com.google.rpc.Status status_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
statusBuilder_;
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*
* @return Whether the status field is set.
*/
public boolean hasStatus() {
return ((bitField0_ & 0x00000004) != 0);
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*
* @return The status.
*/
public com.google.rpc.Status getStatus() {
if (statusBuilder_ == null) {
return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
} else {
return statusBuilder_.getMessage();
}
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
public Builder setStatus(com.google.rpc.Status value) {
if (statusBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
status_ = value;
} else {
statusBuilder_.setMessage(value);
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
public Builder setStatus(com.google.rpc.Status.Builder builderForValue) {
if (statusBuilder_ == null) {
status_ = builderForValue.build();
} else {
statusBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
public Builder mergeStatus(com.google.rpc.Status value) {
if (statusBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)
&& status_ != null
&& status_ != com.google.rpc.Status.getDefaultInstance()) {
getStatusBuilder().mergeFrom(value);
} else {
status_ = value;
}
} else {
statusBuilder_.mergeFrom(value);
}
if (status_ != null) {
bitField0_ |= 0x00000004;
onChanged();
}
return this;
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
public Builder clearStatus() {
bitField0_ = (bitField0_ & ~0x00000004);
status_ = null;
if (statusBuilder_ != null) {
statusBuilder_.dispose();
statusBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
public com.google.rpc.Status.Builder getStatusBuilder() {
bitField0_ |= 0x00000004;
onChanged();
return getStatusFieldBuilder().getBuilder();
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
public com.google.rpc.StatusOrBuilder getStatusOrBuilder() {
if (statusBuilder_ != null) {
return statusBuilder_.getMessageOrBuilder();
} else {
return status_ == null ? com.google.rpc.Status.getDefaultInstance() : status_;
}
}
/**
*
*
*
* Status of the match result. Possible values:
* FAILED_PRECONDITION - the criteria is not eligible for match.
* OK - matching is performed.
*
*
* .google.rpc.Status status = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.rpc.Status, com.google.rpc.Status.Builder, com.google.rpc.StatusOrBuilder>
getStatusFieldBuilder() {
if (statusBuilder_ == null) {
statusBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.rpc.Status,
com.google.rpc.Status.Builder,
com.google.rpc.StatusOrBuilder>(getStatus(), getParentForChildren(), isClean());
status_ = null;
}
return statusBuilder_;
}
@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.visionai.v1.AnnotationMatchingResult)
}
// @@protoc_insertion_point(class_scope:google.cloud.visionai.v1.AnnotationMatchingResult)
private static final com.google.cloud.visionai.v1.AnnotationMatchingResult DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.visionai.v1.AnnotationMatchingResult();
}
public static com.google.cloud.visionai.v1.AnnotationMatchingResult getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public AnnotationMatchingResult parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.visionai.v1.AnnotationMatchingResult getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy