private class DummyProxy.DummyHandler extends AbstractInvocationHandler implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private TypeToken<?> |
interfaceType |
Constructor and Description |
---|
DummyHandler(TypeToken<?> interfaceType) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
By default delegates to
Object.equals(java.lang.Object) so instances are only equal if they are
identical. |
protected java.lang.Object |
handleInvocation(java.lang.Object proxy,
java.lang.reflect.Method method,
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() . |
int |
hashCode()
By default delegates to
Object.hashCode() . |
private DummyProxy |
identity() |
java.lang.String |
toString()
By default delegates to
Object.toString() . |
private java.lang.Object |
writeReplace() |
invoke
private final TypeToken<?> interfaceType
DummyHandler(TypeToken<?> interfaceType)
protected java.lang.Object handleInvocation(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
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
public int hashCode()
AbstractInvocationHandler
Object.hashCode()
. The dynamic proxies' hashCode()
will
delegate to this method. Subclasses can override this method to provide custom equality.hashCode
in class AbstractInvocationHandler
public boolean equals(java.lang.Object obj)
AbstractInvocationHandler
Object.equals(java.lang.Object)
so instances are only equal if they are
identical. proxy.equals(argument)
returns true if:
proxy
and argument
are of the same type
InvocationHandler
of argument
Subclasses can override this method to provide custom equality.
equals
in class AbstractInvocationHandler
private DummyProxy identity()
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
private java.lang.Object writeReplace()