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​(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.
    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​(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.
    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.
    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.
    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.
    static <V> Try<V> Try.success​(V value)
    Convert the supplied value into a succeeded Try.
    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 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​(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.
  • 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 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.
  • 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<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)