Class BaseEventBuilder
java.lang.Object
com.commercetools.api.models.event.BaseEventBuilder
BaseEventBuilder
Example to create an instance using the builder pattern
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()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
builds BaseEvent with checking for non-null required valuesbuilds BaseEvent without checking for non-null required valuescreatedAt
(ZonedDateTime createdAt) Date and time (UTC) the Event was generated.An object containing details related to the Event.Date and time (UTC) the Event was generated.getData()
An object containing details related to the Event.getId()
Unique identifier of the Event.value of notificationType}The type of resource targeted by the Event.getType()
The type of Event that has occurred.Unique identifier of the Event.notificationType
(String notificationType) set the value to the notificationTypestatic BaseEventBuilder
of()
factory method for an instance of BaseEventBuilderstatic BaseEventBuilder
create builder for BaseEvent instanceresourceType
(EventSubscriptionResourceTypeId resourceType) The type of resource targeted by the Event.The type of Event that has occurred.
-
Constructor Details
-
BaseEventBuilder
public BaseEventBuilder()
-
-
Method Details
-
id
Unique identifier of the Event.
- Parameters:
id
- value to be set- Returns:
- Builder
-
notificationType
set the value to the notificationType- Parameters:
notificationType
- value to be set- Returns:
- Builder
-
resourceType
The type of resource targeted by the Event.
- Parameters:
resourceType
- value to be set- Returns:
- Builder
-
type
The type of Event that has occurred.
- Parameters:
type
- value to be set- Returns:
- Builder
-
data
An object containing details related to the Event.
- Parameters:
data
- value to be set- Returns:
- Builder
-
createdAt
Date and time (UTC) the Event was generated.
- Parameters:
createdAt
- value to be set- Returns:
- Builder
-
getId
Unique identifier of the Event.
- Returns:
- id
-
getNotificationType
value of notificationType}- 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
-
build
builds BaseEvent with checking for non-null required values -
buildUnchecked
builds BaseEvent without checking for non-null required values- Returns:
- BaseEvent
-
of
factory method for an instance of BaseEventBuilder- Returns:
- builder
-
of
create builder for BaseEvent instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-