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

com.yelstream.topp.execution.inject.spi.CDIs Maven / Gradle / Ivy

package com.yelstream.topp.execution.inject.spi;

import jakarta.enterprise.inject.spi.CDI;
import lombok.experimental.UtilityClass;

/**
 * Addresses instances of {@link CDI}.
 *
 * @author Morten Sabroe Mortensen
 * @version 1.0
 * @since 2024-02-04
 */
@UtilityClass
public class CDIs {
    public static CDI getCDI() {
        return CDI.current();
    }

    public static  X get(CDI cdi,
                            Class clazz) {
        return cdi.select(clazz).get();
    }

    public static  X get(Class clazz) {
        return get(getCDI(),clazz);
    }
}