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

com.github.rkmk.Hyphen Maven / Gradle / Ivy

package com.github.rkmk;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

import static java.util.stream.Collectors.toList;
import static java.util.stream.Collectors.toSet;

public class Hyphen {

    static , R extends Collection> R collect(Stream stream, C collection) {
        return (R) (collection instanceof List ? stream.collect(toList()) : stream.collect(toSet()));
    }

    public static > T where(T collection, Map whereClause) {
        return collect(collection.stream().filter(new CustomPredicate(whereClause)), collection);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy