java.lang.Object
org.sentrysoftware.metricshub.engine.common.helpers.ListHelper

public class ListHelper extends Object
Helper class for common operations on lists.
  • Method Details

    • getValueAtIndex

      public static <T> T getValueAtIndex(List<T> list, int index, T defaultValue)
      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.