MCPcopy Create free account
hub / github.com/Ericsson/proxy / delegate

Method delegate

src/main/java/com/ericsson/commonlibrary/proxy/Proxy.java:67–72  ·  view source on GitHub ↗

Create a object with a specific interface/class that delegates all method calls to the delegator objects passed in as parameters. Notice that you can get polymorphic behavior with this delegation method. @param target object type @param proxyInterface interface/class of th

(Class<T> proxyInterface, Object... delegates)

Source from the content-addressed store, hash-verified

65 * @return a proxy object that delegates method calls to it's delegates.
66 */
67 public static <T> T delegate(Class<T> proxyInterface, Object... delegates) {
68 if (proxyInterface.isInterface()) {
69 return delegateInterface(proxyInterface, delegates);
70 }
71 return delegateClass(proxyInterface, delegates);
72 }
73
74 private static <T> T delegateClass(Class<T> proxyInterface, Object... delegates) {
75 T proxy = InterceptableProxyFactory.createANewClassProxy(proxyInterface,

Calls 6

delegateInterfaceMethod · 0.95
delegateClassMethod · 0.95
concatArraysMethod · 0.95
addInterceptorMethod · 0.95