-
public final class ExtensionsKt
-
-
Method Summary
Modifier and Type Method Description final <A extends Any> EOr<A>flatMapError(EOr<A> $self, Function1<E, EOr<A>> f)Computes a new EOr using E in this, if it exists, with given flat mapping function final <A extends Any> AgetOrElse(EOr<A> $self, Function0<A> default)Gets the value in this or falls back to given default value final <A extends Any> EOr<A>orElse(EOr<A> $self, Function0<EOr<A>> alternative)Provides an alternative EOr if this one has E, ignoring the E final <A extends Any> EOr<A>toEOr(A $self)Converts this value to a successful EOr final <A extends Any> EOr<A>toEOr(A $self, Function0<E> ifNull)Constructs an EOr from this nullable value final <A extends Any> EOr<A>catching(Function0<A> $self, Function1<Throwable, E> ifFailure)Constructs an EOr from this computation that can throw final EtoE(Throwable $self, Function1<Throwable, E> f)Constructs an E from this [java.lang.Throwable] -
-
Method Detail
-
flatMapError
final <A extends Any> EOr<A> flatMapError(EOr<A> $self, Function1<E, EOr<A>> f)
Computes a new EOr using E in this, if it exists, with given flat mapping function- Parameters:
f- E flat mapping function
-
getOrElse
final <A extends Any> A getOrElse(EOr<A> $self, Function0<A> default)
Gets the value in this or falls back to given default value- Parameters:
default- Default value to use in case this has E
-
orElse
final <A extends Any> EOr<A> orElse(EOr<A> $self, Function0<EOr<A>> alternative)
Provides an alternative EOr if this one has E, ignoring the E- Parameters:
alternative- Alternative EOr in case this one has E
-
toEOr
final <A extends Any> EOr<A> toEOr(A $self, Function0<E> ifNull)
Constructs an EOr from this nullable value- Parameters:
ifNull- An E to use in case this value is null
-
catching
final <A extends Any> EOr<A> catching(Function0<A> $self, Function1<Throwable, E> ifFailure)
Constructs an EOr from this computation that can throw- Parameters:
ifFailure- An E conversion function
-
-
-
-