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

SemanticsSelector

public final class SemanticsSelector


Projects the given set of nodes to a new set of nodes.

Summary

Public constructors

SemanticsSelector(
    @NonNull String description,
    boolean requiresExactlyOneNode,
    SemanticsSelector chainedInputSelector,
    @NonNull Function1<@NonNull Iterable<@NonNull SemanticsNode>, @NonNull SelectionResult> selector
)

Public methods

final @NonNull String

Description that is displayed to the developer in error outputs.

final @NonNull SelectionResult
map(
    @NonNull Iterable<@NonNull SemanticsNode> nodes,
    @NonNull String errorOnFail
)

Maps the given list of nodes to a new list of nodes.

Public constructors

SemanticsSelector

public SemanticsSelector(
    @NonNull String description,
    boolean requiresExactlyOneNode,
    SemanticsSelector chainedInputSelector,
    @NonNull Function1<@NonNull Iterable<@NonNull SemanticsNode>, @NonNull SelectionResult> selector
)
Parameters
@NonNull String description

Description that is displayed to the developer in error outputs.

boolean requiresExactlyOneNode

Whether this selector should expect to receive exactly 1 node.

SemanticsSelector chainedInputSelector

Optional selector to apply before this selector gets applied.

@NonNull Function1<@NonNull Iterable<@NonNull SemanticsNode>, @NonNull SelectionResult> selector

The lambda that implements the projection.

Public methods

getDescription

public final @NonNull String getDescription()

Description that is displayed to the developer in error outputs.

map

public final @NonNull SelectionResult map(
    @NonNull Iterable<@NonNull SemanticsNode> nodes,
    @NonNull String errorOnFail
)

Maps the given list of nodes to a new list of nodes.

Throws
kotlin.AssertionError

if required prerequisites to perform the selection were not satisfied.