sdk-common / com.tomtom.online.sdk.common.functional / Maybe / filter

filter

@NonNull abstract fun filter(@NonNull predicate: Predicate<in A>): Maybe<A>

Returns a Nothing if this Maybe represents a missing value. Returns a Nothing if the value does not satisfy the predicate or an Exception is thrown when testing the predicate. Returns Just otherwise.

Parameters

predicate - Predicate<in A>: used to check the value.

Return
Maybe<A>: a Maybe instance.