Class Lists


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V> java.util.List<V> filter​(java.util.List<V> original, IItemFilter<V> filter)
      Returns a list filtered by the current IItemFilter
      static <V> java.util.List<V> fromCollection​(java.util.Collection<V> collection)
      Returns a list using the items in the given collection.
      static <From,​To>
      java.util.List<To>
      transform​(java.util.List<From> list, Transformer<From,​To> transformer)
      Returns a new List using the given transformer to transform the original elements into the new ones.
      • Methods inherited from class java.lang.Object

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

      • transform

        public static <From,​To> java.util.List<To> transform​(java.util.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> java.util.List<V> fromCollection​(java.util.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> java.util.List<V> filter​(java.util.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