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
Subclasses of Try in org.junit.platform.commons.function Modifier and Type Class Description private static class
Try.Failure<V>
private static class
Try.Success<V>
Methods in org.junit.platform.commons.function that return Try Modifier and Type Method Description abstract <U> Try<U>
Try. andThen(java.util.function.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.<U> Try<U>
Try.Failure. andThen(java.util.function.Function<V,Try<U>> function)
<U> Try<U>
Try.Success. andThen(java.util.function.Function<V,Try<U>> function)
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.<U> Try<U>
Try.Failure. andThenTry(Try.Transformer<V,U> transformer)
<U> Try<U>
Try.Success. andThenTry(Try.Transformer<V,U> transformer)
static <V> Try<V>
Try. call(java.util.concurrent.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(java.lang.Exception cause)
Convert the supplied exception into a failedTry
.Try<V>
Try.Failure. ifFailure(java.util.function.Consumer<java.lang.Exception> causeConsumer)
abstract Try<V>
Try. ifFailure(java.util.function.Consumer<java.lang.Exception> causeConsumer)
If thisTry
is a failure, call the suppliedConsumer
with the contained exception; otherwise, do nothing.Try<V>
Try.Success. ifFailure(java.util.function.Consumer<java.lang.Exception> causeConsumer)
Try<V>
Try.Failure. ifSuccess(java.util.function.Consumer<V> valueConsumer)
abstract Try<V>
Try. ifSuccess(java.util.function.Consumer<V> valueConsumer)
If thisTry
is a success, call the suppliedConsumer
with the contained value; otherwise, do nothing.Try<V>
Try.Success. ifSuccess(java.util.function.Consumer<V> valueConsumer)
private static <V> Try<V>
Try. of(java.util.concurrent.Callable<Try<V>> action)
Try<V>
Try.Failure. orElse(java.util.function.Supplier<Try<V>> supplier)
abstract Try<V>
Try. orElse(java.util.function.Supplier<Try<V>> supplier)
If thisTry
is a failure, call the supplied supplier and return the resultingTry
; if thisTry
is a success, do nothing.Try<V>
Try.Success. orElse(java.util.function.Supplier<Try<V>> supplier)
Try<V>
Try.Failure. orElseTry(java.util.concurrent.Callable<V> action)
abstract Try<V>
Try. orElseTry(java.util.concurrent.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.Try<V>
Try.Success. orElseTry(java.util.concurrent.Callable<V> action)
static <V> Try<V>
Try. success(V value)
Convert the supplied value into a succeededTry
.private <U> Try<U>
Try.Failure. uncheckedCast()
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(java.util.function.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.<U> Try<U>
Try.Failure. andThen(java.util.function.Function<V,Try<U>> function)
<U> Try<U>
Try.Success. andThen(java.util.function.Function<V,Try<U>> function)
private static <V> Try<V>
Try. of(java.util.concurrent.Callable<Try<V>> action)
Try<V>
Try.Failure. orElse(java.util.function.Supplier<Try<V>> supplier)
abstract Try<V>
Try. orElse(java.util.function.Supplier<Try<V>> supplier)
If thisTry
is a failure, call the supplied supplier and return the resultingTry
; if thisTry
is a success, do nothing.Try<V>
Try.Success. orElse(java.util.function.Supplier<Try<V>> supplier)
-
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<java.lang.Class<?>>
ReflectionSupport. tryToLoadClass(java.lang.String name)
Try to load a class by its primitive name or fully qualified name, using the defaultClassLoader
.static Try<java.lang.Object>
ReflectionSupport. tryToReadFieldValue(java.lang.reflect.Field field, java.lang.Object instance)
Try to read the value of a potentially inaccessible field. -
Uses of Try in org.junit.platform.commons.util
Fields in org.junit.platform.commons.util with type parameters of type Try Modifier and Type Field Description private java.util.function.BiFunction<java.lang.String,java.lang.ClassLoader,Try<java.lang.Class<?>>>
ClasspathScanner. loadClass
Methods in org.junit.platform.commons.util that return Try Modifier and Type Method Description static Try<java.lang.reflect.Method>
ReflectionUtils. tryToGetMethod(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>... parameterTypes)
Try to get theMethod
in the specified class with the specified name and parameter types.static Try<java.lang.Class<?>>
ReflectionUtils. tryToLoadClass(java.lang.String name)
static Try<java.lang.Class<?>>
ReflectionUtils. tryToLoadClass(java.lang.String name, java.lang.ClassLoader classLoader)
Try to load a class by its primitive name or fully qualified name, using the suppliedClassLoader
.static <T> Try<java.lang.Object>
ReflectionUtils. tryToReadFieldValue(java.lang.Class<T> clazz, java.lang.String fieldName, T instance)
Try to read the value of a potentially inaccessible or nonexistent field.static Try<java.lang.Object>
ReflectionUtils. tryToReadFieldValue(java.lang.reflect.Field field)
Try to read the value of a potentially inaccessible static field.static Try<java.lang.Object>
ReflectionUtils. tryToReadFieldValue(java.lang.reflect.Field field, java.lang.Object instance)
Constructor parameters in org.junit.platform.commons.util with type arguments of type Try Constructor Description ClasspathScanner(java.util.function.Supplier<java.lang.ClassLoader> classLoaderSupplier, java.util.function.BiFunction<java.lang.String,java.lang.ClassLoader,Try<java.lang.Class<?>>> loadClass)
-