Adapter Pattern (Structural Pattern)
The design patterns which allow the interface of a class to be used as another interface. This is used to adapt and make two existing classes work together. Like the real world adapters, which let you use a headphone-jack or plug-in a phone charger in an otherwise non-compatible socket, the adapter design pattern bridges a gap between two objects.
The purpose of the Adapter pattern is to convert the interface of a class into another interface and thus make it usable by the other objects/classes/interfaces. Depending on the extent of change required for the adaptation, one might need to write code to convert data structures and logic to implement Adapter Pattern.
Recommended Reading: Delegation Pattern.
Adapter Pattern uses composition; it delegates the calls to the ‘Adaptee’. Benefit of this is that the Adapter adapts the ‘Adaptee’, and also its sub-classes. And with that, the limitation is obvious: Anytime you add a method to the ‘Adaptee’ class or its subclasses, you have to change/extend the Adapter classes as well. You have to write the code to delegate all the necessary requests to the ‘Adaptee’.
Src: https://javarevisited.blogspot.com/2016/08/adapter-design-pattern-in-java-example.html