Package au.csiro.pathling.utilities
Class Lists
java.lang.Object
au.csiro.pathling.utilities.Lists
Utility class containing some List helper functions.
- Author:
- Piotr Szul
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>normalizeEmpty(List<T> list) Returns an empty list if the input list is empty; otherwise, returns the input list.normalizeEmpty(Optional<List<String>> maybeList) Returns an empty list if the input list is not present; otherwise, returns the input list.
-
Constructor Details
-
Lists
public Lists()
-
-
Method Details
-
normalizeEmpty
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
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
-