{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

SemanticsConfiguration

public final class SemanticsConfiguration implements SemanticsPropertyReceiver, Iterable


Describes the semantic information associated with the owning component

The information provided in the configuration is used to to generate the semantics tree.

Summary

Public constructors

Public methods

final boolean
final @NonNull SemanticsConfiguration

Returns an exact copy of this configuration.

boolean
equals(Object other)
final @NonNull T
<T extends Object> get(@NonNull SemanticsPropertyKey<@NonNull T> key)

Retrieves the value for the given property, if one has been set.

final @NonNull T
<T extends Object> getOrElse(
    @NonNull SemanticsPropertyKey<@NonNull T> key,
    @NonNull Function0<@NonNull T> defaultValue
)
final T
<T extends Object> getOrElseNullable(
    @NonNull SemanticsPropertyKey<@NonNull T> key,
    @NonNull Function0<T> defaultValue
)
int
final boolean
final boolean

Whether the semantic information provided by the owning component and all of its descendants should be treated as one logical entity.

@NonNull Iterator<@NonNull Map.Entry<@NonNull SemanticsPropertyKey<@NonNull ?>, Object>>
void
<T extends Object> set(@NonNull SemanticsPropertyKey<@NonNull T> key, @NonNull T value)
final void
setClearingSemantics(boolean isClearingSemantics)
final void
setMergingSemanticsOfDescendants(
    boolean isMergingSemanticsOfDescendants
)

Whether the semantic information provided by the owning component and all of its descendants should be treated as one logical entity.

@NonNull String

Extension functions

final T

Public constructors

SemanticsConfiguration

public SemanticsConfiguration()

Public methods

contains

public final boolean <T extends Object> contains(@NonNull SemanticsPropertyKey<@NonNull T> key)

copy

public final @NonNull SemanticsConfiguration copy()

Returns an exact copy of this configuration.

equals

public boolean equals(Object other)

get

public final @NonNull T <T extends Object> get(@NonNull SemanticsPropertyKey<@NonNull T> key)

Retrieves the value for the given property, if one has been set. If a value has not been set, throws IllegalStateException

getOrElse

public final @NonNull T <T extends Object> getOrElse(
    @NonNull SemanticsPropertyKey<@NonNull T> key,
    @NonNull Function0<@NonNull T> defaultValue
)

getOrElseNullable

public final T <T extends Object> getOrElseNullable(
    @NonNull SemanticsPropertyKey<@NonNull T> key,
    @NonNull Function0<T> defaultValue
)

hashCode

public int hashCode()

isClearingSemantics

public final boolean isClearingSemantics()

isMergingSemanticsOfDescendants

public final boolean isMergingSemanticsOfDescendants()

Whether the semantic information provided by the owning component and all of its descendants should be treated as one logical entity.

If set to true, the descendants of the owning component's SemanticsNode will merge their semantic information into the SemanticsNode representing the owning component.

iterator

public @NonNull Iterator<@NonNull Map.Entry<@NonNull SemanticsPropertyKey<@NonNull ?>, Object>> iterator()

set

public void <T extends Object> set(@NonNull SemanticsPropertyKey<@NonNull T> key, @NonNull T value)

setClearingSemantics

public final void setClearingSemantics(boolean isClearingSemantics)

setMergingSemanticsOfDescendants

public final void setMergingSemanticsOfDescendants(
    boolean isMergingSemanticsOfDescendants
)

Whether the semantic information provided by the owning component and all of its descendants should be treated as one logical entity.

If set to true, the descendants of the owning component's SemanticsNode will merge their semantic information into the SemanticsNode representing the owning component.

toString

public @NonNull String toString()

Extension functions

SemanticsConfigurationKt.getOrNull

public final T <T extends Object> SemanticsConfigurationKt.getOrNull(
    @NonNull SemanticsConfiguration receiver,
    @NonNull SemanticsPropertyKey<@NonNull T> key
)