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 BaseEventBuilderbuilder()builder factory method for BaseEventstatic BaseEventBuildercreate builder for BaseEvent instancecopyDeep()static BaseEventfactory method to create a deep copy of BaseEvent@NotNull ZonedDateTimeDate and time (UTC) the Event was generated.@NotNull @Valid ObjectgetData()An object containing details related to the Event.@NotNull StringgetId()Unique identifier of the Event.@NotNull String@NotNull EventSubscriptionResourceTypeIdThe type of resource targeted by the Event.@NotNull EventTypegetType()The type of Event that has occurred.static BaseEventof()factory methodstatic BaseEventfactory method to create a shallow copy BaseEventvoidsetCreatedAt(ZonedDateTime createdAt) Date and time (UTC) the Event was generated.voidAn object containing details related to the Event.voidUnique identifier of the Event.voidsetNotificationType(String notificationType) set notificationTypevoidsetResourceType(EventSubscriptionResourceTypeId resourceType) The type of resource targeted by the Event.voidThe type of Event that has occurred.static com.fasterxml.jackson.core.type.TypeReference<BaseEvent>gives a TypeReference for usage with Jackson DataBinddefault <T> TwithBaseEvent(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
-