
com.google.cloud.visionai.v1.FacetGroup 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;
/**
*
*
*
* A group of facet buckets to be passed back and forth between backend &
* frontend.
*
*
* Protobuf type {@code google.cloud.visionai.v1.FacetGroup}
*/
public final class FacetGroup extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.visionai.v1.FacetGroup)
FacetGroupOrBuilder {
private static final long serialVersionUID = 0L;
// Use FacetGroup.newBuilder() to construct.
private FacetGroup(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private FacetGroup() {
facetId_ = "";
displayName_ = "";
buckets_ = java.util.Collections.emptyList();
bucketType_ = 0;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new FacetGroup();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_FacetGroup_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_FacetGroup_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.visionai.v1.FacetGroup.class,
com.google.cloud.visionai.v1.FacetGroup.Builder.class);
}
public static final int FACET_ID_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object facetId_ = "";
/**
*
*
*
* Unique id of the facet group.
*
*
* string facet_id = 1;
*
* @return The facetId.
*/
@java.lang.Override
public java.lang.String getFacetId() {
java.lang.Object ref = facetId_;
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();
facetId_ = s;
return s;
}
}
/**
*
*
*
* Unique id of the facet group.
*
*
* string facet_id = 1;
*
* @return The bytes for facetId.
*/
@java.lang.Override
public com.google.protobuf.ByteString getFacetIdBytes() {
java.lang.Object ref = facetId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
facetId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int DISPLAY_NAME_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object displayName_ = "";
/**
*
*
*
* Display name of the facet. To be used by UI for facet rendering.
*
*
* string display_name = 2;
*
* @return The displayName.
*/
@java.lang.Override
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
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();
displayName_ = s;
return s;
}
}
/**
*
*
*
* Display name of the facet. To be used by UI for facet rendering.
*
*
* string display_name = 2;
*
* @return The bytes for displayName.
*/
@java.lang.Override
public com.google.protobuf.ByteString getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int BUCKETS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private java.util.List buckets_;
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
@java.lang.Override
public java.util.List getBucketsList() {
return buckets_;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
@java.lang.Override
public java.util.List extends com.google.cloud.visionai.v1.FacetBucketOrBuilder>
getBucketsOrBuilderList() {
return buckets_;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
@java.lang.Override
public int getBucketsCount() {
return buckets_.size();
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
@java.lang.Override
public com.google.cloud.visionai.v1.FacetBucket getBuckets(int index) {
return buckets_.get(index);
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
@java.lang.Override
public com.google.cloud.visionai.v1.FacetBucketOrBuilder getBucketsOrBuilder(int index) {
return buckets_.get(index);
}
public static final int BUCKET_TYPE_FIELD_NUMBER = 4;
private int bucketType_ = 0;
/**
*
*
*
* Facet bucket type.
*
*
* .google.cloud.visionai.v1.FacetBucketType bucket_type = 4;
*
* @return The enum numeric value on the wire for bucketType.
*/
@java.lang.Override
public int getBucketTypeValue() {
return bucketType_;
}
/**
*
*
*
* Facet bucket type.
*
*
* .google.cloud.visionai.v1.FacetBucketType bucket_type = 4;
*
* @return The bucketType.
*/
@java.lang.Override
public com.google.cloud.visionai.v1.FacetBucketType getBucketType() {
com.google.cloud.visionai.v1.FacetBucketType result =
com.google.cloud.visionai.v1.FacetBucketType.forNumber(bucketType_);
return result == null ? com.google.cloud.visionai.v1.FacetBucketType.UNRECOGNIZED : result;
}
public static final int FETCH_MATCHED_ANNOTATIONS_FIELD_NUMBER = 5;
private boolean fetchMatchedAnnotations_ = false;
/**
*
*
*
* If true, return query matched annotations for this facet group's selection.
* This option is only applicable for facets based on partition level
* annotations. It supports the following facet values:
* - INTEGER
* - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only)
*
*
* bool fetch_matched_annotations = 5;
*
* @return The fetchMatchedAnnotations.
*/
@java.lang.Override
public boolean getFetchMatchedAnnotations() {
return fetchMatchedAnnotations_;
}
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(facetId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, facetId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, displayName_);
}
for (int i = 0; i < buckets_.size(); i++) {
output.writeMessage(3, buckets_.get(i));
}
if (bucketType_
!= com.google.cloud.visionai.v1.FacetBucketType.FACET_BUCKET_TYPE_UNSPECIFIED.getNumber()) {
output.writeEnum(4, bucketType_);
}
if (fetchMatchedAnnotations_ != false) {
output.writeBool(5, fetchMatchedAnnotations_);
}
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(facetId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, facetId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(displayName_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, displayName_);
}
for (int i = 0; i < buckets_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(3, buckets_.get(i));
}
if (bucketType_
!= com.google.cloud.visionai.v1.FacetBucketType.FACET_BUCKET_TYPE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(4, bucketType_);
}
if (fetchMatchedAnnotations_ != false) {
size += com.google.protobuf.CodedOutputStream.computeBoolSize(5, fetchMatchedAnnotations_);
}
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.FacetGroup)) {
return super.equals(obj);
}
com.google.cloud.visionai.v1.FacetGroup other = (com.google.cloud.visionai.v1.FacetGroup) obj;
if (!getFacetId().equals(other.getFacetId())) return false;
if (!getDisplayName().equals(other.getDisplayName())) return false;
if (!getBucketsList().equals(other.getBucketsList())) return false;
if (bucketType_ != other.bucketType_) return false;
if (getFetchMatchedAnnotations() != other.getFetchMatchedAnnotations()) 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) + FACET_ID_FIELD_NUMBER;
hash = (53 * hash) + getFacetId().hashCode();
hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER;
hash = (53 * hash) + getDisplayName().hashCode();
if (getBucketsCount() > 0) {
hash = (37 * hash) + BUCKETS_FIELD_NUMBER;
hash = (53 * hash) + getBucketsList().hashCode();
}
hash = (37 * hash) + BUCKET_TYPE_FIELD_NUMBER;
hash = (53 * hash) + bucketType_;
hash = (37 * hash) + FETCH_MATCHED_ANNOTATIONS_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getFetchMatchedAnnotations());
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.visionai.v1.FacetGroup parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.FacetGroup 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.FacetGroup parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.FacetGroup 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.FacetGroup parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.visionai.v1.FacetGroup 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.FacetGroup parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.FacetGroup 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.FacetGroup parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.visionai.v1.FacetGroup 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.FacetGroup 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.FacetGroup 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.FacetGroup 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;
}
/**
*
*
*
* A group of facet buckets to be passed back and forth between backend &
* frontend.
*
*
* Protobuf type {@code google.cloud.visionai.v1.FacetGroup}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.visionai.v1.FacetGroup)
com.google.cloud.visionai.v1.FacetGroupOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_FacetGroup_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.visionai.v1.WarehouseProto
.internal_static_google_cloud_visionai_v1_FacetGroup_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.visionai.v1.FacetGroup.class,
com.google.cloud.visionai.v1.FacetGroup.Builder.class);
}
// Construct using com.google.cloud.visionai.v1.FacetGroup.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
facetId_ = "";
displayName_ = "";
if (bucketsBuilder_ == null) {
buckets_ = java.util.Collections.emptyList();
} else {
buckets_ = null;
bucketsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000004);
bucketType_ = 0;
fetchMatchedAnnotations_ = false;
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_FacetGroup_descriptor;
}
@java.lang.Override
public com.google.cloud.visionai.v1.FacetGroup getDefaultInstanceForType() {
return com.google.cloud.visionai.v1.FacetGroup.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.visionai.v1.FacetGroup build() {
com.google.cloud.visionai.v1.FacetGroup result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.visionai.v1.FacetGroup buildPartial() {
com.google.cloud.visionai.v1.FacetGroup result =
new com.google.cloud.visionai.v1.FacetGroup(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.cloud.visionai.v1.FacetGroup result) {
if (bucketsBuilder_ == null) {
if (((bitField0_ & 0x00000004) != 0)) {
buckets_ = java.util.Collections.unmodifiableList(buckets_);
bitField0_ = (bitField0_ & ~0x00000004);
}
result.buckets_ = buckets_;
} else {
result.buckets_ = bucketsBuilder_.build();
}
}
private void buildPartial0(com.google.cloud.visionai.v1.FacetGroup result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.facetId_ = facetId_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.displayName_ = displayName_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.bucketType_ = bucketType_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.fetchMatchedAnnotations_ = fetchMatchedAnnotations_;
}
}
@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.FacetGroup) {
return mergeFrom((com.google.cloud.visionai.v1.FacetGroup) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.visionai.v1.FacetGroup other) {
if (other == com.google.cloud.visionai.v1.FacetGroup.getDefaultInstance()) return this;
if (!other.getFacetId().isEmpty()) {
facetId_ = other.facetId_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getDisplayName().isEmpty()) {
displayName_ = other.displayName_;
bitField0_ |= 0x00000002;
onChanged();
}
if (bucketsBuilder_ == null) {
if (!other.buckets_.isEmpty()) {
if (buckets_.isEmpty()) {
buckets_ = other.buckets_;
bitField0_ = (bitField0_ & ~0x00000004);
} else {
ensureBucketsIsMutable();
buckets_.addAll(other.buckets_);
}
onChanged();
}
} else {
if (!other.buckets_.isEmpty()) {
if (bucketsBuilder_.isEmpty()) {
bucketsBuilder_.dispose();
bucketsBuilder_ = null;
buckets_ = other.buckets_;
bitField0_ = (bitField0_ & ~0x00000004);
bucketsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getBucketsFieldBuilder()
: null;
} else {
bucketsBuilder_.addAllMessages(other.buckets_);
}
}
}
if (other.bucketType_ != 0) {
setBucketTypeValue(other.getBucketTypeValue());
}
if (other.getFetchMatchedAnnotations() != false) {
setFetchMatchedAnnotations(other.getFetchMatchedAnnotations());
}
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:
{
facetId_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
displayName_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
com.google.cloud.visionai.v1.FacetBucket m =
input.readMessage(
com.google.cloud.visionai.v1.FacetBucket.parser(), extensionRegistry);
if (bucketsBuilder_ == null) {
ensureBucketsIsMutable();
buckets_.add(m);
} else {
bucketsBuilder_.addMessage(m);
}
break;
} // case 26
case 32:
{
bucketType_ = input.readEnum();
bitField0_ |= 0x00000008;
break;
} // case 32
case 40:
{
fetchMatchedAnnotations_ = input.readBool();
bitField0_ |= 0x00000010;
break;
} // case 40
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 facetId_ = "";
/**
*
*
*
* Unique id of the facet group.
*
*
* string facet_id = 1;
*
* @return The facetId.
*/
public java.lang.String getFacetId() {
java.lang.Object ref = facetId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
facetId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Unique id of the facet group.
*
*
* string facet_id = 1;
*
* @return The bytes for facetId.
*/
public com.google.protobuf.ByteString getFacetIdBytes() {
java.lang.Object ref = facetId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
facetId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Unique id of the facet group.
*
*
* string facet_id = 1;
*
* @param value The facetId to set.
* @return This builder for chaining.
*/
public Builder setFacetId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
facetId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Unique id of the facet group.
*
*
* string facet_id = 1;
*
* @return This builder for chaining.
*/
public Builder clearFacetId() {
facetId_ = getDefaultInstance().getFacetId();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Unique id of the facet group.
*
*
* string facet_id = 1;
*
* @param value The bytes for facetId to set.
* @return This builder for chaining.
*/
public Builder setFacetIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
facetId_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object displayName_ = "";
/**
*
*
*
* Display name of the facet. To be used by UI for facet rendering.
*
*
* string display_name = 2;
*
* @return The displayName.
*/
public java.lang.String getDisplayName() {
java.lang.Object ref = displayName_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
displayName_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Display name of the facet. To be used by UI for facet rendering.
*
*
* string display_name = 2;
*
* @return The bytes for displayName.
*/
public com.google.protobuf.ByteString getDisplayNameBytes() {
java.lang.Object ref = displayName_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
displayName_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Display name of the facet. To be used by UI for facet rendering.
*
*
* string display_name = 2;
*
* @param value The displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
displayName_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Display name of the facet. To be used by UI for facet rendering.
*
*
* string display_name = 2;
*
* @return This builder for chaining.
*/
public Builder clearDisplayName() {
displayName_ = getDefaultInstance().getDisplayName();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* Display name of the facet. To be used by UI for facet rendering.
*
*
* string display_name = 2;
*
* @param value The bytes for displayName to set.
* @return This builder for chaining.
*/
public Builder setDisplayNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
displayName_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private java.util.List buckets_ =
java.util.Collections.emptyList();
private void ensureBucketsIsMutable() {
if (!((bitField0_ & 0x00000004) != 0)) {
buckets_ = new java.util.ArrayList(buckets_);
bitField0_ |= 0x00000004;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.visionai.v1.FacetBucket,
com.google.cloud.visionai.v1.FacetBucket.Builder,
com.google.cloud.visionai.v1.FacetBucketOrBuilder>
bucketsBuilder_;
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public java.util.List getBucketsList() {
if (bucketsBuilder_ == null) {
return java.util.Collections.unmodifiableList(buckets_);
} else {
return bucketsBuilder_.getMessageList();
}
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public int getBucketsCount() {
if (bucketsBuilder_ == null) {
return buckets_.size();
} else {
return bucketsBuilder_.getCount();
}
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public com.google.cloud.visionai.v1.FacetBucket getBuckets(int index) {
if (bucketsBuilder_ == null) {
return buckets_.get(index);
} else {
return bucketsBuilder_.getMessage(index);
}
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder setBuckets(int index, com.google.cloud.visionai.v1.FacetBucket value) {
if (bucketsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureBucketsIsMutable();
buckets_.set(index, value);
onChanged();
} else {
bucketsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder setBuckets(
int index, com.google.cloud.visionai.v1.FacetBucket.Builder builderForValue) {
if (bucketsBuilder_ == null) {
ensureBucketsIsMutable();
buckets_.set(index, builderForValue.build());
onChanged();
} else {
bucketsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder addBuckets(com.google.cloud.visionai.v1.FacetBucket value) {
if (bucketsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureBucketsIsMutable();
buckets_.add(value);
onChanged();
} else {
bucketsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder addBuckets(int index, com.google.cloud.visionai.v1.FacetBucket value) {
if (bucketsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureBucketsIsMutable();
buckets_.add(index, value);
onChanged();
} else {
bucketsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder addBuckets(com.google.cloud.visionai.v1.FacetBucket.Builder builderForValue) {
if (bucketsBuilder_ == null) {
ensureBucketsIsMutable();
buckets_.add(builderForValue.build());
onChanged();
} else {
bucketsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder addBuckets(
int index, com.google.cloud.visionai.v1.FacetBucket.Builder builderForValue) {
if (bucketsBuilder_ == null) {
ensureBucketsIsMutable();
buckets_.add(index, builderForValue.build());
onChanged();
} else {
bucketsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder addAllBuckets(
java.lang.Iterable extends com.google.cloud.visionai.v1.FacetBucket> values) {
if (bucketsBuilder_ == null) {
ensureBucketsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, buckets_);
onChanged();
} else {
bucketsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder clearBuckets() {
if (bucketsBuilder_ == null) {
buckets_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
} else {
bucketsBuilder_.clear();
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public Builder removeBuckets(int index) {
if (bucketsBuilder_ == null) {
ensureBucketsIsMutable();
buckets_.remove(index);
onChanged();
} else {
bucketsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public com.google.cloud.visionai.v1.FacetBucket.Builder getBucketsBuilder(int index) {
return getBucketsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public com.google.cloud.visionai.v1.FacetBucketOrBuilder getBucketsOrBuilder(int index) {
if (bucketsBuilder_ == null) {
return buckets_.get(index);
} else {
return bucketsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public java.util.List extends com.google.cloud.visionai.v1.FacetBucketOrBuilder>
getBucketsOrBuilderList() {
if (bucketsBuilder_ != null) {
return bucketsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(buckets_);
}
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public com.google.cloud.visionai.v1.FacetBucket.Builder addBucketsBuilder() {
return getBucketsFieldBuilder()
.addBuilder(com.google.cloud.visionai.v1.FacetBucket.getDefaultInstance());
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public com.google.cloud.visionai.v1.FacetBucket.Builder addBucketsBuilder(int index) {
return getBucketsFieldBuilder()
.addBuilder(index, com.google.cloud.visionai.v1.FacetBucket.getDefaultInstance());
}
/**
*
*
*
* Buckets associated with the facet. E.g. for "Team" facet, the bucket
* can be 49ers, patriots, etc.
*
*
* repeated .google.cloud.visionai.v1.FacetBucket buckets = 3;
*/
public java.util.List
getBucketsBuilderList() {
return getBucketsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.visionai.v1.FacetBucket,
com.google.cloud.visionai.v1.FacetBucket.Builder,
com.google.cloud.visionai.v1.FacetBucketOrBuilder>
getBucketsFieldBuilder() {
if (bucketsBuilder_ == null) {
bucketsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.visionai.v1.FacetBucket,
com.google.cloud.visionai.v1.FacetBucket.Builder,
com.google.cloud.visionai.v1.FacetBucketOrBuilder>(
buckets_, ((bitField0_ & 0x00000004) != 0), getParentForChildren(), isClean());
buckets_ = null;
}
return bucketsBuilder_;
}
private int bucketType_ = 0;
/**
*
*
*
* Facet bucket type.
*
*
* .google.cloud.visionai.v1.FacetBucketType bucket_type = 4;
*
* @return The enum numeric value on the wire for bucketType.
*/
@java.lang.Override
public int getBucketTypeValue() {
return bucketType_;
}
/**
*
*
*
* Facet bucket type.
*
*
* .google.cloud.visionai.v1.FacetBucketType bucket_type = 4;
*
* @param value The enum numeric value on the wire for bucketType to set.
* @return This builder for chaining.
*/
public Builder setBucketTypeValue(int value) {
bucketType_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* Facet bucket type.
*
*
* .google.cloud.visionai.v1.FacetBucketType bucket_type = 4;
*
* @return The bucketType.
*/
@java.lang.Override
public com.google.cloud.visionai.v1.FacetBucketType getBucketType() {
com.google.cloud.visionai.v1.FacetBucketType result =
com.google.cloud.visionai.v1.FacetBucketType.forNumber(bucketType_);
return result == null ? com.google.cloud.visionai.v1.FacetBucketType.UNRECOGNIZED : result;
}
/**
*
*
*
* Facet bucket type.
*
*
* .google.cloud.visionai.v1.FacetBucketType bucket_type = 4;
*
* @param value The bucketType to set.
* @return This builder for chaining.
*/
public Builder setBucketType(com.google.cloud.visionai.v1.FacetBucketType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000008;
bucketType_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* Facet bucket type.
*
*
* .google.cloud.visionai.v1.FacetBucketType bucket_type = 4;
*
* @return This builder for chaining.
*/
public Builder clearBucketType() {
bitField0_ = (bitField0_ & ~0x00000008);
bucketType_ = 0;
onChanged();
return this;
}
private boolean fetchMatchedAnnotations_;
/**
*
*
*
* If true, return query matched annotations for this facet group's selection.
* This option is only applicable for facets based on partition level
* annotations. It supports the following facet values:
* - INTEGER
* - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only)
*
*
* bool fetch_matched_annotations = 5;
*
* @return The fetchMatchedAnnotations.
*/
@java.lang.Override
public boolean getFetchMatchedAnnotations() {
return fetchMatchedAnnotations_;
}
/**
*
*
*
* If true, return query matched annotations for this facet group's selection.
* This option is only applicable for facets based on partition level
* annotations. It supports the following facet values:
* - INTEGER
* - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only)
*
*
* bool fetch_matched_annotations = 5;
*
* @param value The fetchMatchedAnnotations to set.
* @return This builder for chaining.
*/
public Builder setFetchMatchedAnnotations(boolean value) {
fetchMatchedAnnotations_ = value;
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* If true, return query matched annotations for this facet group's selection.
* This option is only applicable for facets based on partition level
* annotations. It supports the following facet values:
* - INTEGER
* - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only)
*
*
* bool fetch_matched_annotations = 5;
*
* @return This builder for chaining.
*/
public Builder clearFetchMatchedAnnotations() {
bitField0_ = (bitField0_ & ~0x00000010);
fetchMatchedAnnotations_ = false;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.visionai.v1.FacetGroup)
}
// @@protoc_insertion_point(class_scope:google.cloud.visionai.v1.FacetGroup)
private static final com.google.cloud.visionai.v1.FacetGroup DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.visionai.v1.FacetGroup();
}
public static com.google.cloud.visionai.v1.FacetGroup getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public FacetGroup 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.FacetGroup getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy