Class NotificationRetrieveContentResponse
-
- All Implemented Interfaces:
public final class NotificationRetrieveContentResponseElemental content response for V2 templates. Contains versioned elements with content checksums.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceNotificationRetrieveContentResponse.VisitorAn interface that defines how to map each variant of NotificationRetrieveContentResponse to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<NotificationContentGetResponse>contentGet()Elemental content response for V2 templates. final Optional<NotificationGetContent>getContent()final BooleanisContentGet()final BooleanisGetContent()final NotificationContentGetResponseasContentGet()Elemental content response for V2 templates. final NotificationGetContentasGetContent()final Optional<JsonValue>_json()final <T extends Any> Taccept(NotificationRetrieveContentResponse.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final NotificationRetrieveContentResponsevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static NotificationRetrieveContentResponseofContentGet(NotificationContentGetResponse contentGet)Elemental content response for V2 templates. final static NotificationRetrieveContentResponseofGetContent(NotificationGetContent getContent)-
-
Method Detail
-
contentGet
final Optional<NotificationContentGetResponse> contentGet()
Elemental content response for V2 templates. Contains versioned elements with content checksums.
-
getContent
final Optional<NotificationGetContent> getContent()
-
isContentGet
final Boolean isContentGet()
-
isGetContent
final Boolean isGetContent()
-
asContentGet
final NotificationContentGetResponse asContentGet()
Elemental content response for V2 templates. Contains versioned elements with content checksums.
-
asGetContent
final NotificationGetContent asGetContent()
-
accept
final <T extends Any> T accept(NotificationRetrieveContentResponse.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 = notificationRetrieveContentResponse.accept(new NotificationRetrieveContentResponse.Visitor<Optional<String>>() { @Override public Optional<String> visitContentGet(NotificationContentGetResponse contentGet) { return Optional.of(contentGet.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final NotificationRetrieveContentResponse 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.
-
ofContentGet
final static NotificationRetrieveContentResponse ofContentGet(NotificationContentGetResponse contentGet)
Elemental content response for V2 templates. Contains versioned elements with content checksums.
-
ofGetContent
final static NotificationRetrieveContentResponse ofGetContent(NotificationGetContent getContent)
-
-
-
-