Package io.foldright.inspectablewrappers
Interface WrapperAdapter<T>
- Type Parameters:
T
- the type of instances that be wrapped
- All Superinterfaces:
Wrapper<T>
This
WrapperAdapter
interface is used to
adapt an existed wrapper instance to type Wrapper
without modifying it.
The existed wrapper may not be able to be modified to integrate with inspectable wrappers
;
Integration with inspectable wrappers
means implementation the Wrapper
interface.
The wrapper chain contained WrapperAdapter
looks like:
Provided WrapperAdapterUtils
to create WrapperAdapter
instances of the given biz interface type by the underlying
and adaptee instances without writing boilerplate codes of creating new adapter classes.
- Author:
- Jerry Lee (oldratlee at gmail dot com), Zava Xu (zava dot kid at gmail dot com)
- See Also:
-
Method Summary
-
Method Details
-
adaptee_
Returns the adapted/existed wrapper.Specification contracts:
- Do NOT return
null
which makes no sense.
If returnsnull
, the inspection operations ofInspector
will throwNullPointerException
when touch adaptee. - The adaptee MUST NOT an instance of
Wrapper
, since adapting aWrapper
to aWrapper
is UNNECESSARY.
If adapting aWrapper
, the inspection operations ofInspector
will throwIllegalStateException
when touch theWrapper
type adaptee.
- Returns:
- the adapted wrapper
- See Also:
- Do NOT return
-