private static final class ForwardingWrapperTester.InteractionTester<T> extends AbstractInvocationHandler
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicInteger |
called |
private java.lang.Class<T> |
interfaceType |
private java.lang.reflect.Method |
method |
private java.lang.Object[] |
passedArgs |
private java.lang.Object |
returnValue |
Constructor and Description |
---|
InteractionTester(java.lang.Class<T> interfaceType,
java.lang.reflect.Method method) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object |
handleInvocation(java.lang.Object p,
java.lang.reflect.Method calledMethod,
java.lang.Object[] args)
AbstractInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[]) delegates to this method upon any method invocation on the proxy instance,
except Object.equals(java.lang.Object) , Object.hashCode() and Object.toString() . |
(package private) void |
testInteraction(Function<? super T,? extends T> wrapperFunction) |
java.lang.String |
toString()
By default delegates to
Object.toString() . |
equals, hashCode, invoke
private final java.lang.Class<T> interfaceType
private final java.lang.reflect.Method method
private final java.lang.Object[] passedArgs
private final java.lang.Object returnValue
private final java.util.concurrent.atomic.AtomicInteger called
InteractionTester(java.lang.Class<T> interfaceType, java.lang.reflect.Method method)
protected java.lang.Object handleInvocation(java.lang.Object p, java.lang.reflect.Method calledMethod, java.lang.Object[] args) throws java.lang.Throwable
AbstractInvocationHandler
AbstractInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
delegates to this method upon any method invocation on the proxy instance,
except Object.equals(java.lang.Object)
, Object.hashCode()
and Object.toString()
. The result
will be returned as the proxied method's return value.
Unlike AbstractInvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
, args
will never be null. When the method has no parameter,
an empty array is passed in.
handleInvocation
in class AbstractInvocationHandler
java.lang.Throwable
public java.lang.String toString()
AbstractInvocationHandler
Object.toString()
. The dynamic proxies' toString()
will
delegate to this method. Subclasses can override this method to provide custom string
representation for the proxies.toString
in class AbstractInvocationHandler