Interface BaseEvent
public interface BaseEvent
Base representation of an Event containing common fields to all Event Types.
Example to create an instance using the builder pattern
BaseEvent baseEvent = BaseEvent.builder()
.id("{id}")
.notificationType("{notificationType}")
.resourceType(EventSubscriptionResourceTypeId.CHECKOUT)
.type(EventType.CHECKOUT_ORDER_CREATION_FAILED)
.data(dataBuilder -> dataBuilder)
.createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic BaseEventBuilder
builder()
builder factory method for BaseEventstatic BaseEventBuilder
create builder for BaseEvent instancecopyDeep()
static BaseEvent
factory method to create a deep copy of BaseEvent@NotNull ZonedDateTime
Date and time (UTC) the Event was generated.@NotNull @Valid Object
getData()
An object containing details related to the Event.@NotNull String
getId()
Unique identifier of the Event.@NotNull String
@NotNull EventSubscriptionResourceTypeId
The type of resource targeted by the Event.@NotNull EventType
getType()
The type of Event that has occurred.static BaseEvent
of()
factory methodstatic BaseEvent
factory method to create a shallow copy BaseEventvoid
setCreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Event was generated.void
An object containing details related to the Event.void
Unique identifier of the Event.void
setNotificationType
(String notificationType) set notificationTypevoid
setResourceType
(EventSubscriptionResourceTypeId resourceType) The type of resource targeted by the Event.void
The type of Event that has occurred.static com.fasterxml.jackson.core.type.TypeReference<BaseEvent>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withBaseEvent
(Function<BaseEvent, T> helper) accessor map function
-
Method Details
-
getId
Unique identifier of the Event.
- Returns:
- id
-
getNotificationType
- Returns:
- notificationType
-
getResourceType
The type of resource targeted by the Event.
- Returns:
- resourceType
-
getType
The type of Event that has occurred.
- Returns:
- type
-
getData
An object containing details related to the Event.
- Returns:
- data
-
getCreatedAt
Date and time (UTC) the Event was generated.
- Returns:
- createdAt
-
setId
Unique identifier of the Event.
- Parameters:
id
- value to be set
-
setNotificationType
set notificationType- Parameters:
notificationType
- value to be set
-
setResourceType
The type of resource targeted by the Event.
- Parameters:
resourceType
- value to be set
-
setType
The type of Event that has occurred.
- Parameters:
type
- value to be set
-
setData
An object containing details related to the Event.
- Parameters:
data
- value to be set
-
setCreatedAt
Date and time (UTC) the Event was generated.
- Parameters:
createdAt
- value to be set
-
of
factory method- Returns:
- instance of BaseEvent
-
of
factory method to create a shallow copy BaseEvent- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
copyDeep
BaseEvent copyDeep() -
deepCopy
factory method to create a deep copy of BaseEvent- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for BaseEvent- Returns:
- builder
-
builder
create builder for BaseEvent instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withBaseEvent
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-