mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-19 18:50:59 +07:00
25 lines
478 B
Java
25 lines
478 B
Java
|
|
import java.util.Collections;
|
|
import java.util.Set;
|
|
|
|
class Test {
|
|
Database database;
|
|
|
|
Set<Long> getItems() {
|
|
return database.perform(connection -> {
|
|
try (AutoCloseable c = null) {
|
|
try (AutoCloseable d = null) {
|
|
return Collections.emptySet();
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
public interface Database {
|
|
<V> V perform(BusinessLogic<V> logic);
|
|
}
|
|
|
|
public interface BusinessLogic<V> {
|
|
V execute(String connection) throws Exception;
|
|
}
|
|
} |