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>
Represents a persistent list that lazily initializes its internal list using a supplier.
- Since:
- 1.0
- Author:
- Blyzhnytsia Team
-
Field Summary
Modifier and TypeFieldDescriptionSupplier responsible for providing the underlying collection when needed.The internal list that holds the elements of the PersistentList. -
Constructor Summary
ConstructorDescriptionPersistentList
(Supplier<List<?>> collectionSupplier) Constructs a new PersistentList with the specified collection supplier. -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, @NotNull Collection<? extends T> c) boolean
addAll
(@NotNull Collection<? extends T> c) void
clear()
boolean
boolean
containsAll
(@NotNull Collection<?> c) static <E> List
<E> copyOf
(Collection<? extends E> coll) boolean
void
get
(int index) Retrieves the internal list, initializing it if necessary.int
hashCode()
int
boolean
isEmpty()
iterator()
int
@NotNull ListIterator
<T> @NotNull ListIterator
<T> listIterator
(int index) static <E> List
<E> of()
static <E> List
<E> of
(E e1) static <E> List
<E> of
(E... elements) static <E> List
<E> of
(E e1, E e2) static <E> List
<E> of
(E e1, E e2, E e3) static <E> List
<E> of
(E e1, E e2, E e3, E e4) static <E> List
<E> of
(E e1, E e2, E e3, E e4, E e5) static <E> List
<E> of
(E e1, E e2, E e3, E e4, E e5, E e6) static <E> List
<E> of
(E e1, E e2, E e3, E e4, E e5, E e6, E e7) static <E> List
<E> of
(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8) static <E> List
<E> of
(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9) static <E> List
<E> of
(E e1, E e2, E e3, E e4, E e5, E e6, E e7, E e8, E e9, E e10) remove
(int index) boolean
boolean
removeAll
(@NotNull Collection<?> c) boolean
void
replaceAll
(UnaryOperator<T> operator) boolean
retainAll
(@NotNull Collection<?> c) int
size()
void
sort
(Comparator<? super T> c) stream()
subList
(int fromIndex, int toIndex) @NotNull Object[]
toArray()
<T1> T1[]
toArray
(IntFunction<T1[]> generator) <T1> T1[]
toArray
(T1[] a) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, reversed
-
Field Details
-
collectionSupplier
Supplier responsible for providing the underlying collection when needed. -
internalList
The internal list that holds the elements of the PersistentList.
-
-
Constructor Details
-
PersistentList
Constructs a new PersistentList with the specified collection supplier.- Parameters:
collectionSupplier
- the supplier used to lazily initialize the internal list
-
-
Method Details
-
getInternalList
Retrieves the internal list, initializing it if necessary.- Returns:
- the internal list
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
iterator
-
toArray
-
toArray
@NotNull public <T1> T1[] toArray(@NotNull T1[] a) -
add
-
remove
-
containsAll
- Specified by:
containsAll
in interfaceCollection<T>
- Specified by:
containsAll
in interfaceList<T>
-
addAll
-
addAll
-
removeAll
-
retainAll
-
replaceAll
- Specified by:
replaceAll
in interfaceList<T>
-
sort
-
clear
public void clear() -
equals
-
hashCode
public int hashCode() -
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
listIterator
- Specified by:
listIterator
in interfaceList<T>
-
subList
-
spliterator
- Specified by:
spliterator
in interfaceCollection<T>
- Specified by:
spliterator
in interfaceIterable<T>
- Specified by:
spliterator
in interfaceList<T>
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
of
-
copyOf
-
toArray
- Specified by:
toArray
in interfaceCollection<T>
-
removeIf
- Specified by:
removeIf
in interfaceCollection<T>
-
stream
- Specified by:
stream
in interfaceCollection<T>
-
parallelStream
- Specified by:
parallelStream
in interfaceCollection<T>
-
forEach
-