Class SimpleLifecycled<T>
java.lang.Object
com.sk89q.worldedit.util.lifecycle.SimpleLifecycled<T>
- All Implemented Interfaces:
Lifecycled<T>
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sk89q.worldedit.util.lifecycle.Lifecycled
Lifecycled.Events<T>
-
Method Summary
Modifier and TypeMethodDescriptionevents()
Get the event manager for this lifecycled object.static <T> SimpleLifecycled
<T> invalid()
void
Remove the value of this lifecycled and fire the invalidated event.void
Set the value of this lifecycled and fire the new value event.static <T> SimpleLifecycled
<T> valid
(T value) value()
Get the value orOptional.empty()
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.util.lifecycle.Lifecycled
filter, flatMap, isValid, map, valueOrThrow
-
Method Details
-
valid
-
invalid
-
newValue
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
Description copied from interface:Lifecycled
Get the value orOptional.empty()
.- Specified by:
value
in interfaceLifecycled<T>
- Returns:
- the value
-
events
Description copied from interface:Lifecycled
Get the event manager for this lifecycled object.- Specified by:
events
in interfaceLifecycled<T>
- Returns:
- the event manager
-