ca.ibodrov.mica.server.data.EntityFetcher Maven / Gradle / Ivy
package ca.ibodrov.mica.server.data;
import ca.ibodrov.mica.api.model.EntityLike;
import java.net.URI;
import java.util.Optional;
import java.util.stream.Stream;
public interface EntityFetcher {
default Optional defaultUri() {
return Optional.empty();
}
boolean isSupported(FetchRequest request);
Cursor fetch(FetchRequest request);
record FetchRequest(Optional uri, String kind) {
public static FetchRequest ofKind(String kind) {
return new FetchRequest(Optional.empty(), kind);
}
}
interface Cursor {
Stream stream();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy