MaybeImpl<T> extension
Impl for Maybe
- on
-
- Maybe<
T> ?
- Maybe<
Properties
Methods
-
and<
U> (Maybe< U> ? other) → Maybe<U> ? - Returns None if the this is None, otherwise returns other
-
andThen<
U> (Maybe< U> ? f(T val)) → Maybe<U> ? - Returns None if the this is None, otherwise calls f with the wrapped value and returns the result
-
defaultVal(
T v) → Maybe< T> ? -
Set a default value when it is None(
null
) -
defaultValFn(
T fn()) → Maybe< T> ? -
Set a default value when it is None(
null
) -
flatMap<
U> (Maybe< U> ? f(T val)) → Maybe<U> ? - Returns None if the this is None, otherwise calls f with the wrapped value and returns the result
-
map<
U> (U f(T val)) → Maybe< U> ? - Maps an Maybe
-
none<
R> (R none()) → Maybe< R> ? - When it not has Value Return Some(none(it))
-
or(
Maybe< T> ? other) → Maybe<T> ? - Returns this if this contains a value, otherwise returns other
-
orElse(
Maybe< T> ? f()) → Maybe<T> ? - Returns this if this contains a value, otherwise calls f and returns the result
-
some<
R> (R some(T val)) → Maybe< R> ? - fMap
-
then<
U> (U f(T val)) → Maybe< U> ? - Maps an Maybe
-
when<
R> ({R some(T val)?, R none()?}) → Maybe< R> ? - Pattern matching
-
xor(
Maybe< T> ? other) → Maybe<T> ? - Returns Some if exactly one of this, other is Some, otherwise returns None