Class CloudEvent.Builder

java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
com.google.cloud.eventarc.publishing.v1.CloudEvent.Builder
All Implemented Interfaces:
CloudEventOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
Enclosing class:
CloudEvent

public static final class CloudEvent.Builder extends com.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder> implements CloudEventOrBuilder
 CloudEvent represents a vendor-neutral specification for defining the format
 of event data.
 
Protobuf type google.cloud.eventarc.publishing.v1.CloudEvent
  • Method Details

    • getDescriptor

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

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
      Overrides:
      internalGetMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
    • internalGetMutableMapFieldReflection

      protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
      Overrides:
      internalGetMutableMapFieldReflection in class com.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
    • internalGetFieldAccessorTable

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

      public CloudEvent.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<CloudEvent.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<CloudEvent.Builder>
    • getDefaultInstanceForType

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

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

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

      public CloudEvent.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<CloudEvent.Builder>
    • mergeFrom

      public CloudEvent.Builder mergeFrom(CloudEvent other)
    • isInitialized

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

      public CloudEvent.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<CloudEvent.Builder>
      Throws:
      IOException
    • getDataCase

      public CloudEvent.DataCase getDataCase()
      Specified by:
      getDataCase in interface CloudEventOrBuilder
    • clearData

      public CloudEvent.Builder clearData()
    • getId

      public String getId()
       Required. Identifies the event. Producers MUST ensure that source + id is
       unique for each distinct event.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getId in interface CloudEventOrBuilder
      Returns:
      The id.
    • getIdBytes

      public com.google.protobuf.ByteString getIdBytes()
       Required. Identifies the event. Producers MUST ensure that source + id is
       unique for each distinct event.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getIdBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for id.
    • setId

      public CloudEvent.Builder setId(String value)
       Required. Identifies the event. Producers MUST ensure that source + id is
       unique for each distinct event.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The id to set.
      Returns:
      This builder for chaining.
    • clearId

      public CloudEvent.Builder clearId()
       Required. Identifies the event. Producers MUST ensure that source + id is
       unique for each distinct event.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setIdBytes

      public CloudEvent.Builder setIdBytes(com.google.protobuf.ByteString value)
       Required. Identifies the event. Producers MUST ensure that source + id is
       unique for each distinct event.
       
      string id = 1 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for id to set.
      Returns:
      This builder for chaining.
    • getSource

      public String getSource()
       Required. Identifies the context in which an event happened.
       URI-reference
       
      string source = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSource in interface CloudEventOrBuilder
      Returns:
      The source.
    • getSourceBytes

      public com.google.protobuf.ByteString getSourceBytes()
       Required. Identifies the context in which an event happened.
       URI-reference
       
      string source = 2 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSourceBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for source.
    • setSource

      public CloudEvent.Builder setSource(String value)
       Required. Identifies the context in which an event happened.
       URI-reference
       
      string source = 2 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The source to set.
      Returns:
      This builder for chaining.
    • clearSource

      public CloudEvent.Builder clearSource()
       Required. Identifies the context in which an event happened.
       URI-reference
       
      string source = 2 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setSourceBytes

      public CloudEvent.Builder setSourceBytes(com.google.protobuf.ByteString value)
       Required. Identifies the context in which an event happened.
       URI-reference
       
      string source = 2 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for source to set.
      Returns:
      This builder for chaining.
    • getSpecVersion

      public String getSpecVersion()
       Required. The version of the CloudEvents specification which the event
       uses.
       
      string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSpecVersion in interface CloudEventOrBuilder
      Returns:
      The specVersion.
    • getSpecVersionBytes

      public com.google.protobuf.ByteString getSpecVersionBytes()
       Required. The version of the CloudEvents specification which the event
       uses.
       
      string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getSpecVersionBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for specVersion.
    • setSpecVersion

      public CloudEvent.Builder setSpecVersion(String value)
       Required. The version of the CloudEvents specification which the event
       uses.
       
      string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The specVersion to set.
      Returns:
      This builder for chaining.
    • clearSpecVersion

      public CloudEvent.Builder clearSpecVersion()
       Required. The version of the CloudEvents specification which the event
       uses.
       
      string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setSpecVersionBytes

      public CloudEvent.Builder setSpecVersionBytes(com.google.protobuf.ByteString value)
       Required. The version of the CloudEvents specification which the event
       uses.
       
      string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for specVersion to set.
      Returns:
      This builder for chaining.
    • getType

      public String getType()
       Required. This attribute contains a value describing the type of event
       related to the originating occurrence.
       
      string type = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getType in interface CloudEventOrBuilder
      Returns:
      The type.
    • getTypeBytes

      public com.google.protobuf.ByteString getTypeBytes()
       Required. This attribute contains a value describing the type of event
       related to the originating occurrence.
       
      string type = 4 [(.google.api.field_behavior) = REQUIRED];
      Specified by:
      getTypeBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for type.
    • setType

      public CloudEvent.Builder setType(String value)
       Required. This attribute contains a value describing the type of event
       related to the originating occurrence.
       
      string type = 4 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The type to set.
      Returns:
      This builder for chaining.
    • clearType

      public CloudEvent.Builder clearType()
       Required. This attribute contains a value describing the type of event
       related to the originating occurrence.
       
      string type = 4 [(.google.api.field_behavior) = REQUIRED];
      Returns:
      This builder for chaining.
    • setTypeBytes

      public CloudEvent.Builder setTypeBytes(com.google.protobuf.ByteString value)
       Required. This attribute contains a value describing the type of event
       related to the originating occurrence.
       
      string type = 4 [(.google.api.field_behavior) = REQUIRED];
      Parameters:
      value - The bytes for type to set.
      Returns:
      This builder for chaining.
    • getAttributesCount

      public int getAttributesCount()
      Description copied from interface: CloudEventOrBuilder
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesCount in interface CloudEventOrBuilder
    • containsAttributes

      public boolean containsAttributes(String key)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      containsAttributes in interface CloudEventOrBuilder
    • getAttributes

      Deprecated.
      Use getAttributesMap() instead.
      Specified by:
      getAttributes in interface CloudEventOrBuilder
    • getAttributesMap

      public Map<String,CloudEvent.CloudEventAttributeValue> getAttributesMap()
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesMap in interface CloudEventOrBuilder
    • getAttributesOrDefault

      public CloudEvent.CloudEventAttributeValue getAttributesOrDefault(String key, CloudEvent.CloudEventAttributeValue defaultValue)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrDefault in interface CloudEventOrBuilder
    • getAttributesOrThrow

      public CloudEvent.CloudEventAttributeValue getAttributesOrThrow(String key)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getAttributesOrThrow in interface CloudEventOrBuilder
    • clearAttributes

      public CloudEvent.Builder clearAttributes()
    • removeAttributes

      public CloudEvent.Builder removeAttributes(String key)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
    • getMutableAttributes

      Deprecated.
      Use alternate mutation accessors instead.
    • putAttributes

       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
    • putAllAttributes

       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
    • putAttributesBuilderIfAbsent

      public CloudEvent.CloudEventAttributeValue.Builder putAttributesBuilderIfAbsent(String key)
       Optional. Used for Optional & Extension Attributes
       
      map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
    • hasBinaryData

      public boolean hasBinaryData()
       Optional. Binary data.
       
      bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasBinaryData in interface CloudEventOrBuilder
      Returns:
      Whether the binaryData field is set.
    • getBinaryData

      public com.google.protobuf.ByteString getBinaryData()
       Optional. Binary data.
       
      bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getBinaryData in interface CloudEventOrBuilder
      Returns:
      The binaryData.
    • setBinaryData

      public CloudEvent.Builder setBinaryData(com.google.protobuf.ByteString value)
       Optional. Binary data.
       
      bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The binaryData to set.
      Returns:
      This builder for chaining.
    • clearBinaryData

      public CloudEvent.Builder clearBinaryData()
       Optional. Binary data.
       
      bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • hasTextData

      public boolean hasTextData()
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasTextData in interface CloudEventOrBuilder
      Returns:
      Whether the textData field is set.
    • getTextData

      public String getTextData()
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getTextData in interface CloudEventOrBuilder
      Returns:
      The textData.
    • getTextDataBytes

      public com.google.protobuf.ByteString getTextDataBytes()
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getTextDataBytes in interface CloudEventOrBuilder
      Returns:
      The bytes for textData.
    • setTextData

      public CloudEvent.Builder setTextData(String value)
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The textData to set.
      Returns:
      This builder for chaining.
    • clearTextData

      public CloudEvent.Builder clearTextData()
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Returns:
      This builder for chaining.
    • setTextDataBytes

      public CloudEvent.Builder setTextDataBytes(com.google.protobuf.ByteString value)
       Optional. Text data.
       
      string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
      Parameters:
      value - The bytes for textData to set.
      Returns:
      This builder for chaining.
    • hasProtoData

      public boolean hasProtoData()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      hasProtoData in interface CloudEventOrBuilder
      Returns:
      Whether the protoData field is set.
    • getProtoData

      public com.google.protobuf.Any getProtoData()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getProtoData in interface CloudEventOrBuilder
      Returns:
      The protoData.
    • setProtoData

      public CloudEvent.Builder setProtoData(com.google.protobuf.Any value)
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
    • setProtoData

      public CloudEvent.Builder setProtoData(com.google.protobuf.Any.Builder builderForValue)
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
    • mergeProtoData

      public CloudEvent.Builder mergeProtoData(com.google.protobuf.Any value)
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
    • clearProtoData

      public CloudEvent.Builder clearProtoData()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
    • getProtoDataBuilder

      public com.google.protobuf.Any.Builder getProtoDataBuilder()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
    • getProtoDataOrBuilder

      public com.google.protobuf.AnyOrBuilder getProtoDataOrBuilder()
       Optional. Proto data.
      
       NOTE: The `protoData` field only functions as expected when the payload
       is specifically a `CloudEvent` message type, and can't be used for
       arbitrary protocol buffer messages. For any other protocol buffer type,
       you must serialize your proto message into bytes, and use the
       `binaryData` field instead.
       
      .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
      Specified by:
      getProtoDataOrBuilder in interface CloudEventOrBuilder