Class DefaultLazyTask<LAZY_DATA>

  • Type Parameters:
    LAZY_DATA - type of lazy task's result
    All Implemented Interfaces:
    LazyTask

    public class DefaultLazyTask<LAZY_DATA>
    extends java.lang.Object
    implements LazyTask
    Class which collects lazy task, its result and consumer of task result Methods of this class must be called in special order: 1. executeTask 2. executeOnDone

    If the order is reversed, an exception will be thrown.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void executeOnDone()
      Executes callback.
      void executeTask()
      Method for executing task.
      • Methods inherited from class java.lang.Object

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

      • DefaultLazyTask

        public DefaultLazyTask​(java.util.function.Supplier<LAZY_DATA> dataSupplier,
                               java.util.function.Consumer<LazyTaskResult<LAZY_DATA>> dataConsumer)
    • Method Detail

      • executeTask

        public void executeTask()
        Description copied from interface: LazyTask
        Method for executing task. Execution lasts much time usually.
        Specified by:
        executeTask in interface LazyTask
      • executeOnDone

        public void executeOnDone()
        Description copied from interface: LazyTask
        Executes callback. Should be called when executeTask method is finished
        Specified by:
        executeOnDone in interface LazyTask