Package io.jmix.flowui.model.impl
Class WeakCollectionChangeListener<E>
java.lang.Object
io.jmix.flowui.model.impl.WeakCollectionChangeListener<E>
- Type Parameters:
E- the type of elements in the collection container
- All Implemented Interfaces:
Consumer<CollectionContainer.CollectionChangeEvent<E>>
public class WeakCollectionChangeListener<E>
extends Object
implements Consumer<CollectionContainer.CollectionChangeEvent<E>>
A weak wrapper for a
Consumer that listens to CollectionContainer.CollectionChangeEvents.
This class ensures that the listener does not prevent garbage collection of the original
Consumer, thus avoiding memory leaks.-
Constructor Summary
ConstructorsConstructorDescriptionWeakCollectionChangeListener(CollectionContainer container, Consumer<CollectionContainer.CollectionChangeEvent<E>> collectionChangeListener) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidRemoves the associated listener from the event source, ensuring that this instance no longer listens to changes in the underlying collection or data source.
-
Constructor Details
-
WeakCollectionChangeListener
public WeakCollectionChangeListener(CollectionContainer container, Consumer<CollectionContainer.CollectionChangeEvent<E>> collectionChangeListener)
-
-
Method Details