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 Summary
Modifier and TypeMethodDescriptionbuild()clear()Optional.clearId()Required.Optional.Required.Required.Optional.Required.booleancontainsAttributes(String key) Optional.Deprecated.intOptional.Optional.getAttributesOrDefault(String key, CloudEvent.CloudEventAttributeValue defaultValue) Optional.Optional.com.google.protobuf.ByteStringOptional.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorgetId()Required.com.google.protobuf.ByteStringRequired.Deprecated.com.google.protobuf.AnyOptional.com.google.protobuf.Any.BuilderOptional.com.google.protobuf.AnyOrBuilderOptional.Required.com.google.protobuf.ByteStringRequired.Required.com.google.protobuf.ByteStringRequired.Optional.com.google.protobuf.ByteStringOptional.getType()Required.com.google.protobuf.ByteStringRequired.booleanOptional.booleanOptional.booleanOptional.protected com.google.protobuf.GeneratedMessage.FieldAccessorTableprotected com.google.protobuf.MapFieldReflectionAccessorinternalGetMapFieldReflection(int number) protected com.google.protobuf.MapFieldReflectionAccessorinternalGetMutableMapFieldReflection(int number) final booleanmergeFrom(CloudEvent other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeProtoData(com.google.protobuf.Any value) Optional.Optional.putAttributes(String key, CloudEvent.CloudEventAttributeValue value) Optional.Optional.removeAttributes(String key) Optional.setBinaryData(com.google.protobuf.ByteString value) Optional.Required.setIdBytes(com.google.protobuf.ByteString value) Required.setProtoData(com.google.protobuf.Any value) Optional.setProtoData(com.google.protobuf.Any.Builder builderForValue) Optional.Required.setSourceBytes(com.google.protobuf.ByteString value) Required.setSpecVersion(String value) Required.setSpecVersionBytes(com.google.protobuf.ByteString value) Required.setTextData(String value) Optional.setTextDataBytes(com.google.protobuf.ByteString value) Optional.Required.setTypeBytes(com.google.protobuf.ByteString value) Required.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, internalGetMutableMapField, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods 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() -
internalGetMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(int number) - Overrides:
internalGetMapFieldReflectionin classcom.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
-
internalGetMutableMapFieldReflection
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number) - Overrides:
internalGetMutableMapFieldReflectionin classcom.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<CloudEvent.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CloudEvent.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.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:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<CloudEvent.Builder>- Throws:
IOException
-
getDataCase
- Specified by:
getDataCasein interfaceCloudEventOrBuilder
-
clearData
-
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:
getIdin interfaceCloudEventOrBuilder- 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:
getIdBytesin interfaceCloudEventOrBuilder- Returns:
- The bytes for id.
-
setId
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
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
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
Required. Identifies the context in which an event happened. URI-reference
string source = 2 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getSourcein interfaceCloudEventOrBuilder- 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:
getSourceBytesin interfaceCloudEventOrBuilder- Returns:
- The bytes for source.
-
setSource
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
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
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
Required. The version of the CloudEvents specification which the event uses.
string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];- Specified by:
getSpecVersionin interfaceCloudEventOrBuilder- 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:
getSpecVersionBytesin interfaceCloudEventOrBuilder- Returns:
- The bytes for specVersion.
-
setSpecVersion
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
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
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
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:
getTypein interfaceCloudEventOrBuilder- 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:
getTypeBytesin interfaceCloudEventOrBuilder- Returns:
- The bytes for type.
-
setType
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
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
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:CloudEventOrBuilderOptional. Used for Optional & Extension Attributes
map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getAttributesCountin interfaceCloudEventOrBuilder
-
containsAttributes
Optional. Used for Optional & Extension Attributes
map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
containsAttributesin interfaceCloudEventOrBuilder
-
getAttributes
Deprecated.UsegetAttributesMap()instead.- Specified by:
getAttributesin interfaceCloudEventOrBuilder
-
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:
getAttributesMapin interfaceCloudEventOrBuilder
-
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:
getAttributesOrDefaultin interfaceCloudEventOrBuilder
-
getAttributesOrThrow
Optional. Used for Optional & Extension Attributes
map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getAttributesOrThrowin interfaceCloudEventOrBuilder
-
clearAttributes
-
removeAttributes
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
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:
hasBinaryDatain interfaceCloudEventOrBuilder- 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:
getBinaryDatain interfaceCloudEventOrBuilder- Returns:
- The binaryData.
-
setBinaryData
Optional. Binary data.
bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The binaryData to set.- Returns:
- This builder for chaining.
-
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:
hasTextDatain interfaceCloudEventOrBuilder- Returns:
- Whether the textData field is set.
-
getTextData
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getTextDatain interfaceCloudEventOrBuilder- Returns:
- The textData.
-
getTextDataBytes
public com.google.protobuf.ByteString getTextDataBytes()Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];- Specified by:
getTextDataBytesin interfaceCloudEventOrBuilder- Returns:
- The bytes for textData.
-
setTextData
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];- Parameters:
value- The textData to set.- Returns:
- This builder for chaining.
-
clearTextData
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];- Returns:
- This builder for chaining.
-
setTextDataBytes
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:
hasProtoDatain interfaceCloudEventOrBuilder- 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:
getProtoDatain interfaceCloudEventOrBuilder- Returns:
- The protoData.
-
setProtoData
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
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
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
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:
getProtoDataOrBuilderin interfaceCloudEventOrBuilder
-