Class ProxyUtils
java.lang.Object
com.sap.cds.framework.spring.utils.ProxyUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
createProxy
(Class<T> clazz, Supplier<T> supplier) Creates a proxy of the given class and redirects method calls to the object returned by the supplier.
-
Method Details
-
createProxy
Creates a proxy of the given class and redirects method calls to the object returned by the supplier. BothObject.hashCode()
andObject.equals(Object)
are not forwarded to the object returned by the supplier. These two methods are implemented directly, so that every proxy instance has it's own hash code and is distinct from the actual objects returned by the supplier.- Type Parameters:
T
- The type of the proxy- Parameters:
clazz
- The class to proxysupplier
- The supplier to supply the object to call the method finally on- Returns:
- the proxy
-