Class RunOnce

  • All Implemented Interfaces:
    java.lang.Runnable

    public final class RunOnce
    extends java.lang.Object
    implements java.lang.Runnable
    A simple filter Runnable which will only invoke the contained runnable no more than once.
    • Constructor Summary

      Constructors 
      Constructor Description
      RunOnce​(java.lang.Runnable task)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Runnable make​(java.lang.Runnable task)  
      static <T> java.lang.Runnable make​(T value, java.util.function.Consumer<T> task)  
      void run()  
      • Methods inherited from class java.lang.Object

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

      • RunOnce

        public RunOnce​(@Nonnull
                       java.lang.Runnable task)
    • Method Detail

      • make

        public static java.lang.Runnable make​(@Nonnull
                                              java.lang.Runnable task)
      • make

        public static <T> java.lang.Runnable make​(T value,
                                                  @Nonnull
                                                  java.util.function.Consumer<T> task)
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable