Uses of Class
org.junit.platform.commons.function.Try
Packages that use Try
Package
Description
Maintained functional interfaces and support classes.
Maintained common support APIs provided by the JUnit Platform.
Internal common utilities for JUnit.
-
Uses of Try in org.junit.platform.commons.function
Methods in org.junit.platform.commons.function that return TryModifier and TypeMethodDescriptionabstract <U> Try
<U> 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> 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> Convert the supplied exception into a failedTry
.If thisTry
is a failure, call the suppliedConsumer
with the contained exception; otherwise, do nothing.If thisTry
is a success, call the suppliedConsumer
with the contained value; otherwise, do nothing.If thisTry
is a failure, call the supplied supplier and return the resultingTry
; if thisTry
is a success, do nothing.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 TryModifier and TypeMethodDescriptionabstract <U> Try
<U> If thisTry
is a success, apply the supplied function to its value and return the resultingTry
; if thisTry
is a failure, do nothing.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 TryModifier and TypeMethodDescriptionReflectionSupport.tryToLoadClass
(String name) Try to load a class by its primitive name or fully qualified name, using the defaultClassLoader
.ReflectionSupport.tryToLoadClass
(String name, ClassLoader classLoader) Try to load a class by its primitive name or fully qualified name, using the suppliedClassLoader
.ReflectionSupport.tryToReadFieldValue
(Field field, Object instance) Try to read the value of a potentially inaccessible field. -
Uses of Try in org.junit.platform.commons.util
Methods in org.junit.platform.commons.util that return TryModifier and TypeMethodDescriptionReflectionUtils.tryToGetMethod
(Class<?> clazz, String methodName, Class<?>... parameterTypes) Try to get theMethod
in the specified class with the specified name and parameter types.ReflectionUtils.tryToLoadClass
(String name) ReflectionUtils.tryToLoadClass
(String name, ClassLoader classLoader) Try to load a class by its primitive name or fully qualified name, using the suppliedClassLoader
.ReflectionUtils.tryToReadFieldValue
(Class<T> clazz, String fieldName, T instance) Try to read the value of a potentially inaccessible or nonexistent field.ReflectionUtils.tryToReadFieldValue
(Field field) Try to read the value of a potentially inaccessible static field.ReflectionUtils.tryToReadFieldValue
(Field field, Object instance)