Package com.mastfrog.abstractions
Interface Wrapper<W>
- All Superinterfaces:
Named
Abstraction for an object which is a wrapper for another object, which may be
of the same or a different type, and may exist in a hierarchy of such
objects, with methods for resolving such wrapped objects in a type-safe way.
- Author:
- Tim Boudreau
-
Method Summary
Modifier and TypeMethodDescriptiondefault <F> Fstatic <F> Fdefault <F> booleandefault Stringname()Finds any instance of the Named interface, and returns the result if its name() method if present, and if not, returns toString() on the wrapped object.default Wroot()static <P1> P1root(P1 o) wrapped()Get the object wrapped by this one.
-
Method Details
-
wrapped
W wrapped()Get the object wrapped by this one.- Returns:
- The wrapped object or null
-
root
-
name
Finds any instance of the Named interface, and returns the result if its name() method if present, and if not, returns toString() on the wrapped object. -
root
static <P1> P1 root(P1 o) -
find
-
has
-
find
-