Class OptionalCallback

java.lang.Object
net.minestom.server.utils.callback.OptionalCallback

public class OptionalCallback
extends java.lang.Object
Convenient class to execute callbacks which can be null.
  • Constructor Summary

    Constructors 
    Constructor Description
    OptionalCallback()  
  • Method Summary

    Modifier and Type Method Description
    static void execute​(java.lang.Runnable callback)
    Executes an optional Runnable.
    static void execute​(ChunkCallback callback, Chunk chunk)
    Executes an optional ChunkCallback.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • execute

      public static void execute​(@Nullable java.lang.Runnable callback)
      Executes an optional Runnable.
      Parameters:
      callback - the optional runnable, can be null
    • execute

      public static void execute​(@Nullable ChunkCallback callback, @Nullable Chunk chunk)
      Executes an optional ChunkCallback.
      Parameters:
      callback - the optional chunk callback, can be null
      chunk - the chunk to forward to the callback