Class PersistentList<T>

java.lang.Object
io.github.blyznytsiaorg.bibernate.collection.PersistentList<T>
Type Parameters:
T - the type of elements in the list
All Implemented Interfaces:
Iterable<T>, Collection<T>, List<T>, SequencedCollection<T>

public class PersistentList<T> extends Object implements List<T>
Represents a persistent list that lazily initializes its internal list using a supplier.
Since:
1.0
Author:
Blyzhnytsia Team
  • Field Details

    • collectionSupplier

      private final Supplier<List<?>> collectionSupplier
      Supplier responsible for providing the underlying collection when needed.
    • internalList

      private List<T> internalList
      The internal list that holds the elements of the PersistentList.
  • Constructor Details

    • PersistentList

      public PersistentList(Supplier<List<?>> collectionSupplier)
      Constructs a new PersistentList with the specified collection supplier.
      Parameters:
      collectionSupplier - the supplier used to lazily initialize the internal list
  • Method Details