org.fishbolt.common.adapter
Interface IAdaptable

All Known Implementing Classes:
Adaptable

public interface IAdaptable

This is the interface of an adaptable object. It defines only one method providing access to adapters.

See Also:
IAdapter, getAdapter(Class)

Method Summary
<A extends IAdapter>
A
getAdapter(java.lang.Class<A> adapterType)
          The method parameter sets a type of the adapter, which instance we want to get.
 

Method Detail

getAdapter

<A extends IAdapter> A getAdapter(java.lang.Class<A> adapterType)
The method parameter sets a type of the adapter, which instance we want to get. As we can see from the method declaration, there can be only one adapter of the declared type for every adaptable object.

Therefore, if it is necessary to bind several objects of the same type and an adaptable object, its adapter has to "wrap up" all these the same-type objects in it and provide access to them.

Type Parameters:
A - type of the adapter, which instance we want to get.
Parameters:
adapterType - type of the adapter, which instance we want to get.
Returns:
Adapter instance bounded to the adaptable object.
See Also:
IAdapter