Retrieve a Spring bean based on the class that it implements. Where multiple beans implement a class, the first will be returned. @param cl The type of bean to be retrieved. @return The bean, or null if none exists.
(Class<T> cl)
| 59 | * @return The bean, or null if none exists. |
| 60 | */ |
| 61 | @Nullable |
| 62 | public static <T> T getBean(Class<T> cl) |
| 63 | { |
| 64 | String[] beanNamesForType = BEAN_FACTORY.getBeanNamesForType(cl); |
| 65 | if (beanNamesForType.length == 0) |
| 66 | { |
| 67 | return null; |
| 68 | } |
| 69 | return BEAN_FACTORY.getBean(beanNamesForType[0], cl); |
| 70 | } |
| 71 | |
| 72 | public static Collection<AbstractStorageFacet> getStorageBeans() |
| 73 | { |
no outgoing calls
no test coverage detected