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

com.github.saphyra.randwo.common.CollectionAggregator Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package com.github.saphyra.randwo.common;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

@Component
public class CollectionAggregator {

    public  List aggregate(List... lists) {
        List result = new ArrayList<>();
        for (List list : lists) {
            result.addAll(list);
        }
        return result;
    }

    public  Map aggregate(Map... maps) {
        Map result = new HashMap<>();
        for (Map map : maps) {
            result.putAll(map);
        }
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy