Package au.csiro.pathling.utilities
Class Lists
- java.lang.Object
-
- au.csiro.pathling.utilities.Lists
-
public abstract class Lists extends Object
Utility class containing some List helper functions.- Author:
- Piotr Szul
-
-
Constructor Summary
Constructors Constructor Description Lists()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>normalizeEmpty(List<T> list)Returns an empty list if the input list is empty; otherwise, returns the input list.static List<String>normalizeEmpty(Optional<List<String>> maybeList)Returns an empty list if the input list is not present; otherwise, returns the input list.
-
-
-
Method Detail
-
normalizeEmpty
@Nonnull public static <T> List<T> normalizeEmpty(@Nonnull List<T> list)
Returns an empty list if the input list is empty; otherwise, returns the input list.- Type Parameters:
T- the type of elements in the list- Parameters:
list- the list to normalize- Returns:
- an empty list if the input list is empty; otherwise, the input list
-
normalizeEmpty
@Nonnull public static List<String> normalizeEmpty(@Nonnull Optional<List<String>> maybeList)
Returns an empty list if the input list is not present; otherwise, returns the input list.- Parameters:
maybeList- the list to normalize- Returns:
- an empty list if the input list is not present; otherwise, the input list
-
-