@ConsumerType public interface Adaptable
Adaptableinterface identifies objects which can be adapted to other types or representations of the same object. For example a JCR Node based
Resourcecan adapt to the underlying JCR Node or a file based resource could adapt to the underlying
@Nullable <AdapterType> AdapterType adaptTo(@NotNull @NotNull java.lang.Class<AdapterType> type)
Please note that it is explicitly left as an implementation detail whether
each call to this method with the same
type yields the same
object or a new object on each call.
Implementations of this method should document their adapted types as well as their behaviour with respect to returning newly created or same instances on each call.
AdapterType- The generic type to which this object is adapted to
type- The Class object of the target type, such as
nullif the object cannot adapt to the requested type
Copyright © 2018 The Apache Software Foundation. All rights reserved.