/** * * * <pre> * Key-value pairs that can be attached to a product. At query time, * constraints can be specified based on the product_labels. * Note that integer values can be provided as strings, e.g. "1199". Only * strings with integer values can match a range-based restriction which is * to be supported soon. * Multiple values can be assigned to the same key. One product may have up to * 100 product_labels. * </pre> * * <code>repeated .google.cloud.vision.v1.Product.KeyValue product_labels = 5;</code> */ public Builder addProductLabels( com.google.cloud.vision.v1.Product.KeyValue.Builder builderForValue) { if (productLabelsBuilder_ == null) { ensureProductLabelsIsMutable(); productLabels_.add(builderForValue.build()); onChanged(); } else { productLabelsBuilder_.addMessage(builderForValue.build()); } return this; } /**
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.vision.v1.Product.KeyValue parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.vision.v1.Product.KeyValue) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
public Builder mergeFrom(com.google.cloud.vision.v1.Product.KeyValue other) { if (other == com.google.cloud.vision.v1.Product.KeyValue.getDefaultInstance()) return this; if (!other.getKey().isEmpty()) { key_ = other.key_; onChanged(); } if (!other.getValue().isEmpty()) { value_ = other.value_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * * * <pre> * Key-value pairs that can be attached to a product. At query time, * constraints can be specified based on the product_labels. * Note that integer values can be provided as strings, e.g. "1199". Only * strings with integer values can match a range-based restriction which is * to be supported soon. * Multiple values can be assigned to the same key. One product may have up to * 100 product_labels. * </pre> * * <code>repeated .google.cloud.vision.v1.Product.KeyValue product_labels = 5;</code> */ public Builder addProductLabels( com.google.cloud.vision.v1.Product.KeyValue.Builder builderForValue) { if (productLabelsBuilder_ == null) { ensureProductLabelsIsMutable(); productLabels_.add(builderForValue.build()); onChanged(); } else { productLabelsBuilder_.addMessage(builderForValue.build()); } return this; } /**
/** * * * <pre> * Key-value pairs that can be attached to a product. At query time, * constraints can be specified based on the product_labels. * Note that integer values can be provided as strings, e.g. "1199". Only * strings with integer values can match a range-based restriction which is * to be supported soon. * Multiple values can be assigned to the same key. One product may have up to * 100 product_labels. * </pre> * * <code>repeated .google.cloud.vision.v1.Product.KeyValue product_labels = 5;</code> */ public Builder addProductLabels( int index, com.google.cloud.vision.v1.Product.KeyValue.Builder builderForValue) { if (productLabelsBuilder_ == null) { ensureProductLabelsIsMutable(); productLabels_.add(index, builderForValue.build()); onChanged(); } else { productLabelsBuilder_.addMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * Key-value pairs that can be attached to a product. At query time, * constraints can be specified based on the product_labels. * Note that integer values can be provided as strings, e.g. "1199". Only * strings with integer values can match a range-based restriction which is * to be supported soon. * Multiple values can be assigned to the same key. One product may have up to * 100 product_labels. * </pre> * * <code>repeated .google.cloud.vision.v1.Product.KeyValue product_labels = 5;</code> */ public Builder setProductLabels( int index, com.google.cloud.vision.v1.Product.KeyValue.Builder builderForValue) { if (productLabelsBuilder_ == null) { ensureProductLabelsIsMutable(); productLabels_.set(index, builderForValue.build()); onChanged(); } else { productLabelsBuilder_.setMessage(index, builderForValue.build()); } return this; } /**
/** * * * <pre> * The value of the label attached to the product. Cannot be empty and * cannot exceed 128 bytes. * </pre> * * <code>string value = 2;</code> */ public Builder setValue(java.lang.String value) { if (value == null) { throw new NullPointerException(); } value_ = value; onChanged(); return this; } /**
/** * * * <pre> * The key of the label attached to the product. Cannot be empty and cannot * exceed 128 bytes. * </pre> * * <code>string key = 1;</code> */ public Builder setKey(java.lang.String value) { if (value == null) { throw new NullPointerException(); } key_ = value; onChanged(); return this; } /**
/** * * * <pre> * The value of the label attached to the product. Cannot be empty and * cannot exceed 128 bytes. * </pre> * * <code>string value = 2;</code> */ public Builder setValueBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); value_ = value; onChanged(); return this; }
/** * * * <pre> * The key of the label attached to the product. Cannot be empty and cannot * exceed 128 bytes. * </pre> * * <code>string key = 1;</code> */ public Builder setKeyBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } checkByteStringIsUtf8(value); key_ = value; onChanged(); return this; }
@java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.vision.v1.Product.KeyValue parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.vision.v1.Product.KeyValue) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; }
/** * * * <pre> * The value of the label attached to the product. Cannot be empty and * cannot exceed 128 bytes. * </pre> * * <code>string value = 2;</code> */ public Builder clearValue() { value_ = getDefaultInstance().getValue(); onChanged(); return this; } /**
/** * * * <pre> * The key of the label attached to the product. Cannot be empty and cannot * exceed 128 bytes. * </pre> * * <code>string key = 1;</code> */ public Builder clearKey() { key_ = getDefaultInstance().getKey(); onChanged(); return this; } /**
public static Builder newBuilder(com.google.cloud.vision.v1.Product.KeyValue prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); }
private Builder() { maybeForceBuilderInitialization(); }
public Builder mergeFrom(com.google.cloud.vision.v1.Product.KeyValue other) { if (other == com.google.cloud.vision.v1.Product.KeyValue.getDefaultInstance()) return this; if (!other.getKey().isEmpty()) { key_ = other.key_; onChanged(); } if (!other.getValue().isEmpty()) { value_ = other.value_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); }
@java.lang.Override protected Builder newBuilderForType( com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /**
@java.lang.Override public com.google.cloud.vision.v1.Product.KeyValue buildPartial() { com.google.cloud.vision.v1.Product.KeyValue result = new com.google.cloud.vision.v1.Product.KeyValue(this); result.key_ = key_; result.value_ = value_; onBuilt(); return result; }