Package com.anthropic.models.messages
Class RawContentBlockDelta
-
- All Implemented Interfaces:
public final class RawContentBlockDelta
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceRawContentBlockDelta.VisitorAn interface that defines how to map each variant of RawContentBlockDelta to a value of type T.
-
Method Summary
-
-
Method Detail
-
inputJson
final Optional<InputJsonDelta> inputJson()
-
citations
final Optional<CitationsDelta> citations()
-
thinking
final Optional<ThinkingDelta> thinking()
-
signature
final Optional<SignatureDelta> signature()
-
isInputJson
final Boolean isInputJson()
-
isCitations
final Boolean isCitations()
-
isThinking
final Boolean isThinking()
-
isSignature
final Boolean isSignature()
-
asInputJson
final InputJsonDelta asInputJson()
-
asCitations
final CitationsDelta asCitations()
-
asThinking
final ThinkingDelta asThinking()
-
asSignature
final SignatureDelta asSignature()
-
accept
final <T extends Any> T accept(RawContentBlockDelta.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 = rawContentBlockDelta.accept(new RawContentBlockDelta.Visitor<Optional<String>>() { @Override public Optional<String> visitText(TextDelta text) { return Optional.of(text.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final RawContentBlockDelta 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 RawContentBlockDelta ofText(TextDelta text)
-
ofInputJson
final static RawContentBlockDelta ofInputJson(InputJsonDelta inputJson)
-
ofCitations
final static RawContentBlockDelta ofCitations(CitationsDelta citations)
-
ofThinking
final static RawContentBlockDelta ofThinking(ThinkingDelta thinking)
-
ofSignature
final static RawContentBlockDelta ofSignature(SignatureDelta signature)
-
-
-
-