Class BetaManagedAgentsMemoryListItem
-
- All Implemented Interfaces:
public final class BetaManagedAgentsMemoryListItemOne item in a /en/api/beta/memory_stores/memories/list response: either a
memoryobject or, whendepthis set, amemory_prefixrollup marker.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBetaManagedAgentsMemoryListItem.VisitorAn interface that defines how to map each variant of BetaManagedAgentsMemoryListItem to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<BetaManagedAgentsMemory>memory()A memoryobject: a single text document at a hierarchical path inside a memory store.final Optional<BetaManagedAgentsMemoryPrefix>memoryPrefix()A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when depthis set.final BooleanisMemory()final BooleanisMemoryPrefix()final BetaManagedAgentsMemoryasMemory()A memoryobject: a single text document at a hierarchical path inside a memory store.final BetaManagedAgentsMemoryPrefixasMemoryPrefix()A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when depthis set.final Optional<JsonValue>_json()final <T extends Any> Taccept(BetaManagedAgentsMemoryListItem.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final BetaManagedAgentsMemoryListItemvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsMemoryListItemofMemory(BetaManagedAgentsMemory memory)A memoryobject: a single text document at a hierarchical path inside a memory store.final static BetaManagedAgentsMemoryListItemofMemoryPrefix(BetaManagedAgentsMemoryPrefix memoryPrefix)A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when depthis set.-
-
Method Detail
-
memory
final Optional<BetaManagedAgentsMemory> memory()
A
memoryobject: a single text document at a hierarchical path inside a memory store. Thecontentfield is populated whenview=fullandnullwhenview=basic; thecontent_size_bytesandcontent_sha256fields are always populated so sync clients can diff without fetching content. Memories are addressed by theirmem_...ID; the path is the create key and can be changed via update.
-
memoryPrefix
final Optional<BetaManagedAgentsMemoryPrefix> memoryPrefix()
A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when
depthis set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the pagelimitand interleaves withmemoryitems in path order.
-
isMemoryPrefix
final Boolean isMemoryPrefix()
-
asMemory
final BetaManagedAgentsMemory asMemory()
A
memoryobject: a single text document at a hierarchical path inside a memory store. Thecontentfield is populated whenview=fullandnullwhenview=basic; thecontent_size_bytesandcontent_sha256fields are always populated so sync clients can diff without fetching content. Memories are addressed by theirmem_...ID; the path is the create key and can be changed via update.
-
asMemoryPrefix
final BetaManagedAgentsMemoryPrefix asMemoryPrefix()
A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when
depthis set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the pagelimitand interleaves withmemoryitems in path order.
-
accept
final <T extends Any> T accept(BetaManagedAgentsMemoryListItem.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 = betaManagedAgentsMemoryListItem.accept(new BetaManagedAgentsMemoryListItem.Visitor<Optional<String>>() { @Override public Optional<String> visitMemory(BetaManagedAgentsMemory memory) { return Optional.of(memory.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final BetaManagedAgentsMemoryListItem 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.
-
ofMemory
final static BetaManagedAgentsMemoryListItem ofMemory(BetaManagedAgentsMemory memory)
A
memoryobject: a single text document at a hierarchical path inside a memory store. Thecontentfield is populated whenview=fullandnullwhenview=basic; thecontent_size_bytesandcontent_sha256fields are always populated so sync clients can diff without fetching content. Memories are addressed by theirmem_...ID; the path is the create key and can be changed via update.
-
ofMemoryPrefix
final static BetaManagedAgentsMemoryListItem ofMemoryPrefix(BetaManagedAgentsMemoryPrefix memoryPrefix)
A rolled-up directory marker returned by /en/api/beta/memory_stores/memories/list when
depthis set. Indicates that one or more memories exist deeper than the requested depth under this prefix. This is a list-time rollup, not a stored resource; it has no ID and no lifecycle. Each prefix counts toward the pagelimitand interleaves withmemoryitems in path order.
-
-
-
-