---
title: "Attribute"
description: "This page lists the Java SDK names for Attributes."
canonical_url: "https://docs.superdurable.io/zh-Hans/reference/java/attribute/"
source: "docs/reference/java/attribute.mdx"
locale: "zh-Hans"
---

# Attribute

This page lists the Java SDK names for [Attributes](https://docs.superdurable.io/zh-Hans/concepts/primitives/attribute.md).
The doc comment of each API gives its parameters, defaults, and errors. Read
them in the [Java SDK API reference](https://docs.superdurable.io/zh-Hans/reference/java.md#api-reference).

<a id="api-names"></a>

## API names

| Task                                             | Java API                                                                                                                                                                                       | Dex behavior                                                                                                                       |
| ------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| Define a singleton Attribute                     | **Attribute.define**                                                                                                                                                                           | [Attributes](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#attributes)                                     |
| Define an AttributeMap                           | **AttributeMap.define**                                                                                                                                                                        | [Attributes](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#attributes)                                     |
| Declare it in the Flow                           | **PersistenceSchema.of**, returned from **getPersistenceSchema**                                                                                                                               | [Flow definition](https://docs.superdurable.io/zh-Hans/reference/java/flow.md#flow-definition)                                     |
| Read, write, and delete a value in a Step or RPC | **get**, **set**, and **delete**                                                                                                                                                               | [Commits](https://docs.superdurable.io/zh-Hans/reference/java/step.md#commit-boundary)                                             |
| Address one AttributeMap instance                | **AttributeMap.instance**, or the instance key argument of **get**, **set**, and **delete**                                                                                                    | [Attributes](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#attributes)                                     |
| Count AttributeMap instances and list their keys | **AttributeMap.getMapSize** and **AttributeMap.getAllInstanceKeys**                                                                                                                            | [Selective state loading](https://docs.superdurable.io/zh-Hans/reference/java/step-options.md#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](https://docs.superdurable.io/zh-Hans/reference/java/step-options.md#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](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#attribute-locks)                                     |
| Index a value for search                         | **AttributeIndex** and **AttributeIndex.Type**, passed to **define**                                                                                                                           | [Indexes](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#attribute-indexes)                                 |
| Project writes to an Attribute Store             | **syncToAttributeStore**                                                                                                                                                                       | [Attribute sync](https://docs.superdurable.io/zh-Hans/reference/server/attribute-store-sync.md)                                    |
| Store a value that can be erased                 | **hardDeleteOnNull**                                                                                                                                                                           | [Hard-delete Attributes](https://docs.superdurable.io/zh-Hans/reference/server/runtime-data.md#hard-delete-attributes)             |
| Set a value when the Flow starts                 | **StartFlowOptions.Builder.addAttribute**                                                                                                                                                      | [Attributes at start](https://docs.superdurable.io/zh-Hans/reference/java/start-flow-options.md#attributes)                        |
| Read values from outside the Flow                | **Client.getAttributes**                                                                                                                                                                       | [Read Attributes](https://docs.superdurable.io/zh-Hans/reference/server/runtime-client.md#read-attributes)                         |
| Wait until a value matches                       | **Client.waitForAttributeMatch**, with **AttributeMatch**                                                                                                                                      | [Wait for an Attribute match](https://docs.superdurable.io/zh-Hans/reference/server/runtime-client.md#wait-for-an-attribute-match) |

<a id="example"></a>

## Example

Example: [examples/java/src/main/java/io/superdurable/dex/primitives/attribute/AttributeFlow.java](https://github.com/superdurable/dex/tree/main/examples/java/src/main/java/io/superdurable/dex/primitives/attribute/AttributeFlow.java)
