com.drew.lang.Iterables Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aem-sdk-api Show documentation
Show all versions of aem-sdk-api Show documentation
The Adobe Experience Manager SDK
package com.drew.lang;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author Drew Noakes https://drewnoakes.com
*/
public class Iterables
{
public static List toList(Iterable iterable)
{
ArrayList list = new ArrayList();
for (E item : iterable) {
list.add(item);
}
return list;
}
public static Set toSet(Iterable iterable)
{
HashSet set = new HashSet();
for (E item : iterable) {
set.add(item);
}
return set;
}
}