public class NoopInvocationHandler extends Object implements InvocationHandler, Serializable
NOOP_INVOCATION_HANDLER
.
Create instances only where you
want/need
the Object.toString()
to be distinct.
If near-NOOP functionality required, then compose
NOOP_INVOCATION_HANDLER
as
the delegate
for PartialInvocationHandler
.
Not quite NOOP:
1. honours equals by reference of proxy
2. honours hashCode as system identity of proxy
3. toString outputs system identity of proxy and this instance of
NoopInvocationHandler
4. returns default values for primitives and null
for Object
s
5. Does NOT honour default methods on interfaces - this is achievable via composition with the
PartialInvocationHandler
Modifier and Type | Field and Description |
---|---|
static NoopInvocationHandler |
NOOP_INVOCATION_HANDLER
Constant
NOOP_INVOCATION_HANDLER |
Constructor and Description |
---|
NoopInvocationHandler() |
public static final NoopInvocationHandler NOOP_INVOCATION_HANDLER
NOOP_INVOCATION_HANDLER
Copyright © 2018 earcam. All rights reserved.