Package io.dapr.client.domain
Class CloudEvent
java.lang.Object
io.dapr.client.domain.CloudEvent
public final class CloudEvent extends Object
A cloud event in Dapr.
-
Field Summary
Fields Modifier and Type Field Description protected static com.fasterxml.jackson.databind.ObjectMapper
OBJECT_MAPPER
Shared Json serializer/deserializer as per Jackson's documentation. -
Constructor Summary
-
Method Summary
Modifier and Type Method Description static CloudEvent
deserialize(byte[] payload)
Deserialized a message topic from Dapr.boolean
equals(Object o)
String
getData()
Gets the payload.String
getDatacontenttype()
Gets the type of the payload.String
getId()
Gets the identifier of the message being processed.String
getSource()
Gets the source for this event.String
getSpecversion()
Gets the version of the event spec.String
getType()
Gets the type of event.int
hashCode()
-
Field Details
-
OBJECT_MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper OBJECT_MAPPERShared Json serializer/deserializer as per Jackson's documentation.
-
-
Constructor Details
-
CloudEvent
public CloudEvent(String id, String source, String type, String specversion, String datacontenttype, String data)Instantiates a new input request.- Parameters:
id
- Identifier of the message being processed.source
- Source for this event.type
- Type of event.specversion
- Version of the event spec.datacontenttype
- Type of the payload.data
- Payload.
-
-
Method Details
-
getId
Gets the identifier of the message being processed.- Returns:
- Identifier of the message being processed.
-
getSource
Gets the source for this event.- Returns:
- Source for this event.
-
getType
Gets the type of event.- Returns:
- Type of event.
-
getSpecversion
Gets the version of the event spec.- Returns:
- Version of the event spec.
-
getDatacontenttype
Gets the type of the payload.- Returns:
- Type of the payload.
-
getData
Gets the payload.- Returns:
- Payload
-
equals
-
hashCode
public int hashCode() -
deserialize
Deserialized a message topic from Dapr.- Parameters:
payload
- Payload sent from Dapr.- Returns:
- Message (can be null if input is null)
- Throws:
IOException
- If cannot parse.
-