com.shixinke.utils.web.util.Converters Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of web-utils Show documentation
Show all versions of web-utils Show documentation
Toolbox commonly used in web development
package com.shixinke.utils.web.util;
import java.util.*;
/**
* @author shixinke
* @version 1.0
* created 19-3-29 11:58
*/
public class Converters {
public static List iteratorToList(Iterator iterator) {
List list = new ArrayList();
while (iterator.hasNext()) {
list.add(iterator.next());
}
return list;
}
public static List iteratorMergeToList(Iterator it1, Iterator it2) {
List list1 = iteratorToList(it1);
List list2 = iteratorToList(it2);
Set sets = new HashSet(list1);
sets.addAll(list2);
return new ArrayList(sets);
}
}