Package io.foldright.inspectablewrappers
Interface Wrapper<T>
- Type Parameters:
T
- the type of instances that be wrapped
- All Known Subinterfaces:
WrapperAdapter<T>
public interface Wrapper<T>
This
Wrapper
interface is used to be implemented by wrapper classes,
make an inspectable wrapper chain(linked list).
Note about wrapper chain:
- Author:
- Jerry Lee (oldratlee at gmail dot com), Zava Xu (zava dot kid at gmail dot com)
- See Also:
-
Method Summary
-
Method Details
-
unwrap_
Returns the underlying instance that be wrapped.This method also make the wrapper instances as a wrapper chain(linked list), The wrapper chain consists of wrapper itself, followed by the wrappers obtained by repeatedly calling this method.
Specification contracts:
- Do NOT return
null
which makes no sense.
If returnsnull
, the inspection operations ofInspector
will throwNullPointerException
when touch thenull unwrap value
. - The wrapper chain can NOT be CYCLIC(aka. the return value/wrapper instance
is duplicate on the wrapper chain).
If cyclic, the inspection operations ofInspector
will throwIllegalStateException
when touch theduplicate unwrap instance
.
- Do NOT return
-