Class IterableUtilities


  • public class IterableUtilities
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> java.util.List<T> asList​(java.lang.Iterable<T> iterable)  
      static <T> java.util.List<T> asList​(java.lang.Iterable<T> iterable, IAcceptor<T> validator)  
      static <T> java.util.Set<T> asSet​(java.lang.Iterable<T> iterable)  
      static <T> java.util.Set<T> asSet​(java.lang.Iterable<T> iterable, IAcceptor<T> validator)  
      static <I> java.lang.Iterable<I> concat​(java.lang.Iterable<I>... values)  
      static <T> boolean containsAcceptedItems​(java.lang.Iterable<T> values, IAcceptor<T> validator)  
      static <I,​O,​E extends java.lang.Exception>
      java.lang.Iterable<O>
      convert​(java.lang.Iterable<I> values, IConverter<I,​O,​E> converter)  
      static <I> java.lang.Iterable<I> normalize​(java.lang.Iterable<I> values)  
      static <T> java.lang.Iterable<T> reverse​(java.lang.Iterable<T> iterable)  
      static <T> T[] toArray​(java.lang.Iterable<T> iterable, java.lang.Class<T> clazz)  
      static int[] toPrimativArray​(java.lang.Iterable<java.lang.Integer> iterable)  
      static <T> java.lang.String toString​(java.lang.Iterable<T> iterable, java.lang.String seperator)  
      static <T> java.lang.String toString​(java.lang.Iterable<T> iterable, java.lang.String seperator, IConverter<T,​java.lang.String,​ConversionException> converter)  
      • Methods inherited from class java.lang.Object

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

      • IterableUtilities

        public IterableUtilities()
    • Method Detail

      • asSet

        public static <T> java.util.Set<T> asSet​(java.lang.Iterable<T> iterable)
      • asSet

        public static <T> java.util.Set<T> asSet​(java.lang.Iterable<T> iterable,
                                                 IAcceptor<T> validator)
      • reverse

        public static <T> java.lang.Iterable<T> reverse​(java.lang.Iterable<T> iterable)
      • toArray

        public static <T> T[] toArray​(java.lang.Iterable<T> iterable,
                                      java.lang.Class<T> clazz)
      • toPrimativArray

        public static int[] toPrimativArray​(java.lang.Iterable<java.lang.Integer> iterable)
      • asList

        public static <T> java.util.List<T> asList​(java.lang.Iterable<T> iterable)
      • asList

        public static <T> java.util.List<T> asList​(java.lang.Iterable<T> iterable,
                                                   IAcceptor<T> validator)
      • containsAcceptedItems

        public static <T> boolean containsAcceptedItems​(java.lang.Iterable<T> values,
                                                        IAcceptor<T> validator)
      • convert

        public static <I,​O,​E extends java.lang.Exception> java.lang.Iterable<O> convert​(java.lang.Iterable<I> values,
                                                                                                    IConverter<I,​O,​E> converter)
                                                                                             throws E extends java.lang.Exception
        Throws:
        E extends java.lang.Exception
      • concat

        public static <I> java.lang.Iterable<I> concat​(java.lang.Iterable<I>... values)
      • normalize

        public static <I> java.lang.Iterable<I> normalize​(java.lang.Iterable<I> values)
      • toString

        public static <T> java.lang.String toString​(java.lang.Iterable<T> iterable,
                                                    java.lang.String seperator)