All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quorum.tessera.ServiceLoaderUtil Maven / Gradle / Ivy

There is a newer version: 0.11.0.30092019161842
Show newest version
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