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

io.quarkiverse.githubapp.command.airline.runtime.ArcCommandFactory Maven / Gradle / Ivy

package io.quarkiverse.githubapp.command.airline.runtime;

import com.github.rvesse.airline.CommandFactory;

import io.quarkus.arc.Arc;

public class ArcCommandFactory implements CommandFactory {

    @Override
    @SuppressWarnings("unchecked")
    public T createInstance(Class type) {
        T instance = (T) Arc.container().instance(type).get();

        if (instance == null) {
            throw new IllegalStateException("ArC was unable to instantiate command class " + type);
        }

        return instance;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy