Package io.smallrye.openapi.api.util
Class ListUtil
- java.lang.Object
-
- io.smallrye.openapi.api.util.ListUtil
-
public class ListUtil extends Object
Util that helps with List operations- Author:
- Eric Wittmann ([email protected]), Phillip Kruger ([email protected])
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>
mergeNullableLists(List<T>... lists)
Combines the lists passed into a new list, excluding any null lists given.
-
-
-
Method Detail
-
mergeNullableLists
@SafeVarargs public static <T> List<T> mergeNullableLists(List<T>... lists)
Combines the lists passed into a new list, excluding any null lists given. If the resulting list is empty, return null. This method is marked with@SafeVarargs
because the elements of the lists handled generically and the input/output types match.- Type Parameters:
T
- element type of the list- Parameters:
lists
- one or more lists to combine- Returns:
- the combined/merged lists or null if the resulting merged list is empty
-
-