GlanceNodeMatcher

class GlanceNodeMatcher<R : Any?>


Wrapper for matcher lambdas and related details

Summary

Public constructors

<R : Any?> GlanceNodeMatcher(
    description: String,
    matcher: (GlanceNode<R>) -> Boolean
)

Public functions

infix GlanceNodeMatcher<R>

Returns whether the given node is matched by this and the other matcher.

Boolean
matches(node: GlanceNode<R>)

Returns whether the given node is matched by this matcher.

Boolean

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

operator GlanceNodeMatcher<R>
not()

Returns whether the given node does not match the matcher.

infix GlanceNodeMatcher<R>
or(other: GlanceNodeMatcher<R>)

Returns whether the given node is matched by this or the other matcher.

Public constructors

GlanceNodeMatcher

<R : Any?> GlanceNodeMatcher(
    description: String,
    matcher: (GlanceNode<R>) -> Boolean
)
Parameters
description: String

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

matcher: (GlanceNode<R>) -> Boolean

a lambda performing the actual logic of matching on the GlanceNode

Public functions

and

Added in 1.1.1
infix fun and(other: GlanceNodeMatcher<R>): GlanceNodeMatcher<R>

Returns whether the given node is matched by this and the other matcher.

Parameters
other: GlanceNodeMatcher<R>

matcher that should also match in addition to current matcher

matches

Added in 1.1.1
fun matches(node: GlanceNode<R>): Boolean

Returns whether the given node is matched by this matcher.

matchesAny

fun matchesAny(nodes: Iterable<GlanceNode<R>>): Boolean

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

not

Added in 1.1.1
operator fun not(): GlanceNodeMatcher<R>

Returns whether the given node does not match the matcher.

or

Added in 1.1.1
infix fun or(other: GlanceNodeMatcher<R>): GlanceNodeMatcher<R>

Returns whether the given node is matched by this or the other matcher.

Parameters
other: GlanceNodeMatcher<R>

matcher that can be tested to match if the current matcher doesn't.