Package io.dapr.client.domain
Class CloudEvent
java.lang.Object
io.dapr.client.domain.CloudEvent
public final class CloudEvent
extends java.lang.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
Constructors Constructor Description CloudEvent(java.lang.String id, java.lang.String source, java.lang.String type, java.lang.String specversion, java.lang.String datacontenttype, java.lang.String data)
Instantiates a new input request. -
Method Summary
Modifier and Type Method Description static CloudEvent
deserialize(byte[] payload)
Deserialized a message topic from Dapr.boolean
equals(java.lang.Object o)
java.lang.String
getData()
Gets the payload.java.lang.String
getDatacontenttype()
Gets the type of the payload.java.lang.String
getId()
Gets the identifier of the message being processed.java.lang.String
getSource()
Gets the source for this event.java.lang.String
getSpecversion()
Gets the version of the event spec.java.lang.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(java.lang.String id, java.lang.String source, java.lang.String type, java.lang.String specversion, java.lang.String datacontenttype, java.lang.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
public java.lang.String getId()Gets the identifier of the message being processed.- Returns:
- Identifier of the message being processed.
-
getSource
public java.lang.String getSource()Gets the source for this event.- Returns:
- Source for this event.
-
getType
public java.lang.String getType()Gets the type of event.- Returns:
- Type of event.
-
getSpecversion
public java.lang.String getSpecversion()Gets the version of the event spec.- Returns:
- Version of the event spec.
-
getDatacontenttype
public java.lang.String getDatacontenttype()Gets the type of the payload.- Returns:
- Type of the payload.
-
getData
public java.lang.String getData()Gets the payload.- Returns:
- Payload
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in classjava.lang.Object
-
deserialize
Deserialized a message topic from Dapr.- Parameters:
payload
- Payload sent from Dapr.- Returns:
- Message (can be null if input is null)
- Throws:
java.io.IOException
- If cannot parse.
-