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

SemanticsMatcher

public final class SemanticsMatcher


Wrapper for semantics matcher lambdas that allows to build string explaining to the developer what conditions were being tested.

Summary

Nested types

public static class SemanticsMatcher.Companion

Public constructors

SemanticsMatcher(
    @NonNull String description,
    @NonNull Function1<@NonNull SemanticsNode, @NonNull Boolean> matcher
)

Public methods

final @NonNull SemanticsMatcher
final @NonNull String
final boolean

Returns whether the given node is matched by this matcher.

final boolean

Returns whether at least one of the given nodes is matched by this matcher.

final @NonNull SemanticsMatcher
not()
final @NonNull SemanticsMatcher

Public constructors

SemanticsMatcher

public SemanticsMatcher(
    @NonNull String description,
    @NonNull Function1<@NonNull SemanticsNode, @NonNull Boolean> matcher
)

Public methods

and

public final @NonNull SemanticsMatcher and(@NonNull SemanticsMatcher other)

getDescription

public final @NonNull String getDescription()

matches

public final boolean matches(@NonNull SemanticsNode node)

Returns whether the given node is matched by this matcher.

matchesAny

public final boolean matchesAny(@NonNull Iterable<@NonNull SemanticsNode> nodes)

Returns whether at least one of the given nodes is matched by this matcher.

not

public final @NonNull SemanticsMatcher not()

or

public final @NonNull SemanticsMatcher or(@NonNull SemanticsMatcher other)