public class ProxyUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <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.
|
public static <T> T createProxy(Class<T> clazz, Supplier<T> supplier)
Object.hashCode() and Object.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.T - The type of the proxyclazz - The class to proxysupplier - The supplier to supply the object to call the method finally onCopyright © 2023. All rights reserved.