Created
August 16, 2020 08:16
-
-
Save ksundong/226ad6a20a56e1355190b3ef3596bd86 to your computer and use it in GitHub Desktop.
Get Bean을 통해 배우는 제네릭
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public <T> T getBean(Class<T> requiredType, @Nullable Object... args) throws BeansException { | |
Assert.notNull(requiredType, "Required type must not be null"); | |
Object resolved = resolveBean(ResolvableType.forRawClass(requiredType), args, false); | |
if (resolved == null) { | |
throw new NoSuchBeanDefinitionException(requiredType); | |
} | |
return (T) resolved; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment