T - The type of the domain eventpublic class GenericCloudEventConverter<T> extends java.lang.Object implements CloudEventConverter<T>
CloudEventConverter that takes two functions,
that converts between a cloud event and a domain event and vice versa.| Constructor and Description |
|---|
GenericCloudEventConverter(java.util.function.Function<io.cloudevents.CloudEvent,T> convertToDomainEvent,
java.util.function.Function<T,io.cloudevents.CloudEvent> convertToCloudEvent) |
| Modifier and Type | Method and Description |
|---|---|
io.cloudevents.CloudEvent |
toCloudEvent(T domainEvent)
Convert a domain event into a cloud event
|
T |
toDomainEvent(io.cloudevents.CloudEvent cloudEvent)
Convert a cloud event to a domain event
|
public io.cloudevents.CloudEvent toCloudEvent(T domainEvent)
CloudEventConvertertoCloudEvent in interface CloudEventConverter<T>domainEvent - The domain event to convertCloudEvent instance, converted from the domain event.public T toDomainEvent(io.cloudevents.CloudEvent cloudEvent)
CloudEventConvertertoDomainEvent in interface CloudEventConverter<T>cloudEvent - The cloud event to convertCopyright © 2021. All rights reserved.