Class BetaRawContentBlockDelta
-
- All Implemented Interfaces:
public final class BetaRawContentBlockDelta
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaRawContentBlockDelta.VisitorAn interface that defines how to map each variant of BetaRawContentBlockDelta to a value of type T.
-
Method Summary
-
-
Method Detail
-
text
final Optional<BetaTextDelta> text()
-
inputJson
final Optional<BetaInputJsonDelta> inputJson()
-
citations
final Optional<BetaCitationsDelta> citations()
-
thinking
final Optional<BetaThinkingDelta> thinking()
-
signature
final Optional<BetaSignatureDelta> signature()
-
compaction
final Optional<BetaCompactionContentBlockDelta> compaction()
-
isInputJson
final Boolean isInputJson()
-
isCitations
final Boolean isCitations()
-
isThinking
final Boolean isThinking()
-
isSignature
final Boolean isSignature()
-
isCompaction
final Boolean isCompaction()
-
asText
final BetaTextDelta asText()
-
asInputJson
final BetaInputJsonDelta asInputJson()
-
asCitations
final BetaCitationsDelta asCitations()
-
asThinking
final BetaThinkingDelta asThinking()
-
asSignature
final BetaSignatureDelta asSignature()
-
asCompaction
final BetaCompactionContentBlockDelta asCompaction()
-
accept
final <T extends Any> T accept(BetaRawContentBlockDelta.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.anthropic.core.JsonValue; import java.util.Optional; Optional<String> result = betaRawContentBlockDelta.accept(new BetaRawContentBlockDelta.Visitor<Optional<String>>() { @Override public Optional<String> visitText(BetaTextDelta text) { return Optional.of(text.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaRawContentBlockDelta 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.
-
ofText
final static BetaRawContentBlockDelta ofText(BetaTextDelta text)
-
ofInputJson
final static BetaRawContentBlockDelta ofInputJson(BetaInputJsonDelta inputJson)
-
ofCitations
final static BetaRawContentBlockDelta ofCitations(BetaCitationsDelta citations)
-
ofThinking
final static BetaRawContentBlockDelta ofThinking(BetaThinkingDelta thinking)
-
ofSignature
final static BetaRawContentBlockDelta ofSignature(BetaSignatureDelta signature)
-
ofCompaction
final static BetaRawContentBlockDelta ofCompaction(BetaCompactionContentBlockDelta compaction)
-
-
-
-