org.apache.shiro.util
Class CollectionUtils

java.lang.Object
  extended by org.apache.shiro.util.CollectionUtils

public class CollectionUtils
extends Object

Static helper class for use dealing with Collections.

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)
           
static boolean isEmpty(Collection c)
          Returns true if the specified Collection is null or empty, false otherwise.
static boolean isEmpty(Map m)
          Returns true if the specified Map is null or empty, false otherwise.
static boolean isEmpty(PrincipalCollection principals)
          Returns true if the specified PrincipalCollection is null or empty, false otherwise.
 
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

asSet

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

isEmpty

public static boolean isEmpty(Collection c)
Returns true if the specified Collection is null or empty, false otherwise.

Parameters:
c - the collection to check
Returns:
true if the specified Collection is null or empty, false otherwise.
Since:
1.0

isEmpty

public static boolean isEmpty(Map m)
Returns true if the specified Map is null or empty, false otherwise.

Parameters:
m - the Map to check
Returns:
true if the specified Map is null or empty, false otherwise.
Since:
1.0

isEmpty

public static boolean isEmpty(PrincipalCollection principals)
Returns true if the specified PrincipalCollection is null or empty, false otherwise.

Parameters:
principals - the principals to check.
Returns:
true if the specified PrincipalCollection is null or empty, false otherwise.
Since:
1.0

asList

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


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.