mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-254537: Plow.mapNotNull added and used
GitOrigin-RevId: 8c34a6310781ebecc413ef3e73963a4a861f30f2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1ccb5ea4e3
commit
7c5adeccc8
@@ -42,6 +42,8 @@ class Plow<T> private constructor(private val producingFunction: (Processor<T>)
|
||||
Plow { pr -> producingFunction(transformation(pr)) }
|
||||
|
||||
fun <R> map(mapping: (T) -> R): Plow<R> = transform { pr -> Processor { v -> pr.process(mapping(v)) } }
|
||||
|
||||
fun <R> mapNotNull(mapping: (T) -> R?): Plow<R> = transform { pr -> Processor { v -> mapping(v)?.let { pr.process(it) } ?: true } }
|
||||
|
||||
fun filter(test: (T) -> Boolean): Plow<T> = transform { pr -> Processor { v -> !test(v) || pr.process(v) } }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user