Interface Lifecycled.Events<T>
- All Known Implementing Classes:
- LifecycledCallbackHandler
- Enclosing interface:
- Lifecycled<T>
public static interface Lifecycled.Events<T>
- 
Method SummaryModifier and TypeMethodDescription<O> voidonInvalidated(O owner, BiConsumer<O, ? super Lifecycled<T>> callback) Add a callback for when this lifecycled is invalidated.<O> voidonNewValue(O owner, BiConsumer<O, ? super Lifecycled<T>> callback) Add a callback for when this lifecycled is given a new value.
- 
Method Details- 
onNewValueAdd a callback for when this lifecycled is given a new value. Will be called immediately if this lifecycled is currently valid.The callback should not reference the owner, it must only access it via the parameter. This ensures that the owner will be GC-able, otherwise it may be stuck in a reference loop. - Parameters:
- owner- when the owner is GC'd, the callback is removed
- callback- the callback, will be passed the lifecycled object
 
- 
onInvalidatedAdd a callback for when this lifecycled is invalidated. Will be called immediately if this lifecycled is currently invalid.The callback should not reference the owner, it must only access it via the parameter. This ensures that the owner will be GC-able, otherwise it may be stuck in a reference loop. - Parameters:
- owner- when the owner is GC'd, the callback is removed
- callback- the callback, will be passed the lifecycled object
 
 
-