mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Utility method asSet - also testing Bamboo build.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@119764 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -97,6 +97,24 @@ public final class RMCollectionUtils
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Set containing all of the provided elements. Duplicate elements will be removed as per the
|
||||
* {@code Set} contract.
|
||||
*
|
||||
* @param elements the elements to put in a Set.
|
||||
* @param <T> the element type.
|
||||
* @return a Set containing all the provided elements (without duplicates).
|
||||
*/
|
||||
public static <T> HashSet<T> asSet(T... elements)
|
||||
{
|
||||
final HashSet<T> set = new HashSet<>(elements.length);
|
||||
for (T element : elements)
|
||||
{
|
||||
set.add(element);
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
/**
|
||||
* This enum represents a change in an entry between 2 collections.
|
||||
*/
|
||||
|
Reference in New Issue
Block a user