Class ListSplitters


  • public final class ListSplitters
    extends java.lang.Object
    Utility for creating ListSplittersByLength.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T extends java.lang.Comparable<?>>
      java.lang.Iterable<java.util.List<T>>
      splitByLength​(java.util.List<T> list)
      Creates a list splitter that splits the long list into peaces with the maximal length for string representation ListSplitterByLength.LENGTH_LIMIT.
      static <T extends java.lang.Comparable<?>>
      java.lang.Iterable<java.util.List<T>>
      splitByLength​(java.util.List<T> list, int length)
      Creates a list splitter that splits the long list into peaces with the maximal length for string representation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • splitByLength

        public static <T extends java.lang.Comparable<?>> java.lang.Iterable<java.util.List<T>> splitByLength​(java.util.List<T> list)
        Creates a list splitter that splits the long list into peaces with the maximal length for string representation ListSplitterByLength.LENGTH_LIMIT. The maximum number of elements in list is ListSplitterByLength.IN_LIST_LENGTH_LIMITATION.
        Type Parameters:
        T - The type of elements.
        Parameters:
        list - The list to split.
        Returns:
        The list split into chunks.
      • splitByLength

        public static <T extends java.lang.Comparable<?>> java.lang.Iterable<java.util.List<T>> splitByLength​(java.util.List<T> list,
                                                                                                              int length)
        Creates a list splitter that splits the long list into peaces with the maximal length for string representation. The maximum number of elements in list is ListSplitterByLength.IN_LIST_LENGTH_LIMITATION.
        Type Parameters:
        T - The type of elements.
        Parameters:
        list - The list to split.
        length - The maximal length of list
        Returns:
        The list split into chunks with maximum length of length