Class PartialList<E>
- java.lang.Object
-
- com.atlassian.bamboo.utils.collection.PartialList<E>
-
-
Constructor Summary
Constructors Constructor Description PartialList(int totalSize, List<E> list)
Deprecated.since 6.0 useofKnownSize(List, int)
}
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<E>
getList()
long
getTotalSize()
boolean
isCompleteList()
boolean
isTotalSizeKnown()
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 Detail
-
PartialList
@Deprecated public PartialList(int totalSize, List<E> list)
Deprecated.since 6.0 useofKnownSize(List, int)
}
-
-
Method Detail
-
ofUnknownSize
@NotNull public static <E> @NotNull PartialList<E> ofUnknownSize(@NotNull @NotNull List<E> list)
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
@NotNull public @NotNull List<E> 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
-
-