JSecurity

org.jsecurity.util
Class CollectionUtils

java.lang.Object
  extended by org.jsecurity.util.CollectionUtils

public class CollectionUtils
extends Object

Static helper class for use dealing with Arrays.

Since:
0.9
Author:
Jeremy Haile, Les Hazlewood

Constructor Summary
CollectionUtils()
           
 
Method Summary
static
<E> List<E>
asList(E... elements)
           
static
<E> Set<E>
asSet(E... elements)
           
(package private) static int computeListCapacity(int arraySize)
           
static
<E> Collection<E>
emptyCollection(Class<E> clazz)
          Simple method that just returns Collections.EMPTY_SET.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionUtils

public CollectionUtils()
Method Detail

emptyCollection

public static <E> Collection<E> emptyCollection(Class<E> clazz)
Simple method that just returns Collections.EMPTY_SET. This exists to enable type-safe empty collections so other locations in JSecurity code do not need to worry about suppressing warnings.

Parameters:
clazz - the class of the collection type to return
Returns:
an empty collection

asSet

public static <E> Set<E> asSet(E... elements)

asList

public static <E> List<E> asList(E... elements)

computeListCapacity

static int computeListCapacity(int arraySize)

JSecurity

Copyright © 2004-2008 JSecurity.