Additional top-level class in compilation unit: TryModule.
The following exceptions are considered to be fatal/non-recoverable:
Important Note
Try may re-throw (undeclared) exceptions, e.g. on get(). From within a
dynamic proxy java. this will lead to an
java.. For more information, please read
Dynamic Proxy Classes.
| Modifier and Type | Class and Description |
|---|---|
| public static class | |
| public static class | |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable>A |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable>A |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable>A |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable>A |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable>A |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable, Type of the 6th resource. T6 extends AutoCloseable>A |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable, Type of the 6th resource. T6 extends AutoCloseable, Type of the 7th resource. T7 extends AutoCloseable>A |
| public static class | Try.
Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable, Type of the 6th resource. T6 extends AutoCloseable, Type of the 7th resource. T7 extends AutoCloseable, Type of the 8th resource. T8 extends AutoCloseable>A |
| Modifier and Type | Field and Description |
|---|---|
| public static final long |
| Modifier and Type | Method and Description |
|---|---|
| public default Try | Returns: thisTry.A runnable runnable)Provides try's finally behavior no matter what the result of the operation is. |
| public default Try | Returns: thisTry.A runnable runnable)Provides try's finally behavior no matter what the result of the operation is. |
| public default Try | Returns: thisTry if this is a Failure or the consumer succeeded, otherwise the
Failure of the consumption.A consumer consumer)Shortcut for |
| public default Try | Returns: thisTry if this is a Failure or the runnable succeeded, otherwise the
Failure of the run.A runnable runnable)Shortcut for |
| public default Try | Returns: thisTry if this is a Failure or the consumer succeeded, otherwise the
Failure of the consumption.A checked consumer consumer)Passes the result to the given |
| public default Try | Returns: thisTry if this is a Failure or the runnable succeeded, otherwise the
Failure of the run.A checked runnable runnable)Runs the given runnable if this is a |
| public default < The new value type R> Try | Returns: A newTry instance containing value of type RA function that is not necessarily defined on value of this try. partialFunction)Collects value that is in the domain of the given |
| public boolean | equals(Object
An object o)Redeclares io. Clarifies that values have a proper equals() method implemented. |
| public default Try | Returns: a new TryReturns |
| public static < Component type of the T> TryTry. | |
| public default Try | Returns: aTry instanceA predicate predicate, Supplier<? extends Throwable> A supplier of a throwable throwableSupplier)Shortcut for |
| public default Try | Returns: aTry instanceA predicate predicate, Function<? super T, ? extends Throwable> A function that provides some kind of Throwable for T errorProvider)Shortcut for |
| public default Try | Returns: aTry instanceA predicate predicate)Shortcut for |
| public default Try | Returns: aTry instanceA checked predicate predicate, Supplier<? extends Throwable> A supplier of a throwable throwableSupplier)Returns |
| public default Try | Returns: aTry instanceA checked predicate predicate, CheckedFunction1<? super T, ? extends Throwable> A provider of a throwable errorProvider)Returns |
| public default Try | Returns: aTry instanceA checked predicate predicate)Returns |
| public default < The new component type U> Try | Returns: aTryA mapper mapper)Shortcut for |
| public default < The new component type U> Try | Returns: aTryA mapper mapper)FlatMaps the value of a Success or returns a Failure. |
| public default < type of the folded value X> X | |
| public T | Returns: The result of thisTry.Redeclares io. Gets the result of this Try if this is a |
| public Throwable | Returns: The cause if this is a FailureGets the cause if this is a Failure or throws if this is a Success. |
| public default T | |
| public default <X extends Throwable> T | |
| public int | hashCode()
Redeclares io. Clarifies that values have a proper hashCode() method implemented. |
| public default boolean | |
| public boolean | Returns: true if this is a Failure, returns false if this is a Success.Redeclares io. Checks whether this Try has no result, i.e. is a Failure. |
| public boolean | Returns: true, if this is a Failure, otherwise false, if this is a SuccessChecks if this is a Failure. |
| public default boolean | |
| public default boolean | |
| public boolean | Returns: true, if this is a Success, otherwise false, if this is a FailureChecks if this is a Success. |
| public default Iterator | |
| public default < The new component type U> Try | Returns: aTryA checked function mapper)Implements io. Shortcut for |
| public default Try | Returns: A newTry if this is a Failure, otherwise this.A not necessarily exhaustive sequence of cases that will be matched against a cause. casesMaps the cause to a new exception if this is a |
| public default < The new component type U> Try | Returns: aTryA checked function mapper)Runs the given checked function if this is a |
| public static < Component type of the T> TryTry. | |
| public static < Component type T> Try | Returns: Success(supplier.apply()) if no exception occurs, otherwise Failure(throwable) if an
exception occurs calling supplier.apply().A checked supplier supplier)Creates a Try of a CheckedFunction0. |
| public static < Component type T> Try | Returns: Success(callable.call()) if no exception occurs, otherwise Failure(throwable) if an
exception occurs calling callable.call().A callable callable)Creates a Try of a Callable. |
| public static < Component type T> Try | Returns: Success(supplier.get()) if no exception occurs, otherwise Failure(throwable) if an
exception occurs calling supplier.get().A supplier supplier)Creates a Try of a Supplier. |
| public default Try | Returns: thisAn exception consumer action)Consumes the cause if this is a |
| public default < the exception type that should be handled X extends Throwable> Try | Returns: thisthe exception type that is handled exceptionType, Consumer<? super X> an excpetion consumer action)Consumes the cause if this is a |
| public default Try | Returns: thisA value consumer action)Consumes the value if this is a |
| public default Try | |
| public default Try | |
| public default void | |
| public default Try | Returns: thisTryA Consumer action)Implements io. Applies the action to the value of a Success or does nothing in the case of a Failure. |
| public default < Exception type X extends Throwable> Try | |
| public default < Exception type X extends Throwable> Try | Returns: aTryThe specific exception type that should be handled exceptionType, T A value that is used in case of a recovery value)Returns |
| public default Try | |
| public default < Exception type X extends Throwable> Try | Returns: aTryThe specific exception type that should be handled exceptionType, Function<? super X, Try<? extends T>> A recovery function taking an exception of type f)X and returning Try as a result of recovery.
If Try is Try#isSuccess() then recovery ends up successfully. Otherwise the function was not able to recover.Returns |
| public default < type of the exception that should be recovered X extends Throwable> Try | recoverWith(Class<X>
the exception type that is recovered exceptionType, Try<? extends T> the substitute for a matching recovered)FailureRecovers this |
| public default Try | Returns: aTryA recovery function taking a Throwable f)Returns |
| public static Try | Returns: Success(null) if no exception occurs, otherwise Failure(throwable) if an exception occurs
calling runnable.run().A checked runnable runnable)Creates a Try of a CheckedRunnable. |
| public static Try | Returns: Success(null) if no exception occurs, otherwise Failure(throwable) if an exception occurs
calling runnable.run().A runnable runnable)Creates a Try of a Runnable. |
| public static < type of the Trys T> Try | |
| public static < Type of the given T> Tryvalue. | |
| public default Either | |
| public String | toString()
Redeclares io. Clarifies that values have a proper toString() method implemented. |
| public default Validation | |
| public default < result type of the throwable mapper U> Validation | Returns: A newValidationA transformation from throwable to desired invalid type of new throwableMapper)ValidationOverrides default io. Converts this |
| public default < Type of transformation result U> U | |
| public static < The type of the given values. T, The mapped value type. U> Try | |
| public static < Type of the 1st resource. T1 extends AutoCloseable> Try. | Returns: a newWithResources1 instance.The supplier of the first resource. t1Supplier)Creates a |
| public static < Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable> Try. | Returns: a newWithResources2 instance.The supplier of the 1st resource. t1Supplier, CheckedFunction0<? extends T2> The supplier of the 2nd resource. t2Supplier)Creates a |
| public static < Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable> Try. | Returns: a newWithResources3 instance.The supplier of the 1st resource. t1Supplier, CheckedFunction0<? extends T2> The supplier of the 2nd resource. t2Supplier, CheckedFunction0<? extends T3> The supplier of the 3rd resource. t3Supplier)Creates a |
| public static < Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable> Try. | Returns: a newWithResources4 instance.The supplier of the 1st resource. t1Supplier, CheckedFunction0<? extends T2> The supplier of the 2nd resource. t2Supplier, CheckedFunction0<? extends T3> The supplier of the 3rd resource. t3Supplier, CheckedFunction0<? extends T4> The supplier of the 4th resource. t4Supplier)Creates a |
| public static < Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable> Try. | Returns: a newWithResources5 instance.The supplier of the 1st resource. t1Supplier, CheckedFunction0<? extends T2> The supplier of the 2nd resource. t2Supplier, CheckedFunction0<? extends T3> The supplier of the 3rd resource. t3Supplier, CheckedFunction0<? extends T4> The supplier of the 4th resource. t4Supplier, CheckedFunction0<? extends T5> The supplier of the 5th resource. t5Supplier)Creates a |
| public static < Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable, Type of the 6th resource. T6 extends AutoCloseable> Try. | Returns: a newWithResources6 instance.The supplier of the 1st resource. t1Supplier, CheckedFunction0<? extends T2> The supplier of the 2nd resource. t2Supplier, CheckedFunction0<? extends T3> The supplier of the 3rd resource. t3Supplier, CheckedFunction0<? extends T4> The supplier of the 4th resource. t4Supplier, CheckedFunction0<? extends T5> The supplier of the 5th resource. t5Supplier, CheckedFunction0<? extends T6> The supplier of the 6th resource. t6Supplier)Creates a |
| public static < Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable, Type of the 6th resource. T6 extends AutoCloseable, Type of the 7th resource. T7 extends AutoCloseable> Try. | Returns: a newWithResources7 instance.The supplier of the 1st resource. t1Supplier, CheckedFunction0<? extends T2> The supplier of the 2nd resource. t2Supplier, CheckedFunction0<? extends T3> The supplier of the 3rd resource. t3Supplier, CheckedFunction0<? extends T4> The supplier of the 4th resource. t4Supplier, CheckedFunction0<? extends T5> The supplier of the 5th resource. t5Supplier, CheckedFunction0<? extends T6> The supplier of the 6th resource. t6Supplier, CheckedFunction0<? extends T7> The supplier of the 7th resource. t7Supplier)Creates a |
| public static < Type of the 1st resource. T1 extends AutoCloseable, Type of the 2nd resource. T2 extends AutoCloseable, Type of the 3rd resource. T3 extends AutoCloseable, Type of the 4th resource. T4 extends AutoCloseable, Type of the 5th resource. T5 extends AutoCloseable, Type of the 6th resource. T6 extends AutoCloseable, Type of the 7th resource. T7 extends AutoCloseable, Type of the 8th resource. T8 extends AutoCloseable> Try. | Returns: a newWithResources8 instance.The supplier of the 1st resource. t1Supplier, CheckedFunction0<? extends T2> The supplier of the 2nd resource. t2Supplier, CheckedFunction0<? extends T3> The supplier of the 3rd resource. t3Supplier, CheckedFunction0<? extends T4> The supplier of the 4th resource. t4Supplier, CheckedFunction0<? extends T5> The supplier of the 5th resource. t5Supplier, CheckedFunction0<? extends T6> The supplier of the 6th resource. t6Supplier, CheckedFunction0<? extends T7> The supplier of the 7th resource. t7Supplier, CheckedFunction0<? extends T8> The supplier of the 8th resource. t8Supplier)Creates a |