ScopeScrewdriver<T> extension
provides scope functions as extensions on T
- on
-
- T
Methods
-
apply(
void block(T obj)) → T -
Calls the specified function
block
withthis
value as its argument and returnsthis
value. -
pairWith<
V> (V value) → Pair< T, V> - alias for to
-
run<
R> (R block(T obj)) → R -
Calls the specified function
block
withthis
value as its argument and returnsthis
value. -
takeIf(
bool predicate(T obj)) → T? -
Returns this if it satisfies the given
predicate
or null, if it doesn't. -
takeUnless(
bool predicate(T obj)) → T? -
Returns this if it doesn't satisfy the given
predicate
or null, if it doesn't. -
to<
V> (V value) → Pair< T, V> -
pairs this with given
value
and returns an instance of Pair