Class ListUtils


  • public final class ListUtils
    extends Object
    List utilities.
    Author:
    Adrian Herscu
    • Method Detail

      • getOrElse

        public static <T> T getOrElse​(List<T> list,
                                      int index,
                                      T defaultValue)
        Type Parameters:
        T - type of values in specified list
        Parameters:
        list - the list to retrieve from
        index - the zero-based index to retrieve
        defaultValue - the default value if there is no value for specified index
        Returns:
        the value at specified index or the default value