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

com.google.cloud.visionai.v1.SearchResultItem 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;

/**
 *
 *
 * 
 * Search result contains asset name and corresponding time ranges.
 * 
* * Protobuf type {@code google.cloud.visionai.v1.SearchResultItem} */ public final class SearchResultItem extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.visionai.v1.SearchResultItem) SearchResultItemOrBuilder { private static final long serialVersionUID = 0L; // Use SearchResultItem.newBuilder() to construct. private SearchResultItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); } private SearchResultItem() { asset_ = ""; segments_ = java.util.Collections.emptyList(); requestedAnnotations_ = java.util.Collections.emptyList(); annotationMatchingResults_ = java.util.Collections.emptyList(); } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new SearchResultItem(); } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.visionai.v1.WarehouseProto .internal_static_google_cloud_visionai_v1_SearchResultItem_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.visionai.v1.WarehouseProto .internal_static_google_cloud_visionai_v1_SearchResultItem_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.visionai.v1.SearchResultItem.class, com.google.cloud.visionai.v1.SearchResultItem.Builder.class); } private int bitField0_; public static final int ASSET_FIELD_NUMBER = 1; @SuppressWarnings("serial") private volatile java.lang.Object asset_ = ""; /** * * *
   * The resource name of the asset.
   * Format:
   * `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
   * 
* * string asset = 1; * * @return The asset. */ @java.lang.Override public java.lang.String getAsset() { java.lang.Object ref = asset_; 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(); asset_ = s; return s; } } /** * * *
   * The resource name of the asset.
   * Format:
   * `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
   * 
* * string asset = 1; * * @return The bytes for asset. */ @java.lang.Override public com.google.protobuf.ByteString getAssetBytes() { java.lang.Object ref = asset_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); asset_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } public static final int SEGMENTS_FIELD_NUMBER = 2; @SuppressWarnings("serial") private java.util.List segments_; /** * * *
   * The matched asset segments.
   * Deprecated: please use singular `segment` field.
   * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Override @java.lang.Deprecated public java.util.List getSegmentsList() { return segments_; } /** * * *
   * The matched asset segments.
   * Deprecated: please use singular `segment` field.
   * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Override @java.lang.Deprecated public java.util.List getSegmentsOrBuilderList() { return segments_; } /** * * *
   * The matched asset segments.
   * Deprecated: please use singular `segment` field.
   * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Override @java.lang.Deprecated public int getSegmentsCount() { return segments_.size(); } /** * * *
   * The matched asset segments.
   * Deprecated: please use singular `segment` field.
   * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Override @java.lang.Deprecated public com.google.cloud.visionai.v1.Partition.TemporalPartition getSegments(int index) { return segments_.get(index); } /** * * *
   * The matched asset segments.
   * Deprecated: please use singular `segment` field.
   * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Override @java.lang.Deprecated public com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder getSegmentsOrBuilder( int index) { return segments_.get(index); } public static final int SEGMENT_FIELD_NUMBER = 5; private com.google.cloud.visionai.v1.Partition.TemporalPartition segment_; /** * * *
   * The matched asset segment.
   * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; * * @return Whether the segment field is set. */ @java.lang.Override public boolean hasSegment() { return ((bitField0_ & 0x00000001) != 0); } /** * * *
   * The matched asset segment.
   * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; * * @return The segment. */ @java.lang.Override public com.google.cloud.visionai.v1.Partition.TemporalPartition getSegment() { return segment_ == null ? com.google.cloud.visionai.v1.Partition.TemporalPartition.getDefaultInstance() : segment_; } /** * * *
   * The matched asset segment.
   * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ @java.lang.Override public com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder getSegmentOrBuilder() { return segment_ == null ? com.google.cloud.visionai.v1.Partition.TemporalPartition.getDefaultInstance() : segment_; } public static final int RELEVANCE_FIELD_NUMBER = 6; private double relevance_ = 0D; /** * * *
   * Relevance of this `SearchResultItem` to user search request.
   * Currently available only in Image Warehouse, and by default represents
   * cosine similarity.  In the future can be other measures such as "dot
   * product" or "topicality" requested in the search request.
   * 
* * double relevance = 6; * * @return The relevance. */ @java.lang.Override public double getRelevance() { return relevance_; } public static final int REQUESTED_ANNOTATIONS_FIELD_NUMBER = 3; @SuppressWarnings("serial") private java.util.List requestedAnnotations_; /** * * *
   * Search result annotations specified by result_annotation_keys in search
   * request.
   * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ @java.lang.Override public java.util.List getRequestedAnnotationsList() { return requestedAnnotations_; } /** * * *
   * Search result annotations specified by result_annotation_keys in search
   * request.
   * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ @java.lang.Override public java.util.List getRequestedAnnotationsOrBuilderList() { return requestedAnnotations_; } /** * * *
   * Search result annotations specified by result_annotation_keys in search
   * request.
   * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ @java.lang.Override public int getRequestedAnnotationsCount() { return requestedAnnotations_.size(); } /** * * *
   * Search result annotations specified by result_annotation_keys in search
   * request.
   * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ @java.lang.Override public com.google.cloud.visionai.v1.Annotation getRequestedAnnotations(int index) { return requestedAnnotations_.get(index); } /** * * *
   * Search result annotations specified by result_annotation_keys in search
   * request.
   * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ @java.lang.Override public com.google.cloud.visionai.v1.AnnotationOrBuilder getRequestedAnnotationsOrBuilder( int index) { return requestedAnnotations_.get(index); } public static final int ANNOTATION_MATCHING_RESULTS_FIELD_NUMBER = 4; @SuppressWarnings("serial") private java.util.List annotationMatchingResults_; /** * * *
   * Criteria or facet-selection based annotation matching results associated to
   * this search result item. Only contains results for criteria or
   * facet_selections with fetch_matched_annotations=true.
   * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ @java.lang.Override public java.util.List getAnnotationMatchingResultsList() { return annotationMatchingResults_; } /** * * *
   * Criteria or facet-selection based annotation matching results associated to
   * this search result item. Only contains results for criteria or
   * facet_selections with fetch_matched_annotations=true.
   * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ @java.lang.Override public java.util.List getAnnotationMatchingResultsOrBuilderList() { return annotationMatchingResults_; } /** * * *
   * Criteria or facet-selection based annotation matching results associated to
   * this search result item. Only contains results for criteria or
   * facet_selections with fetch_matched_annotations=true.
   * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ @java.lang.Override public int getAnnotationMatchingResultsCount() { return annotationMatchingResults_.size(); } /** * * *
   * Criteria or facet-selection based annotation matching results associated to
   * this search result item. Only contains results for criteria or
   * facet_selections with fetch_matched_annotations=true.
   * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ @java.lang.Override public com.google.cloud.visionai.v1.AnnotationMatchingResult getAnnotationMatchingResults( int index) { return annotationMatchingResults_.get(index); } /** * * *
   * Criteria or facet-selection based annotation matching results associated to
   * this search result item. Only contains results for criteria or
   * facet_selections with fetch_matched_annotations=true.
   * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ @java.lang.Override public com.google.cloud.visionai.v1.AnnotationMatchingResultOrBuilder getAnnotationMatchingResultsOrBuilder(int index) { return annotationMatchingResults_.get(index); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(asset_)) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, asset_); } for (int i = 0; i < segments_.size(); i++) { output.writeMessage(2, segments_.get(i)); } for (int i = 0; i < requestedAnnotations_.size(); i++) { output.writeMessage(3, requestedAnnotations_.get(i)); } for (int i = 0; i < annotationMatchingResults_.size(); i++) { output.writeMessage(4, annotationMatchingResults_.get(i)); } if (((bitField0_ & 0x00000001) != 0)) { output.writeMessage(5, getSegment()); } if (java.lang.Double.doubleToRawLongBits(relevance_) != 0) { output.writeDouble(6, relevance_); } getUnknownFields().writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(asset_)) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, asset_); } for (int i = 0; i < segments_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(2, segments_.get(i)); } for (int i = 0; i < requestedAnnotations_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, requestedAnnotations_.get(i)); } for (int i = 0; i < annotationMatchingResults_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 4, annotationMatchingResults_.get(i)); } if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, getSegment()); } if (java.lang.Double.doubleToRawLongBits(relevance_) != 0) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(6, relevance_); } 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.SearchResultItem)) { return super.equals(obj); } com.google.cloud.visionai.v1.SearchResultItem other = (com.google.cloud.visionai.v1.SearchResultItem) obj; if (!getAsset().equals(other.getAsset())) return false; if (!getSegmentsList().equals(other.getSegmentsList())) return false; if (hasSegment() != other.hasSegment()) return false; if (hasSegment()) { if (!getSegment().equals(other.getSegment())) return false; } if (java.lang.Double.doubleToLongBits(getRelevance()) != java.lang.Double.doubleToLongBits(other.getRelevance())) return false; if (!getRequestedAnnotationsList().equals(other.getRequestedAnnotationsList())) return false; if (!getAnnotationMatchingResultsList().equals(other.getAnnotationMatchingResultsList())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + ASSET_FIELD_NUMBER; hash = (53 * hash) + getAsset().hashCode(); if (getSegmentsCount() > 0) { hash = (37 * hash) + SEGMENTS_FIELD_NUMBER; hash = (53 * hash) + getSegmentsList().hashCode(); } if (hasSegment()) { hash = (37 * hash) + SEGMENT_FIELD_NUMBER; hash = (53 * hash) + getSegment().hashCode(); } hash = (37 * hash) + RELEVANCE_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashLong( java.lang.Double.doubleToLongBits(getRelevance())); if (getRequestedAnnotationsCount() > 0) { hash = (37 * hash) + REQUESTED_ANNOTATIONS_FIELD_NUMBER; hash = (53 * hash) + getRequestedAnnotationsList().hashCode(); } if (getAnnotationMatchingResultsCount() > 0) { hash = (37 * hash) + ANNOTATION_MATCHING_RESULTS_FIELD_NUMBER; hash = (53 * hash) + getAnnotationMatchingResultsList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.visionai.v1.SearchResultItem parseFrom(java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.visionai.v1.SearchResultItem 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.SearchResultItem parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.visionai.v1.SearchResultItem 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.SearchResultItem parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.visionai.v1.SearchResultItem 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.SearchResultItem parseFrom(java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.visionai.v1.SearchResultItem 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.SearchResultItem parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.visionai.v1.SearchResultItem 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.SearchResultItem 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.SearchResultItem 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.SearchResultItem 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; } /** * * *
   * Search result contains asset name and corresponding time ranges.
   * 
* * Protobuf type {@code google.cloud.visionai.v1.SearchResultItem} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements // @@protoc_insertion_point(builder_implements:google.cloud.visionai.v1.SearchResultItem) com.google.cloud.visionai.v1.SearchResultItemOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.visionai.v1.WarehouseProto .internal_static_google_cloud_visionai_v1_SearchResultItem_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.visionai.v1.WarehouseProto .internal_static_google_cloud_visionai_v1_SearchResultItem_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.visionai.v1.SearchResultItem.class, com.google.cloud.visionai.v1.SearchResultItem.Builder.class); } // Construct using com.google.cloud.visionai.v1.SearchResultItem.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { getSegmentsFieldBuilder(); getSegmentFieldBuilder(); getRequestedAnnotationsFieldBuilder(); getAnnotationMatchingResultsFieldBuilder(); } } @java.lang.Override public Builder clear() { super.clear(); bitField0_ = 0; asset_ = ""; if (segmentsBuilder_ == null) { segments_ = java.util.Collections.emptyList(); } else { segments_ = null; segmentsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000002); segment_ = null; if (segmentBuilder_ != null) { segmentBuilder_.dispose(); segmentBuilder_ = null; } relevance_ = 0D; if (requestedAnnotationsBuilder_ == null) { requestedAnnotations_ = java.util.Collections.emptyList(); } else { requestedAnnotations_ = null; requestedAnnotationsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000010); if (annotationMatchingResultsBuilder_ == null) { annotationMatchingResults_ = java.util.Collections.emptyList(); } else { annotationMatchingResults_ = null; annotationMatchingResultsBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000020); 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_SearchResultItem_descriptor; } @java.lang.Override public com.google.cloud.visionai.v1.SearchResultItem getDefaultInstanceForType() { return com.google.cloud.visionai.v1.SearchResultItem.getDefaultInstance(); } @java.lang.Override public com.google.cloud.visionai.v1.SearchResultItem build() { com.google.cloud.visionai.v1.SearchResultItem result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.visionai.v1.SearchResultItem buildPartial() { com.google.cloud.visionai.v1.SearchResultItem result = new com.google.cloud.visionai.v1.SearchResultItem(this); buildPartialRepeatedFields(result); if (bitField0_ != 0) { buildPartial0(result); } onBuilt(); return result; } private void buildPartialRepeatedFields(com.google.cloud.visionai.v1.SearchResultItem result) { if (segmentsBuilder_ == null) { if (((bitField0_ & 0x00000002) != 0)) { segments_ = java.util.Collections.unmodifiableList(segments_); bitField0_ = (bitField0_ & ~0x00000002); } result.segments_ = segments_; } else { result.segments_ = segmentsBuilder_.build(); } if (requestedAnnotationsBuilder_ == null) { if (((bitField0_ & 0x00000010) != 0)) { requestedAnnotations_ = java.util.Collections.unmodifiableList(requestedAnnotations_); bitField0_ = (bitField0_ & ~0x00000010); } result.requestedAnnotations_ = requestedAnnotations_; } else { result.requestedAnnotations_ = requestedAnnotationsBuilder_.build(); } if (annotationMatchingResultsBuilder_ == null) { if (((bitField0_ & 0x00000020) != 0)) { annotationMatchingResults_ = java.util.Collections.unmodifiableList(annotationMatchingResults_); bitField0_ = (bitField0_ & ~0x00000020); } result.annotationMatchingResults_ = annotationMatchingResults_; } else { result.annotationMatchingResults_ = annotationMatchingResultsBuilder_.build(); } } private void buildPartial0(com.google.cloud.visionai.v1.SearchResultItem result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000001) != 0)) { result.asset_ = asset_; } int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000004) != 0)) { result.segment_ = segmentBuilder_ == null ? segment_ : segmentBuilder_.build(); to_bitField0_ |= 0x00000001; } if (((from_bitField0_ & 0x00000008) != 0)) { result.relevance_ = relevance_; } 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.SearchResultItem) { return mergeFrom((com.google.cloud.visionai.v1.SearchResultItem) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.visionai.v1.SearchResultItem other) { if (other == com.google.cloud.visionai.v1.SearchResultItem.getDefaultInstance()) return this; if (!other.getAsset().isEmpty()) { asset_ = other.asset_; bitField0_ |= 0x00000001; onChanged(); } if (segmentsBuilder_ == null) { if (!other.segments_.isEmpty()) { if (segments_.isEmpty()) { segments_ = other.segments_; bitField0_ = (bitField0_ & ~0x00000002); } else { ensureSegmentsIsMutable(); segments_.addAll(other.segments_); } onChanged(); } } else { if (!other.segments_.isEmpty()) { if (segmentsBuilder_.isEmpty()) { segmentsBuilder_.dispose(); segmentsBuilder_ = null; segments_ = other.segments_; bitField0_ = (bitField0_ & ~0x00000002); segmentsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getSegmentsFieldBuilder() : null; } else { segmentsBuilder_.addAllMessages(other.segments_); } } } if (other.hasSegment()) { mergeSegment(other.getSegment()); } if (other.getRelevance() != 0D) { setRelevance(other.getRelevance()); } if (requestedAnnotationsBuilder_ == null) { if (!other.requestedAnnotations_.isEmpty()) { if (requestedAnnotations_.isEmpty()) { requestedAnnotations_ = other.requestedAnnotations_; bitField0_ = (bitField0_ & ~0x00000010); } else { ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.addAll(other.requestedAnnotations_); } onChanged(); } } else { if (!other.requestedAnnotations_.isEmpty()) { if (requestedAnnotationsBuilder_.isEmpty()) { requestedAnnotationsBuilder_.dispose(); requestedAnnotationsBuilder_ = null; requestedAnnotations_ = other.requestedAnnotations_; bitField0_ = (bitField0_ & ~0x00000010); requestedAnnotationsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getRequestedAnnotationsFieldBuilder() : null; } else { requestedAnnotationsBuilder_.addAllMessages(other.requestedAnnotations_); } } } if (annotationMatchingResultsBuilder_ == null) { if (!other.annotationMatchingResults_.isEmpty()) { if (annotationMatchingResults_.isEmpty()) { annotationMatchingResults_ = other.annotationMatchingResults_; bitField0_ = (bitField0_ & ~0x00000020); } else { ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.addAll(other.annotationMatchingResults_); } onChanged(); } } else { if (!other.annotationMatchingResults_.isEmpty()) { if (annotationMatchingResultsBuilder_.isEmpty()) { annotationMatchingResultsBuilder_.dispose(); annotationMatchingResultsBuilder_ = null; annotationMatchingResults_ = other.annotationMatchingResults_; bitField0_ = (bitField0_ & ~0x00000020); annotationMatchingResultsBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getAnnotationMatchingResultsFieldBuilder() : null; } else { annotationMatchingResultsBuilder_.addAllMessages(other.annotationMatchingResults_); } } } 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: { asset_ = input.readStringRequireUtf8(); bitField0_ |= 0x00000001; break; } // case 10 case 18: { com.google.cloud.visionai.v1.Partition.TemporalPartition m = input.readMessage( com.google.cloud.visionai.v1.Partition.TemporalPartition.parser(), extensionRegistry); if (segmentsBuilder_ == null) { ensureSegmentsIsMutable(); segments_.add(m); } else { segmentsBuilder_.addMessage(m); } break; } // case 18 case 26: { com.google.cloud.visionai.v1.Annotation m = input.readMessage( com.google.cloud.visionai.v1.Annotation.parser(), extensionRegistry); if (requestedAnnotationsBuilder_ == null) { ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.add(m); } else { requestedAnnotationsBuilder_.addMessage(m); } break; } // case 26 case 34: { com.google.cloud.visionai.v1.AnnotationMatchingResult m = input.readMessage( com.google.cloud.visionai.v1.AnnotationMatchingResult.parser(), extensionRegistry); if (annotationMatchingResultsBuilder_ == null) { ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.add(m); } else { annotationMatchingResultsBuilder_.addMessage(m); } break; } // case 34 case 42: { input.readMessage(getSegmentFieldBuilder().getBuilder(), extensionRegistry); bitField0_ |= 0x00000004; break; } // case 42 case 49: { relevance_ = input.readDouble(); bitField0_ |= 0x00000008; break; } // case 49 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag } break; } // default: } // switch (tag) } // while (!done) } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.unwrapIOException(); } finally { onChanged(); } // finally return this; } private int bitField0_; private java.lang.Object asset_ = ""; /** * * *
     * The resource name of the asset.
     * Format:
     * `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
     * 
* * string asset = 1; * * @return The asset. */ public java.lang.String getAsset() { java.lang.Object ref = asset_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); asset_ = s; return s; } else { return (java.lang.String) ref; } } /** * * *
     * The resource name of the asset.
     * Format:
     * `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
     * 
* * string asset = 1; * * @return The bytes for asset. */ public com.google.protobuf.ByteString getAssetBytes() { java.lang.Object ref = asset_; if (ref instanceof String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); asset_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } /** * * *
     * The resource name of the asset.
     * Format:
     * `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
     * 
* * string asset = 1; * * @param value The asset to set. * @return This builder for chaining. */ public Builder setAsset(java.lang.String value) { if (value == null) { throw new NullPointerException(); } asset_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } /** * * *
     * The resource name of the asset.
     * Format:
     * `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
     * 
* * string asset = 1; * * @return This builder for chaining. */ public Builder clearAsset() { asset_ = getDefaultInstance().getAsset(); bitField0_ = (bitField0_ & ~0x00000001); onChanged(); return this; } /** * * *
     * The resource name of the asset.
     * Format:
     * `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}`
     * 
* * string asset = 1; * * @param value The bytes for asset to set. * @return This builder for chaining. */ public Builder setAssetBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); asset_ = value; bitField0_ |= 0x00000001; onChanged(); return this; } private java.util.List segments_ = java.util.Collections.emptyList(); private void ensureSegmentsIsMutable() { if (!((bitField0_ & 0x00000002) != 0)) { segments_ = new java.util.ArrayList( segments_); bitField0_ |= 0x00000002; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.Partition.TemporalPartition, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder, com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder> segmentsBuilder_; /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public java.util.List getSegmentsList() { if (segmentsBuilder_ == null) { return java.util.Collections.unmodifiableList(segments_); } else { return segmentsBuilder_.getMessageList(); } } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public int getSegmentsCount() { if (segmentsBuilder_ == null) { return segments_.size(); } else { return segmentsBuilder_.getCount(); } } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public com.google.cloud.visionai.v1.Partition.TemporalPartition getSegments(int index) { if (segmentsBuilder_ == null) { return segments_.get(index); } else { return segmentsBuilder_.getMessage(index); } } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder setSegments( int index, com.google.cloud.visionai.v1.Partition.TemporalPartition value) { if (segmentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSegmentsIsMutable(); segments_.set(index, value); onChanged(); } else { segmentsBuilder_.setMessage(index, value); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder setSegments( int index, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder builderForValue) { if (segmentsBuilder_ == null) { ensureSegmentsIsMutable(); segments_.set(index, builderForValue.build()); onChanged(); } else { segmentsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder addSegments(com.google.cloud.visionai.v1.Partition.TemporalPartition value) { if (segmentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSegmentsIsMutable(); segments_.add(value); onChanged(); } else { segmentsBuilder_.addMessage(value); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder addSegments( int index, com.google.cloud.visionai.v1.Partition.TemporalPartition value) { if (segmentsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureSegmentsIsMutable(); segments_.add(index, value); onChanged(); } else { segmentsBuilder_.addMessage(index, value); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder addSegments( com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder builderForValue) { if (segmentsBuilder_ == null) { ensureSegmentsIsMutable(); segments_.add(builderForValue.build()); onChanged(); } else { segmentsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder addSegments( int index, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder builderForValue) { if (segmentsBuilder_ == null) { ensureSegmentsIsMutable(); segments_.add(index, builderForValue.build()); onChanged(); } else { segmentsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder addAllSegments( java.lang.Iterable values) { if (segmentsBuilder_ == null) { ensureSegmentsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, segments_); onChanged(); } else { segmentsBuilder_.addAllMessages(values); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder clearSegments() { if (segmentsBuilder_ == null) { segments_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000002); onChanged(); } else { segmentsBuilder_.clear(); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public Builder removeSegments(int index) { if (segmentsBuilder_ == null) { ensureSegmentsIsMutable(); segments_.remove(index); onChanged(); } else { segmentsBuilder_.remove(index); } return this; } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder getSegmentsBuilder( int index) { return getSegmentsFieldBuilder().getBuilder(index); } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder getSegmentsOrBuilder( int index) { if (segmentsBuilder_ == null) { return segments_.get(index); } else { return segmentsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public java.util.List< ? extends com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder> getSegmentsOrBuilderList() { if (segmentsBuilder_ != null) { return segmentsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(segments_); } } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder addSegmentsBuilder() { return getSegmentsFieldBuilder() .addBuilder( com.google.cloud.visionai.v1.Partition.TemporalPartition.getDefaultInstance()); } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder addSegmentsBuilder( int index) { return getSegmentsFieldBuilder() .addBuilder( index, com.google.cloud.visionai.v1.Partition.TemporalPartition.getDefaultInstance()); } /** * * *
     * The matched asset segments.
     * Deprecated: please use singular `segment` field.
     * 
* * * repeated .google.cloud.visionai.v1.Partition.TemporalPartition segments = 2 [deprecated = true]; * */ @java.lang.Deprecated public java.util.List getSegmentsBuilderList() { return getSegmentsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.Partition.TemporalPartition, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder, com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder> getSegmentsFieldBuilder() { if (segmentsBuilder_ == null) { segmentsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.Partition.TemporalPartition, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder, com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder>( segments_, ((bitField0_ & 0x00000002) != 0), getParentForChildren(), isClean()); segments_ = null; } return segmentsBuilder_; } private com.google.cloud.visionai.v1.Partition.TemporalPartition segment_; private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.visionai.v1.Partition.TemporalPartition, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder, com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder> segmentBuilder_; /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; * * @return Whether the segment field is set. */ public boolean hasSegment() { return ((bitField0_ & 0x00000004) != 0); } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; * * @return The segment. */ public com.google.cloud.visionai.v1.Partition.TemporalPartition getSegment() { if (segmentBuilder_ == null) { return segment_ == null ? com.google.cloud.visionai.v1.Partition.TemporalPartition.getDefaultInstance() : segment_; } else { return segmentBuilder_.getMessage(); } } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ public Builder setSegment(com.google.cloud.visionai.v1.Partition.TemporalPartition value) { if (segmentBuilder_ == null) { if (value == null) { throw new NullPointerException(); } segment_ = value; } else { segmentBuilder_.setMessage(value); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ public Builder setSegment( com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder builderForValue) { if (segmentBuilder_ == null) { segment_ = builderForValue.build(); } else { segmentBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00000004; onChanged(); return this; } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ public Builder mergeSegment(com.google.cloud.visionai.v1.Partition.TemporalPartition value) { if (segmentBuilder_ == null) { if (((bitField0_ & 0x00000004) != 0) && segment_ != null && segment_ != com.google.cloud.visionai.v1.Partition.TemporalPartition.getDefaultInstance()) { getSegmentBuilder().mergeFrom(value); } else { segment_ = value; } } else { segmentBuilder_.mergeFrom(value); } if (segment_ != null) { bitField0_ |= 0x00000004; onChanged(); } return this; } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ public Builder clearSegment() { bitField0_ = (bitField0_ & ~0x00000004); segment_ = null; if (segmentBuilder_ != null) { segmentBuilder_.dispose(); segmentBuilder_ = null; } onChanged(); return this; } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ public com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder getSegmentBuilder() { bitField0_ |= 0x00000004; onChanged(); return getSegmentFieldBuilder().getBuilder(); } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ public com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder getSegmentOrBuilder() { if (segmentBuilder_ != null) { return segmentBuilder_.getMessageOrBuilder(); } else { return segment_ == null ? com.google.cloud.visionai.v1.Partition.TemporalPartition.getDefaultInstance() : segment_; } } /** * * *
     * The matched asset segment.
     * 
* * .google.cloud.visionai.v1.Partition.TemporalPartition segment = 5; */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.visionai.v1.Partition.TemporalPartition, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder, com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder> getSegmentFieldBuilder() { if (segmentBuilder_ == null) { segmentBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.visionai.v1.Partition.TemporalPartition, com.google.cloud.visionai.v1.Partition.TemporalPartition.Builder, com.google.cloud.visionai.v1.Partition.TemporalPartitionOrBuilder>( getSegment(), getParentForChildren(), isClean()); segment_ = null; } return segmentBuilder_; } private double relevance_; /** * * *
     * Relevance of this `SearchResultItem` to user search request.
     * Currently available only in Image Warehouse, and by default represents
     * cosine similarity.  In the future can be other measures such as "dot
     * product" or "topicality" requested in the search request.
     * 
* * double relevance = 6; * * @return The relevance. */ @java.lang.Override public double getRelevance() { return relevance_; } /** * * *
     * Relevance of this `SearchResultItem` to user search request.
     * Currently available only in Image Warehouse, and by default represents
     * cosine similarity.  In the future can be other measures such as "dot
     * product" or "topicality" requested in the search request.
     * 
* * double relevance = 6; * * @param value The relevance to set. * @return This builder for chaining. */ public Builder setRelevance(double value) { relevance_ = value; bitField0_ |= 0x00000008; onChanged(); return this; } /** * * *
     * Relevance of this `SearchResultItem` to user search request.
     * Currently available only in Image Warehouse, and by default represents
     * cosine similarity.  In the future can be other measures such as "dot
     * product" or "topicality" requested in the search request.
     * 
* * double relevance = 6; * * @return This builder for chaining. */ public Builder clearRelevance() { bitField0_ = (bitField0_ & ~0x00000008); relevance_ = 0D; onChanged(); return this; } private java.util.List requestedAnnotations_ = java.util.Collections.emptyList(); private void ensureRequestedAnnotationsIsMutable() { if (!((bitField0_ & 0x00000010) != 0)) { requestedAnnotations_ = new java.util.ArrayList(requestedAnnotations_); bitField0_ |= 0x00000010; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.Annotation, com.google.cloud.visionai.v1.Annotation.Builder, com.google.cloud.visionai.v1.AnnotationOrBuilder> requestedAnnotationsBuilder_; /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public java.util.List getRequestedAnnotationsList() { if (requestedAnnotationsBuilder_ == null) { return java.util.Collections.unmodifiableList(requestedAnnotations_); } else { return requestedAnnotationsBuilder_.getMessageList(); } } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public int getRequestedAnnotationsCount() { if (requestedAnnotationsBuilder_ == null) { return requestedAnnotations_.size(); } else { return requestedAnnotationsBuilder_.getCount(); } } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public com.google.cloud.visionai.v1.Annotation getRequestedAnnotations(int index) { if (requestedAnnotationsBuilder_ == null) { return requestedAnnotations_.get(index); } else { return requestedAnnotationsBuilder_.getMessage(index); } } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder setRequestedAnnotations( int index, com.google.cloud.visionai.v1.Annotation value) { if (requestedAnnotationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.set(index, value); onChanged(); } else { requestedAnnotationsBuilder_.setMessage(index, value); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder setRequestedAnnotations( int index, com.google.cloud.visionai.v1.Annotation.Builder builderForValue) { if (requestedAnnotationsBuilder_ == null) { ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.set(index, builderForValue.build()); onChanged(); } else { requestedAnnotationsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder addRequestedAnnotations(com.google.cloud.visionai.v1.Annotation value) { if (requestedAnnotationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.add(value); onChanged(); } else { requestedAnnotationsBuilder_.addMessage(value); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder addRequestedAnnotations( int index, com.google.cloud.visionai.v1.Annotation value) { if (requestedAnnotationsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.add(index, value); onChanged(); } else { requestedAnnotationsBuilder_.addMessage(index, value); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder addRequestedAnnotations( com.google.cloud.visionai.v1.Annotation.Builder builderForValue) { if (requestedAnnotationsBuilder_ == null) { ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.add(builderForValue.build()); onChanged(); } else { requestedAnnotationsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder addRequestedAnnotations( int index, com.google.cloud.visionai.v1.Annotation.Builder builderForValue) { if (requestedAnnotationsBuilder_ == null) { ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.add(index, builderForValue.build()); onChanged(); } else { requestedAnnotationsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder addAllRequestedAnnotations( java.lang.Iterable values) { if (requestedAnnotationsBuilder_ == null) { ensureRequestedAnnotationsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, requestedAnnotations_); onChanged(); } else { requestedAnnotationsBuilder_.addAllMessages(values); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder clearRequestedAnnotations() { if (requestedAnnotationsBuilder_ == null) { requestedAnnotations_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000010); onChanged(); } else { requestedAnnotationsBuilder_.clear(); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public Builder removeRequestedAnnotations(int index) { if (requestedAnnotationsBuilder_ == null) { ensureRequestedAnnotationsIsMutable(); requestedAnnotations_.remove(index); onChanged(); } else { requestedAnnotationsBuilder_.remove(index); } return this; } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public com.google.cloud.visionai.v1.Annotation.Builder getRequestedAnnotationsBuilder( int index) { return getRequestedAnnotationsFieldBuilder().getBuilder(index); } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public com.google.cloud.visionai.v1.AnnotationOrBuilder getRequestedAnnotationsOrBuilder( int index) { if (requestedAnnotationsBuilder_ == null) { return requestedAnnotations_.get(index); } else { return requestedAnnotationsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public java.util.List getRequestedAnnotationsOrBuilderList() { if (requestedAnnotationsBuilder_ != null) { return requestedAnnotationsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(requestedAnnotations_); } } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public com.google.cloud.visionai.v1.Annotation.Builder addRequestedAnnotationsBuilder() { return getRequestedAnnotationsFieldBuilder() .addBuilder(com.google.cloud.visionai.v1.Annotation.getDefaultInstance()); } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public com.google.cloud.visionai.v1.Annotation.Builder addRequestedAnnotationsBuilder( int index) { return getRequestedAnnotationsFieldBuilder() .addBuilder(index, com.google.cloud.visionai.v1.Annotation.getDefaultInstance()); } /** * * *
     * Search result annotations specified by result_annotation_keys in search
     * request.
     * 
* * repeated .google.cloud.visionai.v1.Annotation requested_annotations = 3; */ public java.util.List getRequestedAnnotationsBuilderList() { return getRequestedAnnotationsFieldBuilder().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> getRequestedAnnotationsFieldBuilder() { if (requestedAnnotationsBuilder_ == null) { requestedAnnotationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.Annotation, com.google.cloud.visionai.v1.Annotation.Builder, com.google.cloud.visionai.v1.AnnotationOrBuilder>( requestedAnnotations_, ((bitField0_ & 0x00000010) != 0), getParentForChildren(), isClean()); requestedAnnotations_ = null; } return requestedAnnotationsBuilder_; } private java.util.List annotationMatchingResults_ = java.util.Collections.emptyList(); private void ensureAnnotationMatchingResultsIsMutable() { if (!((bitField0_ & 0x00000020) != 0)) { annotationMatchingResults_ = new java.util.ArrayList( annotationMatchingResults_); bitField0_ |= 0x00000020; } } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.AnnotationMatchingResult, com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder, com.google.cloud.visionai.v1.AnnotationMatchingResultOrBuilder> annotationMatchingResultsBuilder_; /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public java.util.List getAnnotationMatchingResultsList() { if (annotationMatchingResultsBuilder_ == null) { return java.util.Collections.unmodifiableList(annotationMatchingResults_); } else { return annotationMatchingResultsBuilder_.getMessageList(); } } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public int getAnnotationMatchingResultsCount() { if (annotationMatchingResultsBuilder_ == null) { return annotationMatchingResults_.size(); } else { return annotationMatchingResultsBuilder_.getCount(); } } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public com.google.cloud.visionai.v1.AnnotationMatchingResult getAnnotationMatchingResults( int index) { if (annotationMatchingResultsBuilder_ == null) { return annotationMatchingResults_.get(index); } else { return annotationMatchingResultsBuilder_.getMessage(index); } } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder setAnnotationMatchingResults( int index, com.google.cloud.visionai.v1.AnnotationMatchingResult value) { if (annotationMatchingResultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.set(index, value); onChanged(); } else { annotationMatchingResultsBuilder_.setMessage(index, value); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder setAnnotationMatchingResults( int index, com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder builderForValue) { if (annotationMatchingResultsBuilder_ == null) { ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.set(index, builderForValue.build()); onChanged(); } else { annotationMatchingResultsBuilder_.setMessage(index, builderForValue.build()); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder addAnnotationMatchingResults( com.google.cloud.visionai.v1.AnnotationMatchingResult value) { if (annotationMatchingResultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.add(value); onChanged(); } else { annotationMatchingResultsBuilder_.addMessage(value); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder addAnnotationMatchingResults( int index, com.google.cloud.visionai.v1.AnnotationMatchingResult value) { if (annotationMatchingResultsBuilder_ == null) { if (value == null) { throw new NullPointerException(); } ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.add(index, value); onChanged(); } else { annotationMatchingResultsBuilder_.addMessage(index, value); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder addAnnotationMatchingResults( com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder builderForValue) { if (annotationMatchingResultsBuilder_ == null) { ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.add(builderForValue.build()); onChanged(); } else { annotationMatchingResultsBuilder_.addMessage(builderForValue.build()); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder addAnnotationMatchingResults( int index, com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder builderForValue) { if (annotationMatchingResultsBuilder_ == null) { ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.add(index, builderForValue.build()); onChanged(); } else { annotationMatchingResultsBuilder_.addMessage(index, builderForValue.build()); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder addAllAnnotationMatchingResults( java.lang.Iterable values) { if (annotationMatchingResultsBuilder_ == null) { ensureAnnotationMatchingResultsIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, annotationMatchingResults_); onChanged(); } else { annotationMatchingResultsBuilder_.addAllMessages(values); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder clearAnnotationMatchingResults() { if (annotationMatchingResultsBuilder_ == null) { annotationMatchingResults_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00000020); onChanged(); } else { annotationMatchingResultsBuilder_.clear(); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public Builder removeAnnotationMatchingResults(int index) { if (annotationMatchingResultsBuilder_ == null) { ensureAnnotationMatchingResultsIsMutable(); annotationMatchingResults_.remove(index); onChanged(); } else { annotationMatchingResultsBuilder_.remove(index); } return this; } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder getAnnotationMatchingResultsBuilder(int index) { return getAnnotationMatchingResultsFieldBuilder().getBuilder(index); } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public com.google.cloud.visionai.v1.AnnotationMatchingResultOrBuilder getAnnotationMatchingResultsOrBuilder(int index) { if (annotationMatchingResultsBuilder_ == null) { return annotationMatchingResults_.get(index); } else { return annotationMatchingResultsBuilder_.getMessageOrBuilder(index); } } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public java.util.List getAnnotationMatchingResultsOrBuilderList() { if (annotationMatchingResultsBuilder_ != null) { return annotationMatchingResultsBuilder_.getMessageOrBuilderList(); } else { return java.util.Collections.unmodifiableList(annotationMatchingResults_); } } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder addAnnotationMatchingResultsBuilder() { return getAnnotationMatchingResultsFieldBuilder() .addBuilder(com.google.cloud.visionai.v1.AnnotationMatchingResult.getDefaultInstance()); } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder addAnnotationMatchingResultsBuilder(int index) { return getAnnotationMatchingResultsFieldBuilder() .addBuilder( index, com.google.cloud.visionai.v1.AnnotationMatchingResult.getDefaultInstance()); } /** * * *
     * Criteria or facet-selection based annotation matching results associated to
     * this search result item. Only contains results for criteria or
     * facet_selections with fetch_matched_annotations=true.
     * 
* * * repeated .google.cloud.visionai.v1.AnnotationMatchingResult annotation_matching_results = 4; * */ public java.util.List getAnnotationMatchingResultsBuilderList() { return getAnnotationMatchingResultsFieldBuilder().getBuilderList(); } private com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.AnnotationMatchingResult, com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder, com.google.cloud.visionai.v1.AnnotationMatchingResultOrBuilder> getAnnotationMatchingResultsFieldBuilder() { if (annotationMatchingResultsBuilder_ == null) { annotationMatchingResultsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< com.google.cloud.visionai.v1.AnnotationMatchingResult, com.google.cloud.visionai.v1.AnnotationMatchingResult.Builder, com.google.cloud.visionai.v1.AnnotationMatchingResultOrBuilder>( annotationMatchingResults_, ((bitField0_ & 0x00000020) != 0), getParentForChildren(), isClean()); annotationMatchingResults_ = null; } return annotationMatchingResultsBuilder_; } @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.SearchResultItem) } // @@protoc_insertion_point(class_scope:google.cloud.visionai.v1.SearchResultItem) private static final com.google.cloud.visionai.v1.SearchResultItem DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.visionai.v1.SearchResultItem(); } public static com.google.cloud.visionai.v1.SearchResultItem getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public SearchResultItem 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.SearchResultItem getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy