Uses of Class
org.junit.platform.commons.function.Try
-
Packages that use Try Package Description org.junit.platform.commons.function Maintained functional interfaces and support classes.org.junit.platform.commons.support Maintained common support APIs provided by the JUnit Platform.org.junit.platform.commons.util Internal common utilities for JUnit. -
-
Uses of Try in org.junit.platform.commons.function
Methods in org.junit.platform.commons.function that return Try Modifier and Type Method Description abstract <U> Try<U>
Try. andThen(Function<V,Try<U>> function)
If thisTry
is a success, apply the supplied function to its value and return the resultingTry
; if thisTry
is a failure, do nothing.abstract <U> Try<U>
Try. andThenTry(Try.Transformer<V,U> transformer)
If thisTry
is a success, apply the supplied transformer to its value and return a new successful or failedTry
depending on the transformer's outcome; if thisTry
is a failure, do nothing.static <V> Try<V>
Try. call(Callable<V> action)
Call the suppliedCallable
and return a successfulTry
that contains the returned value or, in case an exception was thrown, a failedTry
that contains the exception.static <V> Try<V>
Try. failure(Exception cause)
Convert the supplied exception into a failedTry
.abstract Try<V>
Try. ifFailure(Consumer<Exception> causeConsumer)
If thisTry
is a failure, call the suppliedConsumer
with the contained exception; otherwise, do nothing.abstract Try<V>
Try. ifSuccess(Consumer<V> valueConsumer)
If thisTry
is a success, call the suppliedConsumer
with the contained value; otherwise, do nothing.abstract Try<V>
Try. orElse(Supplier<Try<V>> supplier)
If thisTry
is a failure, call the supplied supplier and return the resultingTry
; if thisTry
is a success, do nothing.abstract Try<V>
Try. orElseTry(Callable<V> action)
If thisTry
is a failure, call the supplied action and return a new successful or failedTry
depending on the action's outcome; if thisTry
is a success, do nothing.static <V> Try<V>
Try. success(V value)
Convert the supplied value into a succeededTry
.Method parameters in org.junit.platform.commons.function with type arguments of type Try Modifier and Type Method Description abstract <U> Try<U>
Try. andThen(Function<V,Try<U>> function)
If thisTry
is a success, apply the supplied function to its value and return the resultingTry
; if thisTry
is a failure, do nothing.abstract Try<V>
Try. orElse(Supplier<Try<V>> supplier)
If thisTry
is a failure, call the supplied supplier and return the resultingTry
; if thisTry
is a success, do nothing. -
Uses of Try in org.junit.platform.commons.support
Methods in org.junit.platform.commons.support that return Try Modifier and Type Method Description static Try<Class<?>>
ReflectionSupport. tryToLoadClass(String name)
Try to load a class by its primitive name or fully qualified name, using the defaultClassLoader
. -
Uses of Try in org.junit.platform.commons.util
Methods in org.junit.platform.commons.util that return Try Modifier and Type Method Description static Try<Method>
ReflectionUtils. tryToGetMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes)
Try to get theMethod
in the specified class with the specified name and parameter types.static Try<Class<?>>
ReflectionUtils. tryToLoadClass(String name)
static Try<Class<?>>
ReflectionUtils. tryToLoadClass(String name, ClassLoader classLoader)
Try to load a class by its primitive name or fully qualified name, using the suppliedClassLoader
.static <T> Try<Object>
ReflectionUtils. tryToReadFieldValue(Class<T> clazz, String fieldName, T instance)
Try to read the value of a potentially inaccessible or nonexistent field.static Try<Object>
ReflectionUtils. tryToReadFieldValue(Field field)
Try to read the value of a potentially inaccessible static field.static Try<Object>
ReflectionUtils. tryToReadFieldValue(Field field, Object instance)
Try to read the value of a potentially inaccessible field.
-