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.
|
Modifier and Type | Class and Description |
---|---|
private static class |
Try.Failure<V> |
private static class |
Try.Success<V> |
Modifier and Type | Method and Description |
---|---|
abstract <U> Try<U> |
Try.andThen(java.util.function.Function<V,Try<U>> function)
If this
Try is a success, apply the supplied function to its
value and return the resulting Try ; if this Try is a
failure, do nothing. |
<U> Try<U> |
Try.Success.andThen(java.util.function.Function<V,Try<U>> function) |
<U> Try<U> |
Try.Failure.andThen(java.util.function.Function<V,Try<U>> function) |
abstract <U> Try<U> |
Try.andThenTry(Try.Transformer<V,U> transformer)
If this
Try is a success, apply the supplied transformer to its
value and return a new successful or failed Try depending on the
transformer's outcome; if this Try is a failure, do nothing. |
<U> Try<U> |
Try.Success.andThenTry(Try.Transformer<V,U> transformer) |
<U> Try<U> |
Try.Failure.andThenTry(Try.Transformer<V,U> transformer) |
static <V> Try<V> |
Try.call(java.util.concurrent.Callable<V> action)
Call the supplied
Callable and return a successful Try
that contains the returned value or, in case an exception was thrown, a
failed Try that contains the exception. |
static <V> Try<V> |
Try.failure(java.lang.Exception cause)
Convert the supplied exception into a failed
Try . |
abstract Try<V> |
Try.ifFailure(java.util.function.Consumer<java.lang.Exception> causeConsumer)
If this
Try is a failure, call the supplied Consumer with
the contained exception; otherwise, do nothing. |
Try<V> |
Try.Success.ifFailure(java.util.function.Consumer<java.lang.Exception> causeConsumer) |
Try<V> |
Try.Failure.ifFailure(java.util.function.Consumer<java.lang.Exception> causeConsumer) |
abstract Try<V> |
Try.ifSuccess(java.util.function.Consumer<V> valueConsumer)
If this
Try is a success, call the supplied Consumer with
the contained value; otherwise, do nothing. |
Try<V> |
Try.Success.ifSuccess(java.util.function.Consumer<V> valueConsumer) |
Try<V> |
Try.Failure.ifSuccess(java.util.function.Consumer<V> valueConsumer) |
private static <V> Try<V> |
Try.of(java.util.concurrent.Callable<Try<V>> action) |
abstract Try<V> |
Try.orElse(java.util.function.Supplier<Try<V>> supplier)
If this
Try is a failure, call the supplied supplier and return
the resulting Try ; if this Try is a success, do nothing. |
Try<V> |
Try.Success.orElse(java.util.function.Supplier<Try<V>> supplier) |
Try<V> |
Try.Failure.orElse(java.util.function.Supplier<Try<V>> supplier) |
abstract Try<V> |
Try.orElseTry(java.util.concurrent.Callable<V> action)
If this
Try is a failure, call the supplied action and return a
new successful or failed Try depending on the action's outcome;
if this Try is a success, do nothing. |
Try<V> |
Try.Success.orElseTry(java.util.concurrent.Callable<V> action) |
Try<V> |
Try.Failure.orElseTry(java.util.concurrent.Callable<V> action) |
static <V> Try<V> |
Try.success(V value)
Convert the supplied value into a succeeded
Try . |
private <U> Try<U> |
Try.Failure.uncheckedCast() |
Modifier and Type | Method and Description |
---|---|
abstract <U> Try<U> |
Try.andThen(java.util.function.Function<V,Try<U>> function)
If this
Try is a success, apply the supplied function to its
value and return the resulting Try ; if this Try is a
failure, do nothing. |
<U> Try<U> |
Try.Success.andThen(java.util.function.Function<V,Try<U>> function) |
<U> Try<U> |
Try.Failure.andThen(java.util.function.Function<V,Try<U>> function) |
private static <V> Try<V> |
Try.of(java.util.concurrent.Callable<Try<V>> action) |
abstract Try<V> |
Try.orElse(java.util.function.Supplier<Try<V>> supplier)
If this
Try is a failure, call the supplied supplier and return
the resulting Try ; if this Try is a success, do nothing. |
Try<V> |
Try.Success.orElse(java.util.function.Supplier<Try<V>> supplier) |
Try<V> |
Try.Failure.orElse(java.util.function.Supplier<Try<V>> supplier) |
Modifier and Type | Method and 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 default
ClassLoader . |
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.
|
Modifier and Type | Field and Description |
---|---|
private java.util.function.BiFunction<java.lang.String,java.lang.ClassLoader,Try<java.lang.Class<?>>> |
ClasspathScanner.loadClass |
Modifier and Type | Method and Description |
---|---|
static Try<java.lang.reflect.Method> |
ReflectionUtils.tryToGetMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?>... parameterTypes)
Try to get the
Method 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 supplied
ClassLoader . |
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 and 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) |