Attribute
查看 MarkdownThis page lists the Java SDK names for Attributes. The doc comment of each API gives its parameters, defaults, and errors. Read them in the Java SDK API reference.
API names
| Task | Java API | Dex behavior |
|---|---|---|
| Define a singleton Attribute | Attribute.define | Attributes |
| Define an AttributeMap | AttributeMap.define | Attributes |
| Declare it in the Flow | PersistenceSchema.of, returned from getPersistenceSchema | Flow definition |
| Read, write, and delete a value in a Step or RPC | get, set, and delete | Commits |
| Address one AttributeMap instance | AttributeMap.instance, or the instance key argument of get, set, and delete | Attributes |
| Count AttributeMap instances and list their keys | AttributeMap.getMapSize and AttributeMap.getAllInstanceKeys | Selective state loading |
| Load AttributeMap values for a method | addWaitForLoadAttributeMap, addExecuteLoadAttributeMap, and their instance variants of StepOptions.Builder, or loadAttributeMaps and loadAttributeMapInstances of @RPC | Selective state loading |
| Lock a value for a read-modify-write | AttributeLock.of, with addWaitForLock and addExecuteLock of StepOptions.Builder, or lockAttributes and lockAttributeMaps of @RPC | Locks |
| Index a value for search | AttributeIndex and AttributeIndex.Type, passed to define | Indexes |
| Project writes to an Attribute Store | syncToAttributeStore | Attribute sync |
| Store a value that can be erased | hardDeleteOnNull | Hard-delete Attributes |
| Set a value when the Flow starts | StartFlowOptions.Builder.addAttribute | Attributes at start |
| Read values from outside the Flow | Client.getAttributes | Read Attributes |
| Wait until a value matches | Client.waitForAttributeMatch, with AttributeMatch | Wait for an Attribute match |
Example
Example: examples/java/src/main/java/io/superdurable/dex/primitives/attribute/AttributeFlow.java