# ModifiersBuilders.Semantics.Builder

Artifact: [androidx.wear.protolayout:protolayout](https://developer.android.com/jetpack/androidx/releases/wear-protolayout) [View Source](https://cs.android.com/search?q=file:androidx/wear/protolayout/ModifiersBuilders.java+class:androidx.wear.protolayout.ModifiersBuilders.Semantics.Builder) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

*** ** * ** ***


```
public final class ModifiersBuilders.Semantics.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics`

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#Builder()()` Creates an instance of `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics` | `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#build()()` Builds an instance from accumulated values. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setContentDescription(java.lang.String)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html contentDescription)` Sets the content description associated with this element. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 0) https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setContentDescription(androidx.wear.protolayout.TypeBuilders.StringProp)( @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/TypeBuilders.StringProp contentDescription )` Sets the content description associated with this element. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 600) https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setHeading(boolean)(boolean heading)` Sets whether this element should be marked as heading for accessibility. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setRole(int)(int role)` Sets the type of user interface element. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder` | `@https://developer.android.com/reference/androidx/wear/protolayout/expression/RequiresSchemaVersion(major = 1, minor = 200) https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder#setStateDescription(androidx.wear.protolayout.TypeBuilders.StringProp)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/wear/protolayout/TypeBuilders.StringProp stateDescription)` Sets the localized state description of the semantics node. |

## Public constructors

### Builder

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public Builder()
```

Creates an instance of `https://developer.android.com/reference/androidx/wear/protolayout/ModifiersBuilders.Semantics.Builder`.

## Public methods

### build

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
public @NonNull ModifiersBuilders.Semantics build()
```

Builds an instance from accumulated values.

### setContentDescription

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Semantics.Builder setContentDescription(@NonNull String contentDescription)
```

Sets the content description associated with this element. This will be dictated when the element is focused by the screen reader.

### setContentDescription

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 0)
public @NonNull ModifiersBuilders.Semantics.Builder setContentDescription(
    @NonNull TypeBuilders.StringProp contentDescription
)
```

Sets the content description associated with this element. This will be dictated when the element is focused by the screen reader.

While this field is statically accessible from 1.0, it's only bindable since version 1.2 and renderers supporting version 1.2 will use the dynamic value (if set).

### setHeading

Added in [1.4.2](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.4.2)

```
@RequiresSchemaVersion(major = 1, minor = 600)
public @NonNull ModifiersBuilders.Semantics.Builder setHeading(boolean heading)
```

Sets whether this element should be marked as heading for accessibility. Defaults to false.

### setRole

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull ModifiersBuilders.Semantics.Builder setRole(int role)
```

Sets the type of user interface element. Accessibility services might use this to describe the element or do customizations.

### setStateDescription

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-protolayout#1.0.0)

```
@RequiresSchemaVersion(major = 1, minor = 200)
public @NonNull ModifiersBuilders.Semantics.Builder setStateDescription(@NonNull TypeBuilders.StringProp stateDescription)
```

Sets the localized state description of the semantics node. For example: "on" or "off". This will be dictated when the element is focused by the screen reader.

This field is bindable and will use the dynamic value (if set).