public final class LayoutElementMatcher


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

Summary

Public constructors

Constructor for the Wrapper of element matcher lambdas that allows to build string explaining to the developer what conditions are being tested.

Public methods

final @NonNull LayoutElementMatcher

Returns whether the given element is matched by both this and the other mather.

final @NonNull LayoutElementMatcher
not()

Returns whether the given element does not match the matcher.

final @NonNull LayoutElementMatcher

Returns whether the given element is matched by this or the other mather.

Public constructors

LayoutElementMatcher

Added in 1.3.0-alpha09
public LayoutElementMatcher(
    @NonNull String description,
    @NonNull Function1<@NonNull LayoutElementBuilders.LayoutElement, @NonNull Boolean> matcher
)

Constructor for the Wrapper of element matcher lambdas that allows to build string explaining to the developer what conditions are being tested.

Parameters
@NonNull String description

a string explaining to the developer what conditions were being tested.

@NonNull Function1<@NonNull LayoutElementBuilders.LayoutElement, @NonNull Boolean> matcher

a lambda performing the actual logic of matching on the layout element.

LayoutElementMatcher

Added in 1.3.0-alpha09
public LayoutElementMatcher(
    @NonNull String description,
    @NonNull Function2<@NonNull LayoutElementBuilders.LayoutElement, @NonNull TestContext, @NonNull Boolean> matcher
)
Parameters
@NonNull String description

a string explaining to the developer what conditions were being tested.

@NonNull Function2<@NonNull LayoutElementBuilders.LayoutElement, @NonNull TestContext, @NonNull Boolean> matcher

a lambda performing the actual logic of matching on the layout element, with a TextContext accessible for retrieving context data such as the dynamic data map for evaluating the dynamic values.

Public methods

and

Added in 1.3.0-alpha09
public final @NonNull LayoutElementMatcher and(@NonNull LayoutElementMatcher other)

Returns whether the given element is matched by both this and the other mather.

Parameters
@NonNull LayoutElementMatcher other

mather that should also match in addition to current matcher.

not

Added in 1.3.0-alpha09
public final @NonNull LayoutElementMatcher not()

Returns whether the given element does not match the matcher.

or

Added in 1.3.0-alpha09
public final @NonNull LayoutElementMatcher or(@NonNull LayoutElementMatcher other)

Returns whether the given element is matched by this or the other mather.

Parameters
@NonNull LayoutElementMatcher other

mather that can be tested to match if the current matcher does not.