Class Tasks


  • public class Tasks
    extends java.lang.Object
    Created by Navid Mitchell on 3/24/20
    • Constructor Summary

      Constructors 
      Constructor Description
      Tasks()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <R> Task<R> fromCallable​(java.lang.String description, java.util.concurrent.Callable<R> instance)  
      static <R> Task<R> fromCallable​(java.util.concurrent.Callable<R> instance)  
      static Task<java.lang.Void> fromRunnable​(java.lang.Runnable instance)  
      static Task<java.lang.Void> fromRunnable​(java.lang.String description, java.lang.Runnable instance)  
      static <R> Task<R> fromSupplier​(java.lang.String description, java.util.function.Supplier<R> instance)  
      static <R> Task<R> fromSupplier​(java.util.function.Supplier<R> instance)  
      static <T> Task<T> fromValue​(java.lang.String description, T value)  
      static <T> Task<T> fromValue​(T value)  
      static <T> Task<T> noop()
      Special type of task that allows a step to be skipped if needed.
      static <T> Task<T> noop​(java.lang.String description)
      Special type of task that allows a step to be skipped if needed.
      static <T,​R>
      Task<R>
      transformResult​(Task<T> from, java.util.function.Function<T,​R> transformer)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Tasks

        public Tasks()
    • Method Detail

      • fromCallable

        public static <R> Task<R> fromCallable​(java.util.concurrent.Callable<R> instance)
      • fromCallable

        public static <R> Task<R> fromCallable​(java.lang.String description,
                                               java.util.concurrent.Callable<R> instance)
      • fromSupplier

        public static <R> Task<R> fromSupplier​(java.util.function.Supplier<R> instance)
      • fromSupplier

        public static <R> Task<R> fromSupplier​(java.lang.String description,
                                               java.util.function.Supplier<R> instance)
      • fromValue

        public static <T> Task<T> fromValue​(T value)
      • fromValue

        public static <T> Task<T> fromValue​(java.lang.String description,
                                            T value)
      • fromRunnable

        public static Task<java.lang.Void> fromRunnable​(java.lang.Runnable instance)
      • fromRunnable

        public static Task<java.lang.Void> fromRunnable​(java.lang.String description,
                                                        java.lang.Runnable instance)
      • noop

        public static <T> Task<T> noop​(java.lang.String description)
        Special type of task that allows a step to be skipped if needed. This is useful if a Supplier needs to only supply a task under certain conditions
        Parameters:
        description - of why the task is a noop task.
        Returns:
        the noop task
      • noop

        public static <T> Task<T> noop()
        Special type of task that allows a step to be skipped if needed. This is useful if a Supplier needs to only supply a task under certain conditions
        Returns:
        the noop task
      • transformResult

        public static <T,​R> Task<R> transformResult​(Task<T> from,
                                                          java.util.function.Function<T,​R> transformer)