Class CollectionUtil



  • public class CollectionUtil
    extends java.lang.Object
    Internal helper class for working with collections.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<Problem> copyNonNullValues​(java.util.Collection<Problem> problems)
      Performs a copy that enforces the values to be non-null.
      • Methods inherited from class java.lang.Object

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

      • copyNonNullValues

        @Nonnull
        public static java.util.List<Problem> copyNonNullValues​(@Nonnull
                                                                java.util.Collection<Problem> problems)
        Performs a copy that enforces the values to be non-null.

        This is very similar to the behavior of later JDKs List.copyOf()

        Parameters:
        problems - list of problems to copy and enforce non-null entries.
        Returns:
        a copy of the parameter, explicitly as a List, and unmodifiable.