Package org.springframework.boot.jdbc
Class DataSourceUnwrapper
- java.lang.Object
- org.springframework.boot.jdbc.DataSourceUnwrapper
public final class DataSourceUnwrapper extends Object
Unwraps aDataSource
that may have been proxied or wrapped in a customWrapper
such asDelegatingDataSource
.- Since:
- 2.0.7
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
unwrap(DataSource dataSource, Class<T> target)
Return an object that implements the giventarget
type, unwrapping delegate or proxy if necessary.
Method Detail
unwrap
public static <T> T unwrap(DataSource dataSource, Class<T> target)
Return an object that implements the giventarget
type, unwrapping delegate or proxy if necessary.- Type Parameters:
T
- the target type- Parameters:
dataSource
- the datasource to handletarget
- the type that the result must implement- Returns:
- an object that implements the target type or
null