Package com.jnape.palatable.lambda.adt
Class Try.Success<A>
- java.lang.Object
-
- com.jnape.palatable.lambda.adt.Try<A>
-
- com.jnape.palatable.lambda.adt.Try.Success<A>
-
- All Implemented Interfaces:
CoProduct2<java.lang.Throwable,A,Try<A>>,Applicative<A,Try<?>>,Functor<A,Try<?>>,Monad<A,Try<?>>,MonadError<java.lang.Throwable,A,Try<?>>,MonadRec<A,Try<?>>,Traversable<A,Try<?>>
private static final class Try.Success<A> extends Try<A>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)inthashCode()<R> Rmatch(Fn1<? super java.lang.Throwable,? extends R> aFn, Fn1<? super A,? extends R> bFn)Type-safe convergence requiring a match against all potential types.<T extends java.lang.Throwable>
AorThrow(Fn1<? super java.lang.Throwable,? extends T> fn)If this is a success value, return it.java.lang.StringtoString()-
Methods inherited from class com.jnape.palatable.lambda.adt.Try
catchError, catching, catching, discardL, discardR, ensuring, failure, flatMap, fmap, forfeit, lazyZip, orThrow, pure, pureTry, recover, success, throwError, toEither, toEither, toMaybe, trampolineM, traverse, trying, trying, withResources, withResources, withResources, zip
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
a
private final A a
-
-
Constructor Detail
-
Success
private Success(A a)
-
-
Method Detail
-
orThrow
public <T extends java.lang.Throwable> A orThrow(Fn1<? super java.lang.Throwable,? extends T> fn)
Description copied from class:TryIf this is a success value, return it. Otherwise, transform the captured failure withfnand throw the result.
-
match
public <R> R match(Fn1<? super java.lang.Throwable,? extends R> aFn, Fn1<? super A,? extends R> bFn)
Description copied from interface:CoProduct2Type-safe convergence requiring a match against all potential types.- Type Parameters:
R- result type- Parameters:
aFn- morphismA -> RbFn- morphismB -> R- Returns:
- the result of applying the appropriate morphism to this coproduct's unwrapped value
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-