com.quorum.tessera.ServiceLoaderUtil Maven / Gradle / Ivy
package com.quorum.tessera;
import java.util.Iterator;
import java.util.Optional;
import java.util.ServiceLoader;
public interface ServiceLoaderUtil {
static Optional load(Class type) {
Iterator it = ServiceLoader.load(type).iterator();
if (it.hasNext()) {
return Optional.of(it.next());
}
return Optional.empty();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy