Package jetbrains.buildServer.util
Class SpringUtil
- java.lang.Object
-
- jetbrains.buildServer.util.SpringUtil
-
public final class SpringUtil extends Object
- Since:
- 2018.2
- Author:
- Maxim.Zaytsev
-
-
Constructor Summary
Constructors Constructor Description SpringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> TgetOwnBean(org.springframework.context.ApplicationContext context, Class<T> type)Returns instance of specified type from specified context but ignore beans of parent context.static <T> TgetOwnBean(org.springframework.context.ApplicationContext context, Class<T> type, T defaultBean)Returns instance of specified type from specified context but ignore beans of parent context.static <T> List<T>getOwnBeans(org.springframework.context.ApplicationContext context, Class<T> type)Returns all instances of specified type from specified context but ignore beans of parent context
-
-
-
Method Detail
-
getOwnBeans
@NotNull public static <T> List<T> getOwnBeans(@NotNull org.springframework.context.ApplicationContext context, @NotNull Class<T> type)
Returns all instances of specified type from specified context but ignore beans of parent context- Parameters:
context- specified contexttype- type the bean must match- Returns:
- list of fount beans
-
getOwnBean
@Nullable public static <T> T getOwnBean(@NotNull org.springframework.context.ApplicationContext context, @NotNull Class<T> type)Returns instance of specified type from specified context but ignore beans of parent context.- Parameters:
context- specified contexttype- type the bean must match- Returns:
- found instance or
nullif context doesn't contain bean or contains many beans of specified type
-
getOwnBean
@NotNull public static <T> T getOwnBean(@NotNull org.springframework.context.ApplicationContext context, @NotNull Class<T> type, T defaultBean)Returns instance of specified type from specified context but ignore beans of parent context.- Parameters:
context- specified contexttype- type the bean must matchdefaultBean- default instance which must be returned if context doesn't contain bean or contains many beans of specified type- Returns:
- found instance or
defaultBeanif context doesn't contain bean or contains many beans of specified type
-
-