All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.shixinke.utils.web.util.Converters Maven / Gradle / Ivy

There is a newer version: 1.0.8
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy