T - the type of the wrapped POJO.public class PojoCloudEventData<T> extends Object implements CloudEventData
CloudEventData that wraps any POJO.| Modifier and Type | Class and Description |
|---|---|
static interface |
PojoCloudEventData.ToBytes<T>
Interface defining a conversion from T to byte array.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
T |
getValue() |
int |
hashCode() |
byte[] |
toBytes() |
static <T> PojoCloudEventData<T> |
wrap(T data,
PojoCloudEventData.ToBytes<T> mapper)
Wrap the provided data in a
PojoCloudEventData serializable by the provided mapper. |
public T getValue()
public byte[] toBytes()
toBytes in interface CloudEventDatapublic static <T> PojoCloudEventData<T> wrap(T data, PojoCloudEventData.ToBytes<T> mapper)
PojoCloudEventData serializable by the provided mapper.T - The type of datadata - the POJO to wrapmapper - converter from data to bytes, used to implement toBytes()PojoCloudEventDataCopyright © 2023. All rights reserved.