Package org.springframework.boot.jdbc
Class DataSourceUnwrapper
java.lang.Object
org.springframework.boot.jdbc.DataSourceUnwrapper
Unwraps a 
DataSource that may have been proxied or wrapped in a custom
 Wrapper such as DelegatingDataSource.- Since:
- 2.0.7
- Author:
- Tadaya Tsuyukubo, Stephane Nicoll
- 
Method SummaryModifier and TypeMethodDescriptionstatic <I,T extends I> 
 Tunwrap(DataSource dataSource, Class<I> unwrapInterface, Class<T> target) Return an object that implements the giventargettype, unwrapping delegate or proxy if necessary using the specifiedunwrapInterface.static <T> Tunwrap(DataSource dataSource, Class<T> target) Return an object that implements the giventargettype, unwrapping delegate or proxy if necessary.
- 
Method Details- 
unwrappublic static <I,T extends I> T unwrap(DataSource dataSource, Class<I> unwrapInterface, Class<T> target) Return an object that implements the giventargettype, unwrapping delegate or proxy if necessary using the specifiedunwrapInterface.- Type Parameters:
- I- the interface that the target type must implement
- T- the target type
- Parameters:
- dataSource- the datasource to handle
- unwrapInterface- the interface that the target type must implement
- target- the type that the result must implement
- Returns:
- an object that implements the target type or null
- Since:
- 2.3.8
- See Also:
 
- 
unwrapReturn an object that implements the giventargettype, unwrapping delegate or proxy if necessary. Consider usingunwrap(DataSource, Class, Class)asunwrappingwon't be considered iftargetis not an interface.- Type Parameters:
- T- the target type
- Parameters:
- dataSource- the datasource to handle
- target- the type that the result must implement
- Returns:
- an object that implements the target type or null
 
 
-