Class CustomAttribute.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CustomAttribute.Builder>
com.google.cloud.discoveryengine.v1beta.CustomAttribute.Builder
All Implemented Interfaces:
CustomAttributeOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
CustomAttribute

public static final class CustomAttribute.Builder extends com.google.protobuf.GeneratedMessage.Builder<CustomAttribute.Builder> implements CustomAttributeOrBuilder
 A custom attribute that is not explicitly modeled in a resource, e.g.
 [UserEvent][google.cloud.discoveryengine.v1beta.UserEvent].
 
Protobuf type google.cloud.discoveryengine.v1beta.CustomAttribute
  • Method Summary

    Modifier and Type
    Method
    Description
    addAllNumbers(Iterable<? extends Double> values)
    The numerical values of this custom attribute.
    The textual values of this custom attribute.
    addNumbers(double value)
    The numerical values of this custom attribute.
    addText(String value)
    The textual values of this custom attribute.
    addTextBytes(com.google.protobuf.ByteString value)
    The textual values of this custom attribute.
     
     
     
    The numerical values of this custom attribute.
    The textual values of this custom attribute.
     
    static final com.google.protobuf.Descriptors.Descriptor
     
    com.google.protobuf.Descriptors.Descriptor
     
    double
    getNumbers(int index)
    The numerical values of this custom attribute.
    int
    The numerical values of this custom attribute.
    The numerical values of this custom attribute.
    getText(int index)
    The textual values of this custom attribute.
    com.google.protobuf.ByteString
    getTextBytes(int index)
    The textual values of this custom attribute.
    int
    The textual values of this custom attribute.
    com.google.protobuf.ProtocolStringList
    The textual values of this custom attribute.
    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
     
    final boolean
     
     
    mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
     
    mergeFrom(com.google.protobuf.Message other)
     
    setNumbers(int index, double value)
    The numerical values of this custom attribute.
    setText(int index, String value)
    The textual values of this custom attribute.

    Methods inherited from class com.google.protobuf.GeneratedMessage.Builder

    addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3

    Methods inherited from class com.google.protobuf.AbstractMessage.Builder

    findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toString

    Methods inherited from class com.google.protobuf.AbstractMessageLite.Builder

    addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageException

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.google.protobuf.Message.Builder

    mergeDelimitedFrom, mergeDelimitedFrom

    Methods inherited from interface com.google.protobuf.MessageLite.Builder

    mergeFrom

    Methods inherited from interface com.google.protobuf.MessageOrBuilder

    findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
  • Method Details

    • getDescriptor

      public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Specified by:
      internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessage.Builder<CustomAttribute.Builder>
    • clear

      public CustomAttribute.Builder clear()
      Specified by:
      clear in interface com.google.protobuf.Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class com.google.protobuf.GeneratedMessage.Builder<CustomAttribute.Builder>
    • getDescriptorForType

      public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
      Specified by:
      getDescriptorForType in interface com.google.protobuf.Message.Builder
      Specified by:
      getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
      Overrides:
      getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<CustomAttribute.Builder>
    • getDefaultInstanceForType

      public CustomAttribute getDefaultInstanceForType()
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
      Specified by:
      getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
    • build

      public CustomAttribute build()
      Specified by:
      build in interface com.google.protobuf.Message.Builder
      Specified by:
      build in interface com.google.protobuf.MessageLite.Builder
    • buildPartial

      public CustomAttribute buildPartial()
      Specified by:
      buildPartial in interface com.google.protobuf.Message.Builder
      Specified by:
      buildPartial in interface com.google.protobuf.MessageLite.Builder
    • mergeFrom

      public CustomAttribute.Builder mergeFrom(com.google.protobuf.Message other)
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CustomAttribute.Builder>
    • mergeFrom

      public CustomAttribute.Builder mergeFrom(CustomAttribute other)
    • isInitialized

      public final boolean isInitialized()
      Specified by:
      isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
      Overrides:
      isInitialized in class com.google.protobuf.GeneratedMessage.Builder<CustomAttribute.Builder>
    • mergeFrom

      public CustomAttribute.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
      Specified by:
      mergeFrom in interface com.google.protobuf.Message.Builder
      Specified by:
      mergeFrom in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      mergeFrom in class com.google.protobuf.AbstractMessage.Builder<CustomAttribute.Builder>
      Throws:
      IOException
    • getTextList

      public com.google.protobuf.ProtocolStringList getTextList()
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Specified by:
      getTextList in interface CustomAttributeOrBuilder
      Returns:
      A list containing the text.
    • getTextCount

      public int getTextCount()
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Specified by:
      getTextCount in interface CustomAttributeOrBuilder
      Returns:
      The count of text.
    • getText

      public String getText(int index)
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Specified by:
      getText in interface CustomAttributeOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The text at the given index.
    • getTextBytes

      public com.google.protobuf.ByteString getTextBytes(int index)
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Specified by:
      getTextBytes in interface CustomAttributeOrBuilder
      Parameters:
      index - The index of the value to return.
      Returns:
      The bytes of the text at the given index.
    • setText

      public CustomAttribute.Builder setText(int index, String value)
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Parameters:
      index - The index to set the value at.
      value - The text to set.
      Returns:
      This builder for chaining.
    • addText

      public CustomAttribute.Builder addText(String value)
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Parameters:
      value - The text to add.
      Returns:
      This builder for chaining.
    • addAllText

      public CustomAttribute.Builder addAllText(Iterable<String> values)
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Parameters:
      values - The text to add.
      Returns:
      This builder for chaining.
    • clearText

      public CustomAttribute.Builder clearText()
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Returns:
      This builder for chaining.
    • addTextBytes

      public CustomAttribute.Builder addTextBytes(com.google.protobuf.ByteString value)
       The textual values of this custom attribute. For example, `["yellow",
       "green"]` when the key is "color".
      
       Empty string is not allowed. Otherwise, an `INVALID_ARGUMENT` error is
       returned.
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated string text = 1;
      Parameters:
      value - The bytes of the text to add.
      Returns:
      This builder for chaining.
    • getNumbersList

      public List<Double> getNumbersList()
       The numerical values of this custom attribute. For example, `[2.3, 15.4]`
       when the key is "lengths_cm".
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated double numbers = 2;
      Specified by:
      getNumbersList in interface CustomAttributeOrBuilder
      Returns:
      A list containing the numbers.
    • getNumbersCount

      public int getNumbersCount()
       The numerical values of this custom attribute. For example, `[2.3, 15.4]`
       when the key is "lengths_cm".
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated double numbers = 2;
      Specified by:
      getNumbersCount in interface CustomAttributeOrBuilder
      Returns:
      The count of numbers.
    • getNumbers

      public double getNumbers(int index)
       The numerical values of this custom attribute. For example, `[2.3, 15.4]`
       when the key is "lengths_cm".
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated double numbers = 2;
      Specified by:
      getNumbers in interface CustomAttributeOrBuilder
      Parameters:
      index - The index of the element to return.
      Returns:
      The numbers at the given index.
    • setNumbers

      public CustomAttribute.Builder setNumbers(int index, double value)
       The numerical values of this custom attribute. For example, `[2.3, 15.4]`
       when the key is "lengths_cm".
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated double numbers = 2;
      Parameters:
      index - The index to set the value at.
      value - The numbers to set.
      Returns:
      This builder for chaining.
    • addNumbers

      public CustomAttribute.Builder addNumbers(double value)
       The numerical values of this custom attribute. For example, `[2.3, 15.4]`
       when the key is "lengths_cm".
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated double numbers = 2;
      Parameters:
      value - The numbers to add.
      Returns:
      This builder for chaining.
    • addAllNumbers

      public CustomAttribute.Builder addAllNumbers(Iterable<? extends Double> values)
       The numerical values of this custom attribute. For example, `[2.3, 15.4]`
       when the key is "lengths_cm".
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated double numbers = 2;
      Parameters:
      values - The numbers to add.
      Returns:
      This builder for chaining.
    • clearNumbers

      public CustomAttribute.Builder clearNumbers()
       The numerical values of this custom attribute. For example, `[2.3, 15.4]`
       when the key is "lengths_cm".
      
       Exactly one of
       [CustomAttribute.text][google.cloud.discoveryengine.v1beta.CustomAttribute.text]
       or
       [CustomAttribute.numbers][google.cloud.discoveryengine.v1beta.CustomAttribute.numbers]
       should be set. Otherwise, an `INVALID_ARGUMENT` error is returned.
       
      repeated double numbers = 2;
      Returns:
      This builder for chaining.