me.redtea.carcadex.data.schema.AbstractSchemaStrategy Maven / Gradle / Ivy
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();
}
}