Class ListUtils


  • public class ListUtils
    extends Object
    Utilities for lists
    • Constructor Detail

      • ListUtils

        public ListUtils()
    • Method Detail

      • getFirstValue

        public static <T> T getFirstValue​(List<T> list)
        Get first entry of list
        Type Parameters:
        T - type
        Parameters:
        list - to use
        Returns:
        first entry, null if empty or null
      • getLastValue

        public static <T> T getLastValue​(List<T> list)
        Get last entry of list
        Type Parameters:
        T - type
        Parameters:
        list - to use
        Returns:
        last entry, null if empty or null
      • getPairPermutations

        public static <T> List<Pair<T,​T>> getPairPermutations​(List<T> list,
                                                                    boolean keepSelfPermutation)
        Type Parameters:
        T - type of list
        Parameters:
        list - to get permutations from
        keepSelfPermutation - when true keep permutation with self
        Returns:
        result