Design patterns·Wrapping and composing
the library's method was called differently and returned the wrong shape, so you wrote a class that speaks both.
Adapter pattern
Also calledadapter, wrapper pattern, translator
A wrapper that converts one interface into another the caller already expects, so two things that were not designed together can work together. The intent is incompatibility, and that is what separates it from the other three wrappers: the adapter's interface is deliberately different from the thing it wraps. It is the pattern that keeps a third-party SDK from spreading through a codebase, which is the same argument the anti-corruption layer makes at the service boundary.