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

me.redtea.carcadex.data.schema.AbstractSchemaStrategy Maven / Gradle / Ivy

There is a newer version: 2.0.1-BETA
Show newest version
package me.redtea.carcadex.data.schema;

import java.util.Collection;
import java.util.Optional;
import java.util.function.Predicate;
import java.util.stream.Collectors;

public abstract class AbstractSchemaStrategy implements SchemaStrategy{
    @Override
    public Collection find(Predicate predicate) {
        return all().parallelStream().filter(predicate).collect(Collectors.toList());
    }

    @Override
    public Optional findAny(Predicate predicate) {
        return all().parallelStream().filter(predicate).findAny();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy