Class NotificationListResponse.Result
-
- All Implemented Interfaces:
public final class NotificationListResponse.ResultV2 (CDS) template summary returned in list responses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceNotificationListResponse.Result.VisitorAn interface that defines how to map each variant of Result to a value of type T.
public final classNotificationListResponse.Result.Notification
-
Method Summary
-
-
Method Detail
-
notification
final Optional<NotificationListResponse.Result.Notification> notification()
-
notificationTemplateSummary
final Optional<NotificationTemplateSummary> notificationTemplateSummary()
V2 (CDS) template summary returned in list responses.
-
isNotification
final Boolean isNotification()
-
isNotificationTemplateSummary
final Boolean isNotificationTemplateSummary()
-
asNotification
final NotificationListResponse.Result.Notification asNotification()
-
asNotificationTemplateSummary
final NotificationTemplateSummary asNotificationTemplateSummary()
V2 (CDS) template summary returned in list responses.
-
accept
final <T extends Any> T accept(NotificationListResponse.Result.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.courier.core.JsonValue; import java.util.Optional; Optional<String> result = result.accept(new Result.Visitor<Optional<String>>() { @Override public Optional<String> visitNotification(Notification notification) { return Optional.of(notification.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final NotificationListResponse.Result validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofNotification
final static NotificationListResponse.Result ofNotification(NotificationListResponse.Result.Notification notification)
-
ofNotificationTemplateSummary
final static NotificationListResponse.Result ofNotificationTemplateSummary(NotificationTemplateSummary notificationTemplateSummary)
V2 (CDS) template summary returned in list responses.
-
-
-
-