Class Lists


  • public abstract class Lists
    extends Object
    List utility methods.
    Since:
    8.1.0
    Version:
    $Revision: 18249 $ $Date: 2016-01-21 11:20:08 -0200 (Thu, 21 Jan 2016) $
    • Method Detail

      • transform

        public static <From,​To> List<To> transform​(List<From> list,
                                                         Transformer<From,​To> transformer)
                                                  throws PortalException
        Returns a new List using the given transformer to transform the original elements into the new ones.
        Parameters:
        list - the original list.
        transformer - the transformer to be used.
        Returns:
        a new List using the given transformer to transform the original elements into the new ones.
        Throws:
        PortalException
        Since:
        8.1.0
      • fromCollection

        public static <V> List<V> fromCollection​(Collection<V> collection)
        Returns a list using the items in the given collection. The order used to create the list is arbitrary and non-deterministic.
        Parameters:
        collection - the collection of items.
        Returns:
        a list using the items in the given collection.
        Since:
        8.1.0
      • filter

        public static <V> List<V> filter​(List<V> original,
                                         IItemFilter<V> filter)
                                  throws PortalException
        Returns a list filtered by the current IItemFilter
        Parameters:
        original - original list
        filter - filter to be applied on original list
        Returns:
        new filtered list
        Throws:
        PortalException
        Since:
        8.1.0