Package tech.muyan.utils
Class BeanContainer
- java.lang.Object
-
- tech.muyan.utils.BeanContainer
-
public class BeanContainer extends java.lang.Object
Bean container that can be used to get bean instances.
-
-
Constructor Summary
Constructors Constructor Description BeanContainer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
getBean(java.lang.Class<T> beanClass)
根据 bean 名称获取 bean 实例static <T> java.util.Collection<T>
getBeansOfType(java.lang.Class<T> beanClass)
Retrieves a collection of beans by their class type.
-
-
-
Method Detail
-
getBean
public static <T> T getBean(java.lang.Class<T> beanClass)
根据 bean 名称获取 bean 实例- Parameters:
beanClass
- bean 类型- Returns:
- bean 实例
-
getBeansOfType
public static <T> java.util.Collection<T> getBeansOfType(java.lang.Class<T> beanClass)
Retrieves a collection of beans by their class type.- Type Parameters:
T
- the type of the beans- Parameters:
beanClass
- the class type of the beans- Returns:
- a collection of bean instances
-
-