public static final class CloudEvent.Builder extends GeneratedMessageV3.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
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > CloudEvent.BuilderImplements
CloudEventOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public CloudEvent.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
build()
public CloudEvent build()
Returns | |
---|---|
Type | Description |
CloudEvent |
buildPartial()
public CloudEvent buildPartial()
Returns | |
---|---|
Type | Description |
CloudEvent |
clear()
public CloudEvent.Builder clear()
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
clearAttributes()
public CloudEvent.Builder clearAttributes()
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
clearBinaryData()
public CloudEvent.Builder clearBinaryData()
Optional. Binary data.
bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
clearData()
public CloudEvent.Builder clearData()
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
clearField(Descriptors.FieldDescriptor field)
public CloudEvent.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
FieldDescriptor |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
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 | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
clearOneof(Descriptors.OneofDescriptor oneof)
public CloudEvent.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof |
OneofDescriptor |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
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];
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
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 | |
---|---|
Type | Description |
CloudEvent.Builder |
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 | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
clearTextData()
public CloudEvent.Builder clearTextData()
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
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 | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
clone()
public CloudEvent.Builder clone()
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
containsAttributes(String key)
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];
Parameter | |
---|---|
Name | Description |
key |
String |
Returns | |
---|---|
Type | Description |
boolean |
getAttributes() (deprecated)
public Map<String,CloudEvent.CloudEventAttributeValue> getAttributes()
Use #getAttributesMap() instead.
Returns | |
---|---|
Type | Description |
Map<String,CloudEventAttributeValue> |
getAttributesCount()
public int getAttributesCount()
Optional. Used for Optional & Extension Attributes
map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
int |
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];
Returns | |
---|---|
Type | Description |
Map<String,CloudEventAttributeValue> |
getAttributesOrDefault(String key, CloudEvent.CloudEventAttributeValue defaultValue)
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];
Parameters | |
---|---|
Name | Description |
key |
String |
defaultValue |
CloudEvent.CloudEventAttributeValue |
Returns | |
---|---|
Type | Description |
CloudEvent.CloudEventAttributeValue |
getAttributesOrThrow(String key)
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];
Parameter | |
---|---|
Name | Description |
key |
String |
Returns | |
---|---|
Type | Description |
CloudEvent.CloudEventAttributeValue |
getBinaryData()
public ByteString getBinaryData()
Optional. Binary data.
bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
ByteString |
The binaryData. |
getDataCase()
public CloudEvent.DataCase getDataCase()
Returns | |
---|---|
Type | Description |
CloudEvent.DataCase |
getDefaultInstanceForType()
public CloudEvent getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
CloudEvent |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
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];
Returns | |
---|---|
Type | Description |
String |
The id. |
getIdBytes()
public 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];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for id. |
getMutableAttributes() (deprecated)
public Map<String,CloudEvent.CloudEventAttributeValue> getMutableAttributes()
Use alternate mutation accessors instead.
Returns | |
---|---|
Type | Description |
Map<String,CloudEventAttributeValue> |
getProtoData()
public 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];
Returns | |
---|---|
Type | Description |
Any |
The protoData. |
getProtoDataBuilder()
public 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];
Returns | |
---|---|
Type | Description |
Builder |
getProtoDataOrBuilder()
public 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];
Returns | |
---|---|
Type | Description |
AnyOrBuilder |
getSource()
public String getSource()
Required. Identifies the context in which an event happened. URI-reference
string source = 2 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
String |
The source. |
getSourceBytes()
public ByteString getSourceBytes()
Required. Identifies the context in which an event happened. URI-reference
string source = 2 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for source. |
getSpecVersion()
public String getSpecVersion()
Required. The version of the CloudEvents specification which the event uses.
string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
String |
The specVersion. |
getSpecVersionBytes()
public ByteString getSpecVersionBytes()
Required. The version of the CloudEvents specification which the event uses.
string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for specVersion. |
getTextData()
public String getTextData()
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
String |
The textData. |
getTextDataBytes()
public ByteString getTextDataBytes()
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for textData. |
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];
Returns | |
---|---|
Type | Description |
String |
The type. |
getTypeBytes()
public 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];
Returns | |
---|---|
Type | Description |
ByteString |
The bytes for type. |
hasBinaryData()
public boolean hasBinaryData()
Optional. Binary data.
bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
boolean |
Whether the binaryData field is set. |
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];
Returns | |
---|---|
Type | Description |
boolean |
Whether the protoData field is set. |
hasTextData()
public boolean hasTextData()
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
Returns | |
---|---|
Type | Description |
boolean |
Whether the textData field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
internalGetMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter | |
---|---|
Name | Description |
number |
int |
Returns | |
---|---|
Type | Description |
com.google.protobuf.MapFieldReflectionAccessor |
internalGetMutableMapFieldReflection(int number)
protected MapFieldReflectionAccessor internalGetMutableMapFieldReflection(int number)
Parameter | |
---|---|
Name | Description |
number |
int |
Returns | |
---|---|
Type | Description |
com.google.protobuf.MapFieldReflectionAccessor |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeFrom(CloudEvent other)
public CloudEvent.Builder mergeFrom(CloudEvent other)
Parameter | |
---|---|
Name | Description |
other |
CloudEvent |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public CloudEvent.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public CloudEvent.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other |
Message |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
mergeProtoData(Any value)
public CloudEvent.Builder mergeProtoData(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];
Parameter | |
---|---|
Name | Description |
value |
Any |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final CloudEvent.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
putAllAttributes(Map<String,CloudEvent.CloudEventAttributeValue> values)
public CloudEvent.Builder putAllAttributes(Map<String,CloudEvent.CloudEventAttributeValue> values)
Optional. Used for Optional & Extension Attributes
map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
values |
Map<String,CloudEventAttributeValue> |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
putAttributes(String key, CloudEvent.CloudEventAttributeValue value)
public CloudEvent.Builder putAttributes(String key, CloudEvent.CloudEventAttributeValue value)
Optional. Used for Optional & Extension Attributes
map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
Parameters | |
---|---|
Name | Description |
key |
String |
value |
CloudEvent.CloudEventAttributeValue |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
putAttributesBuilderIfAbsent(String key)
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];
Parameter | |
---|---|
Name | Description |
key |
String |
Returns | |
---|---|
Type | Description |
CloudEvent.CloudEventAttributeValue.Builder |
removeAttributes(String key)
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];
Parameter | |
---|---|
Name | Description |
key |
String |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
setBinaryData(ByteString value)
public CloudEvent.Builder setBinaryData(ByteString value)
Optional. Binary data.
bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
value |
ByteString The binaryData to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setField(Descriptors.FieldDescriptor field, Object value)
public CloudEvent.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
setId(String value)
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];
Parameter | |
---|---|
Name | Description |
value |
String The id to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setIdBytes(ByteString value)
public CloudEvent.Builder setIdBytes(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];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for id to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setProtoData(Any value)
public CloudEvent.Builder setProtoData(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];
Parameter | |
---|---|
Name | Description |
value |
Any |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
setProtoData(Any.Builder builderForValue)
public CloudEvent.Builder setProtoData(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];
Parameter | |
---|---|
Name | Description |
builderForValue |
Builder |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public CloudEvent.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
setSource(String value)
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];
Parameter | |
---|---|
Name | Description |
value |
String The source to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setSourceBytes(ByteString value)
public CloudEvent.Builder setSourceBytes(ByteString value)
Required. Identifies the context in which an event happened. URI-reference
string source = 2 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for source to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setSpecVersion(String value)
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];
Parameter | |
---|---|
Name | Description |
value |
String The specVersion to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setSpecVersionBytes(ByteString value)
public CloudEvent.Builder setSpecVersionBytes(ByteString value)
Required. The version of the CloudEvents specification which the event uses.
string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for specVersion to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setTextData(String value)
public CloudEvent.Builder setTextData(String value)
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
value |
String The textData to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setTextDataBytes(ByteString value)
public CloudEvent.Builder setTextDataBytes(ByteString value)
Optional. Text data.
string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for textData to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setType(String value)
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];
Parameter | |
---|---|
Name | Description |
value |
String The type to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setTypeBytes(ByteString value)
public CloudEvent.Builder setTypeBytes(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];
Parameter | |
---|---|
Name | Description |
value |
ByteString The bytes for type to set. |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |
This builder for chaining. |
setUnknownFields(UnknownFieldSet unknownFields)
public final CloudEvent.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
CloudEvent.Builder |