Class CollectionUtils


  • public final class CollectionUtils
    extends Object
    Some collection utilities that were not found in Collections2
    • Method Detail

      • asList

        public static List<?> asList​(Object input)
        Composes a List out of the input. Recognizes arrays and Iterables to perform its job. Otherwise returns a single-value list containing the input object.
        Returns:
        a List instance, never null
      • asListWOnull

        public static List<?> asListWOnull​(Object input)
        Composes a List out of the input using asList(Object). Then clears out all the nulls out of it.
        Returns:
        a List instance, containing no null references; never returns null.