de.intarsys.tools.adapter
public interface IAdapterSupport
This can be interpreted as a "dynamic" cast to a type that is not statically declared for the receiver. This pattern allows more freedom in layered / component oriented architectures, as the receiver object is not forced to implement a certain interface at compile time.
A generic implementation of this method could use the IAdapterOutlet
singleton to delegate adapter creation to a registered
IAdapterFactory
.
public <T> T getAdapter(Class<T> clazz) { return AdapterOutlet.get().getAdapter(this, clazz); }
Modifier and Type | Method and Description |
---|---|
<T> T |
getAdapter(java.lang.Class<T> clazz)
Return an object of type
clazz that represents the receiver. |