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

ofNullable

@NonNull open static fun <B : Any!> ofNullable(@Nullable value: B?): Maybe<B>

Creates a Maybe from a given value. If the value is null a Nothing will be created.

Parameters

value - B?: value from which Maybe is created.

- type of the stored value.

Return
Maybe<B>: instance of Just or Nothing if value is null.