Skip to content

Commit

Permalink
Make Config.bookmarkManager return Optional (#1292)
Browse files Browse the repository at this point in the history
  • Loading branch information
injectives authored Aug 19, 2022
1 parent d339b93 commit 9e55de7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 4 additions & 3 deletions driver/src/main/java/org/neo4j/driver/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import org.neo4j.driver.internal.SecuritySettings;
Expand Down Expand Up @@ -258,10 +259,10 @@ public String userAgent() {
/**
* A {@link BookmarkManager} implementation for the driver to use.
*
* @return bookmark implementation or {@code null}.
* @return bookmark implementation
*/
public BookmarkManager bookmarkManager() {
return bookmarkManager;
public Optional<BookmarkManager> bookmarkManager() {
return Optional.ofNullable(bookmarkManager);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,11 @@ protected InternalDriver createRoutingDriver(
protected InternalDriver createDriver(
SecurityPlan securityPlan, SessionFactory sessionFactory, MetricsProvider metricsProvider, Config config) {
return new InternalDriver(
securityPlan, sessionFactory, metricsProvider, config.logging(), config.bookmarkManager());
securityPlan,
sessionFactory,
metricsProvider,
config.logging(),
config.bookmarkManager().orElse(null));
}

/**
Expand Down

0 comments on commit 9e55de7

Please sign in to comment.