Class InboundBulkMessage.Content
-
- All Implemented Interfaces:
public final class InboundBulkMessage.ContentElemental content (optional, for V2 format). When provided, this will be used instead of the notification associated with the
eventfield.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceInboundBulkMessage.Content.VisitorAn interface that defines how to map each variant of Content to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ElementalContentSugar>elementalContentSugar()Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks. final Optional<ElementalContent>elemental()final BooleanisElementalContentSugar()final BooleanisElemental()final ElementalContentSugarasElementalContentSugar()Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks. final ElementalContentasElemental()final Optional<JsonValue>_json()final <T extends Any> Taccept(InboundBulkMessage.Content.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final InboundBulkMessage.Contentvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static InboundBulkMessage.ContentofElementalContentSugar(ElementalContentSugar elementalContentSugar)Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks. final static InboundBulkMessage.ContentofElemental(ElementalContent elemental)-
-
Method Detail
-
elementalContentSugar
final Optional<ElementalContentSugar> elementalContentSugar()
Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
-
elemental
final Optional<ElementalContent> elemental()
-
isElementalContentSugar
final Boolean isElementalContentSugar()
-
isElemental
final Boolean isElemental()
-
asElementalContentSugar
final ElementalContentSugar asElementalContentSugar()
Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
-
asElemental
final ElementalContent asElemental()
-
accept
final <T extends Any> T accept(InboundBulkMessage.Content.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 = content.accept(new Content.Visitor<Optional<String>>() { @Override public Optional<String> visitElementalContentSugar(ElementalContentSugar elementalContentSugar) { return Optional.of(elementalContentSugar.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final InboundBulkMessage.Content 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.
-
ofElementalContentSugar
final static InboundBulkMessage.Content ofElementalContentSugar(ElementalContentSugar elementalContentSugar)
Syntactic sugar to provide a fast shorthand for Courier Elemental Blocks.
-
ofElemental
final static InboundBulkMessage.Content ofElemental(ElementalContent elemental)
-
-
-
-