package com.tsi.app.common.app;

import org.springframework.context.ApplicationContext;
import org.springframework.core.env.Environment;

public final class AppUtils {
    private AppUtils() {
    }

    public static Object getBean(Class<?> classType) {
        ApplicationContext applicationContext = AppContextProvider.getApplicationContext();
        return applicationContext.getBean(classType);
    }

    public static Object getBean(String beanName) {
        ApplicationContext applicationContext = AppContextProvider.getApplicationContext();
        return applicationContext.getBean(beanName);
    }

    public static ApplicationContext getApplicationContext() {
        return AppContextProvider.getApplicationContext();
    }
    public static String getApplicationId() {
        return AppContextProvider.getApplicationId();
    }
    public static Environment getApplicationEnvironment() {
        return AppContextProvider.getApplicationEnvironment();
    }
}
