-
- All Implemented Interfaces:
-
com.glia.androidsdk.EngagementRequest
public class PublicEngagementRequest implements EngagementRequest
-
-
Constructor Summary
Constructors Constructor Description PublicEngagementRequest(String id, EngagementApi engagementApi)
-
Method Summary
Modifier and Type Method Description StringgetId()Returns Engagement Request unique ID Optional<EngagementRequest.Outcome>getOutcome()Return Engagement request OptionalOutcome which is one of Outcome values. <T> voidon(EngagementRequest.EngagementRequestEvent<T> event, Consumer<T> listener)Registers event listeners for Engagement Request. voidon(EngagementRequest.EngagementRequestEvent<out Object> event, Runnable listener)Registers event listeners for Engagement Request. <T> voidoff(EngagementRequest.EngagementRequestEvent<T> event, Consumer<T> listener)Removes event listeners from the Engagement Request. voidoff(EngagementRequest.EngagementRequestEvent<out Object> event, Runnable listener)Removes event listeners from the Engagement Request. -
-
Constructor Detail
-
PublicEngagementRequest
PublicEngagementRequest(String id, EngagementApi engagementApi)
-
-
Method Detail
-
getOutcome
Optional<EngagementRequest.Outcome> getOutcome()
-
on
<T> void on(EngagementRequest.EngagementRequestEvent<T> event, Consumer<T> listener)
Registers event listeners for Engagement Request.
If a listener is added while the Engagement Request is processing an event,it is not triggered with the current event.
If multiple identical listeners are registered on the same event typethe duplicate instances are discarded. They do not cause the listenerto be called twice and do not need to be removed with the off method.
- Parameters:
event- One of Eventslistener- Event listener to register
-
on
void on(EngagementRequest.EngagementRequestEvent<out Object> event, Runnable listener)
Registers event listeners for Engagement Request.
If a listener is added while the Engagement Request is processing an event,it is not triggered with the current event.
If multiple identical listeners are registered on the same event typethe duplicate instances are discarded. They do not cause the listenerto be called twice and do not need to be removed with the off method.
Compared to on this methoddoes not require the listener to consumer the payload.This is useful when payload is of type Void.
- Parameters:
event- One of Eventslistener- Event listener to register
-
off
<T> void off(EngagementRequest.EngagementRequestEvent<T> event, Consumer<T> listener)
Removes event listeners from the Engagement Request.
If an event listener is removed while the Engagement Request is processing an event,it is not triggered with the current event.
Calling
{@code off}with arguments which do not identify any currently registeredlistener has no effect.- Parameters:
event- One of Eventslistener- Event listener to remove
-
off
void off(EngagementRequest.EngagementRequestEvent<out Object> event, Runnable listener)
Removes event listeners from the Engagement Request.
If an event listener is removed while the Engagement Request is processing an event,it is not triggered with the current event.
Calling
{@code off}with arguments which do not identify any currently registeredlistener has no effect.- Parameters:
event- One of Eventslistener- Event listener to remove
-
-
-
-