Class SimpleLifecycled<T>

java.lang.Object
com.sk89q.worldedit.util.lifecycle.SimpleLifecycled<T>
All Implemented Interfaces:
Lifecycled<T>

public final class SimpleLifecycled<T> extends Object implements Lifecycled<T>
A Lifecycled that can be directly called to invalidate it or set a new value.
  • Method Details

    • valid

      public static <T> SimpleLifecycled<T> valid(T value)
    • invalid

      public static <T> SimpleLifecycled<T> invalid()
    • newValue

      public void newValue(T value)
      Set the value of this lifecycled and fire the new value event.
      Parameters:
      value - the value
    • invalidate

      public void invalidate()
      Remove the value of this lifecycled and fire the invalidated event.
    • value

      public Optional<T> value()
      Description copied from interface: Lifecycled
      Get the value or Optional.empty().
      Specified by:
      value in interface Lifecycled<T>
      Returns:
      the value
    • events

      public Lifecycled.Events<T> events()
      Description copied from interface: Lifecycled
      Get the event manager for this lifecycled object.
      Specified by:
      events in interface Lifecycled<T>
      Returns:
      the event manager