Class CloudEvent (0.54.0)

public final class CloudEvent extends GeneratedMessageV3 implements CloudEventOrBuilder

CloudEvent represents a vendor-neutral specification for defining the format of event data.

Protobuf type google.cloud.eventarc.publishing.v1.CloudEvent

Implements

CloudEventOrBuilder

Static Fields

ATTRIBUTES_FIELD_NUMBER

public static final int ATTRIBUTES_FIELD_NUMBER
Field Value
Type Description
int

BINARY_DATA_FIELD_NUMBER

public static final int BINARY_DATA_FIELD_NUMBER
Field Value
Type Description
int

ID_FIELD_NUMBER

public static final int ID_FIELD_NUMBER
Field Value
Type Description
int

PROTO_DATA_FIELD_NUMBER

public static final int PROTO_DATA_FIELD_NUMBER
Field Value
Type Description
int

SOURCE_FIELD_NUMBER

public static final int SOURCE_FIELD_NUMBER
Field Value
Type Description
int

SPEC_VERSION_FIELD_NUMBER

public static final int SPEC_VERSION_FIELD_NUMBER
Field Value
Type Description
int

TEXT_DATA_FIELD_NUMBER

public static final int TEXT_DATA_FIELD_NUMBER
Field Value
Type Description
int

TYPE_FIELD_NUMBER

public static final int TYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CloudEvent getDefaultInstance()
Returns
Type Description
CloudEvent

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static CloudEvent.Builder newBuilder()
Returns
Type Description
CloudEvent.Builder

newBuilder(CloudEvent prototype)

public static CloudEvent.Builder newBuilder(CloudEvent prototype)
Parameter
Name Description
prototype CloudEvent
Returns
Type Description
CloudEvent.Builder

parseDelimitedFrom(InputStream input)

public static CloudEvent parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CloudEvent
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudEvent parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudEvent
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CloudEvent parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CloudEvent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CloudEvent parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudEvent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CloudEvent parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CloudEvent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CloudEvent parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudEvent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CloudEvent parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CloudEvent
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudEvent parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudEvent
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CloudEvent parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CloudEvent
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CloudEvent parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudEvent
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CloudEvent parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CloudEvent
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CloudEvent parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CloudEvent
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CloudEvent> parser()
Returns
Type Description
Parser<CloudEvent>

Methods

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

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

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

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.

getParserForType()

public Parser<CloudEvent> getParserForType()
Returns
Type Description
Parser<CloudEvent>
Overrides

getProtoData()

public Any getProtoData()

Optional. Proto data.

.google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
Any

The protoData.

getProtoDataOrBuilder()

public AnyOrBuilder getProtoDataOrBuilder()

Optional. Proto data.

.google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
AnyOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

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.

.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.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

internalGetMapFieldReflection(int number)

protected MapFieldReflectionAccessor internalGetMapFieldReflection(int number)
Parameter
Name Description
number int
Returns
Type Description
com.google.protobuf.MapFieldReflectionAccessor
Overrides
com.google.protobuf.GeneratedMessageV3.internalGetMapFieldReflection(int)

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CloudEvent.Builder newBuilderForType()
Returns
Type Description
CloudEvent.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CloudEvent.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CloudEvent.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CloudEvent.Builder toBuilder()
Returns
Type Description
CloudEvent.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException