Skip to content

Commit

Permalink
Add util method
Browse files Browse the repository at this point in the history
git-svn-id: http://anonsvn.jboss.org/repos/weld/ri/trunk@3526 1c488680-804c-0410-94cd-c6b725194a0e
  • Loading branch information
pmuir committed Aug 16, 2009
1 parent 4f1b79c commit 0cd3edd
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -17,6 +17,8 @@
package org.jboss.webbeans.util.collections;

import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;

/**
* @author pmuir
Expand All @@ -37,4 +39,14 @@ public static final boolean unorderedEquals(Object[] array, Object... values)
return containsAll(array, values) && array.length == values.length;
}

public static <T> Set<T> asSet(T... types)
{
Set<T> result = new HashSet<T>();
for (T type : types)
{
result.add(type);
}
return result;
}

}

0 comments on commit 0cd3edd

Please sign in to comment.