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
nullwhich makes no sense.
If returnsnull, the inspection operations ofInspectorwill throwNullPointerExceptionwhen touch adaptee. - The adaptee MUST NOT an instance of
Wrapper, since adapting aWrapperto aWrapperis UNNECESSARY.
If adapting aWrapper, the inspection operations ofInspectorwill throwIllegalStateExceptionwhen touch theWrappertype adaptee.
- Returns:
- the adapted wrapper
- See Also:
- Do NOT return
-