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

org.revenj.patterns.Query Maven / Gradle / Ivy

The newest version!
package org.revenj.patterns;

import java.io.Serializable;
import java.io.IOException;
import java.util.List;
import java.util.Optional;
import java.util.stream.Stream;

public interface Query {

	Query filter(Specification predicate);

	Query skip(long n);

	Query limit(long n);

	@FunctionalInterface
	interface Compare extends Serializable {
		V compare(U item);
	}

	 Query sortedBy(Compare order);

	 Query sortedDescendingBy(Compare order);

	long count() throws IOException;

	boolean anyMatch(Specification predicate) throws IOException;

	default boolean any() throws IOException {
		return anyMatch(null);
	}

	boolean allMatch(Specification predicate) throws IOException;

	boolean noneMatch(Specification predicate) throws IOException;

	Optional findFirst() throws IOException;

	Optional findAny() throws IOException;

	List list() throws IOException;

	default Stream stream() throws IOException {
		return list().stream();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy