From de26371496b0f8bbedd41a03df98caa075b2ca62 Mon Sep 17 00:00:00 2001 From: Jonathan Shook Date: Tue, 6 Jul 2021 11:10:57 -0500 Subject: [PATCH] allow optional service loader result --- .../java/io/nosqlbench/nb/api/spi/SimpleServiceLoader.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nb-api/src/main/java/io/nosqlbench/nb/api/spi/SimpleServiceLoader.java b/nb-api/src/main/java/io/nosqlbench/nb/api/spi/SimpleServiceLoader.java index 92ad6b3aa..89941a8e5 100644 --- a/nb-api/src/main/java/io/nosqlbench/nb/api/spi/SimpleServiceLoader.java +++ b/nb-api/src/main/java/io/nosqlbench/nb/api/spi/SimpleServiceLoader.java @@ -48,6 +48,12 @@ public class SimpleServiceLoader { ); } + + public Optional getOptionally(String implName) { + Optional type = get(implName); + return type; + } + /** * Load the service providers which are annotated with {@link Service} and selector names. *