Class Any.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
All Implemented Interfaces:
AnyOrBuilder, Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, MessageOrBuilder, Cloneable
Enclosing class:
Any

public static final class Any.Builder extends GeneratedMessage.Builder<Any.Builder> implements AnyOrBuilder
Protobuf type google.protobuf.Any
  • Method Details

    • getDescriptor

      public static final Descriptors.Descriptor getDescriptor()
    • internalGetFieldAccessorTable

      protected GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()
      Description copied from class: GeneratedMessage.Builder
      Get the FieldAccessorTable for this type. We can't have the message class pass this in to the constructor because of bootstrapping trouble with DescriptorProtos.
      Specified by:
      internalGetFieldAccessorTable in class GeneratedMessage.Builder<Any.Builder>
    • clear

      public Any.Builder clear()
      Description copied from class: GeneratedMessage.Builder
      Called by the initialization and clear code paths to allow subclasses to reset any of their builtin fields back to the initial values.
      Specified by:
      clear in interface Message.Builder
      Specified by:
      clear in interface com.google.protobuf.MessageLite.Builder
      Overrides:
      clear in class GeneratedMessage.Builder<Any.Builder>
    • getDescriptorForType

      public Descriptors.Descriptor getDescriptorForType()
      Description copied from interface: Message.Builder
      Get the message's type's descriptor. See MessageOrBuilder.getDescriptorForType().
      Specified by:
      getDescriptorForType in interface Message.Builder
      Specified by:
      getDescriptorForType in interface MessageOrBuilder
      Overrides:
      getDescriptorForType in class GeneratedMessage.Builder<Any.Builder>
    • getDefaultInstanceForType

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

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

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

      public Any.Builder mergeFrom(Message other)
      Description copied from interface: Message.Builder
      Merge other into the message being built. other must have the exact same type as this (i.e. getDescriptorForType() == other.getDescriptorForType()).

      Merging occurs as follows. For each field:
      * For singular primitive fields, if the field is set in other, then other's value overwrites the value in this message.
      * For singular message fields, if the field is set in other, it is merged into the corresponding sub-message of this message using the same merging rules.
      * For repeated fields, the elements in other are concatenated with the elements in this message.
      * For oneof groups, if the other message has one of the fields set, the group of this message is cleared and replaced by the field of the other message, so that the oneof constraint is preserved.

      This is equivalent to the Message::MergeFrom method in C++.

      Specified by:
      mergeFrom in interface Message.Builder
      Overrides:
      mergeFrom in class AbstractMessage.Builder<Any.Builder>
    • mergeFrom

      public Any.Builder mergeFrom(Any other)
    • isInitialized

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

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

      public String getTypeUrl()
      string type_url = 1 [json_name = "typeUrl"];
      Specified by:
      getTypeUrl in interface AnyOrBuilder
      Returns:
      The typeUrl.
    • getTypeUrlBytes

      public com.google.protobuf.ByteString getTypeUrlBytes()
      string type_url = 1 [json_name = "typeUrl"];
      Specified by:
      getTypeUrlBytes in interface AnyOrBuilder
      Returns:
      The bytes for typeUrl.
    • setTypeUrl

      public Any.Builder setTypeUrl(String value)
      string type_url = 1 [json_name = "typeUrl"];
      Parameters:
      value - The typeUrl to set.
      Returns:
      This builder for chaining.
    • clearTypeUrl

      public Any.Builder clearTypeUrl()
      string type_url = 1 [json_name = "typeUrl"];
      Returns:
      This builder for chaining.
    • setTypeUrlBytes

      public Any.Builder setTypeUrlBytes(com.google.protobuf.ByteString value)
      string type_url = 1 [json_name = "typeUrl"];
      Parameters:
      value - The bytes for typeUrl to set.
      Returns:
      This builder for chaining.
    • getValue

      public com.google.protobuf.ByteString getValue()
      bytes value = 2 [json_name = "value"];
      Specified by:
      getValue in interface AnyOrBuilder
      Returns:
      The value.
    • setValue

      public Any.Builder setValue(com.google.protobuf.ByteString value)
      bytes value = 2 [json_name = "value"];
      Parameters:
      value - The value to set.
      Returns:
      This builder for chaining.
    • clearValue

      public Any.Builder clearValue()
      bytes value = 2 [json_name = "value"];
      Returns:
      This builder for chaining.