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

xyz.jpenilla.squaremap.api.ProviderHolder Maven / Gradle / Ivy

package xyz.jpenilla.squaremap.api;

import net.kyori.adventure.util.Services;

final class ProviderHolder {
    static final HtmlComponentSerializer.Provider HTML_SERIALIZER = service(HtmlComponentSerializer.Provider.class);
    static final HtmlStripper.Provider HTML_STRIPPER = service(HtmlStripper.Provider.class);

    private static  T service(final Class clazz) {
        return Services.service(clazz)
            .orElseThrow(() -> new IllegalStateException("Could not find " + clazz.getName() + " implementation"));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy