Class ListHelper
java.lang.Object
org.sentrysoftware.metricshub.engine.common.helpers.ListHelper
Helper class for common operations on lists.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TgetValueAtIndex(List<T> list, int index, T defaultValue) Returns the element at the specified position in this list.
-
Method Details
-
getValueAtIndex
Returns the element at the specified position in this list.- Type Parameters:
T- The type of elements in the list.- Parameters:
list- The list from which we want to get the element at the specified position.index- Index of the element to return.defaultValue- The default value to return if the element cannot be extracted.- Returns:
- The element at the specified position in the list, or the default value if the index is out of bounds.
-