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, ornullif the list is empty.static voidgrowToSize(List<?> list, int size) Grows the size oflisttosizeby padding it withnullto the requested size.
-
Method Details
-
growToSize
Grows the size oflisttosizeby padding it withnullto the requested size.If the size of the list is already
sizeor larger, it will not be modified- Parameters:
list- list to growsize- desired size- Throws:
NullPointerException- iflistisnull, or does not acceptnullas a valueUnsupportedOperationException- iflistis unmodifiable or fixed size and its current size is less thansize
-
getLast
Returns the last item of a list, ornullif the list is empty.- Type Parameters:
T- type of the list- Parameters:
list- list- Returns:
- last item (which may be
null), ornullif the list is empty - Throws:
NullPointerException- iflistisnull
-