Package dev.prozilla.pine.common.util
Class ListUtils
java.lang.Object
dev.prozilla.pine.common.util.ListUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <E> List
<E> createSingleton
(E element) static <E,
T extends E>
TgetInstance
(List<E> list, Class<T> type) Finds the first element in a list of a given type.
-
Method Details
-
createSingleton
-
getInstance
Finds the first element in a list of a given type.This method is not suitable for frequent usage or usage with large lists.
- Type Parameters:
E
- The type of elements in the listT
- The type of element to search for- Parameters:
list
- The list to search intype
- The type to search for- Returns:
- The element of the given type, or
null
if there is none.
-