java.lang.Object
org.firebirdsql.jaybird.util.CollectionUtils
Helper class for collections
- Since:
- 6
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends @Nullable Object>
@Nullable TReturns the last item of a list, ornull
if the list is empty.static void
growToSize
(List<?> list, int size) Grows the size oflist
tosize
by padding it withnull
to the requested size.
-
Method Details
-
growToSize
Grows the size oflist
tosize
by padding it withnull
to the requested size.If the size of the list is already
size
or larger, it will not be modified- Parameters:
list
- list to growsize
- desired size- Throws:
NullPointerException
- iflist
isnull
, or does not acceptnull
as a valueUnsupportedOperationException
- iflist
is unmodifiable or fixed size and its current size is less thansize
-
getLast
Returns the last item of a list, ornull
if the list is empty.- Type Parameters:
T
- type of the list- Parameters:
list
- list- Returns:
- last item (which may be
null
), ornull
if the list is empty - Throws:
NullPointerException
- iflist
isnull
-