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 | Method and Description |
---|---|
abstract <U> Try<U> |
Try.andThen(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. |
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. |
static <V> Try<V> |
Try.call(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(Exception cause)
Convert the supplied exception into a failed
Try . |
abstract Try<V> |
Try.ifFailure(Consumer<Exception> causeConsumer)
If this
Try is a failure, call the supplied Consumer with
the contained exception; otherwise, do nothing. |
abstract Try<V> |
Try.ifSuccess(Consumer<V> valueConsumer)
If this
Try is a success, call the supplied Consumer with
the contained value; otherwise, do nothing. |
abstract Try<V> |
Try.orElse(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. |
abstract Try<V> |
Try.orElseTry(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. |
static <V> Try<V> |
Try.success(V value)
Convert the supplied value into a succeeded
Try . |
Modifier and Type | Method and Description |
---|---|
abstract <U> Try<U> |
Try.andThen(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. |
abstract Try<V> |
Try.orElse(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. |
Modifier and Type | Method and Description |
---|---|
static Try<Class<?>> |
ReflectionSupport.tryToLoadClass(String name)
Try to load a class by its primitive name or fully qualified name,
using the default
ClassLoader . |
static Try<Object> |
ReflectionSupport.tryToReadFieldValue(Field field,
Object instance)
Try to read the value of a potentially inaccessible field.
|
Modifier and Type | Method and Description |
---|---|
static Try<Method> |
ReflectionUtils.tryToGetMethod(Class<?> clazz,
String methodName,
Class<?>... parameterTypes)
Try to get the
Method 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 supplied
ClassLoader . |
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) |
Copyright © 2019. All rights reserved.