Package ca.uhn.fhir.util.adapters


package ca.uhn.fhir.util.adapters
Implements the Adapter pattern to allow external classes to extend/adapt existing classes. Useful for extending interfaces that are closed to modification, or restricted for classpath reasons.

For clients, the main entry point is AdapterUtils.adapt(java.lang.Object, java.lang.Class) which will attempt to cast to the target type, or build an adapter of the target type.

For implementors, you can support adaptation via two mechanisms:

The AdapterUtils.adapt() supports both of these.

Inspired by the Eclipse runtime.