Class PartialList<E>
java.lang.Object
com.atlassian.bamboo.utils.collection.PartialList<E>
A
List
that represents a part of a much bigger list- Since:
- v3.2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetList()
long
boolean
boolean
static <E> @NotNull PartialList<E>
ofKnownSize
(@NotNull List<E> list, int totalSize) Creates aPartialList
of known total size.static <E> @NotNull PartialList<E>
ofKnownSize
(@NotNull List<E> list, long totalSize) Creates aPartialList
of known total size.static <E> @NotNull PartialList<E>
ofUnknownSize
(@NotNull List<E> list) Creates aPartialList
of unknown total size.
-
Constructor Details
-
PartialList
Deprecated.since 6.0 useofKnownSize(List, int)
}
-
-
Method Details
-
ofUnknownSize
Creates aPartialList
of unknown total size. The created partial list will not be acomplete list
.- Type Parameters:
E
- type of list- Parameters:
list
- partial list of elements- Returns:
- new instance of
PartialList
-
ofKnownSize
@NotNull public static <E> @NotNull PartialList<E> ofKnownSize(@NotNull @NotNull List<E> list, int totalSize) Creates aPartialList
of known total size. The created partial list might be acomplete list
.- Type Parameters:
E
- type of list- Parameters:
list
- partial list of elementstotalSize
- total number of elements in the collection- Returns:
- new instance of
PartialList
-
ofKnownSize
@NotNull public static <E> @NotNull PartialList<E> ofKnownSize(@NotNull @NotNull List<E> list, long totalSize) Creates aPartialList
of known total size. The created partial list might be acomplete list
.- Type Parameters:
E
- type of list- Parameters:
list
- partial list of elementstotalSize
- total number of elements in the collection- Returns:
- new instance of
PartialList
-
isTotalSizeKnown
public boolean isTotalSizeKnown()- Returns:
- true if the total size of the bigger collection is known
-
getTotalSize
public long getTotalSize()- Returns:
- total size of the big collection, -1 if it's unknown
-
getList
- Returns:
- partial list of elements from the bigger collection
-
isCompleteList
public boolean isCompleteList()- Returns:
- true if the list has all the elements of the bigger collection
-
ofKnownSize(List, int)
}