org.broadleafcommerce.common.util
Class BLCCollectionUtils

java.lang.Object
  extended by org.broadleafcommerce.common.util.BLCCollectionUtils

public class BLCCollectionUtils
extends Object

Convenience methods for interacting with collections.

Author:
Andre Azzolini (apazzolini)

Constructor Summary
BLCCollectionUtils()
           
 
Method Summary
static
<T> Collection<T>
collect(Collection inputCollection, TypedTransformer<T> transformer)
          Delegates to CollectionUtils.collect(Collection, Transformer), but performs the necessary type coercion to allow the returned collection to be correctly casted based on the TypedTransformer.
static
<T> List<T>
selectList(Collection<T> inputCollection, TypedPredicate<T> predicate)
          Delegates to CollectionUtils.select(Collection, org.apache.commons.collections.Predicate), but will force the return type to be a List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BLCCollectionUtils

public BLCCollectionUtils()
Method Detail

collect

public static <T> Collection<T> collect(Collection inputCollection,
                                        TypedTransformer<T> transformer)
Delegates to CollectionUtils.collect(Collection, Transformer), but performs the necessary type coercion to allow the returned collection to be correctly casted based on the TypedTransformer.

Parameters:
inputCollection -
transformer -
Returns:
the typed, collected Collection

selectList

public static <T> List<T> selectList(Collection<T> inputCollection,
                                     TypedPredicate<T> predicate)
Delegates to CollectionUtils.select(Collection, org.apache.commons.collections.Predicate), but will force the return type to be a List.

Parameters:
inputCollection -
predicate -
Returns:


Copyright © 2013. All Rights Reserved.