com.mockrunner.util.common
Class CollectionUtil

java.lang.Object
  extended by com.mockrunner.util.common.CollectionUtil

public class CollectionUtil
extends java.lang.Object

Util class for collections


Constructor Summary
CollectionUtil()
           
 
Method Summary
static void fillList(java.util.List list, int size)
          Fills a List with null by calling fillList(List, int, Object) with a null object.
static void fillList(java.util.List list, int size, java.lang.Object object)
          Fills a List with with the specified object until it has the specified size.
static java.util.List truncateList(java.util.List list, int len)
          Returns a truncated version of the specified List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtil

public CollectionUtil()
Method Detail

fillList

public static void fillList(java.util.List list,
                            int size)
Fills a List with null by calling fillList(List, int, Object) with a null object.

Parameters:
list - the List that should be filled
size - the resulting size of the List

fillList

public static void fillList(java.util.List list,
                            int size,
                            java.lang.Object object)
Fills a List with with the specified object until it has the specified size. If the specified size is equal or lower the List size, nothing happens.

Parameters:
list - the List that should be filled
size - the resulting size of the List

truncateList

public static java.util.List truncateList(java.util.List list,
                                          int len)
Returns a truncated version of the specified List.

Parameters:
list - the List
len - the truncate length
Returns:
the truncated List