The article introduces the Adapter Pattern in Kotlin, a design pattern that enables collaboration between classes with incompatible interfaces. We use an Audio Player example to demonstrate how the pattern works.
Also find me here:
Baeldung Author
Ewane Enombe
I'm an experienced software engineer with over 7 years of experience in the field. I specialize in cloud services, Android app development using Java and Kotlin, as well as Django with Python. One of my passions is technical documentation, and I'm always looking for ways to improve my skills in this area. I love helping people get better technically and I feel fulfilled knowing that I can make a positive impact on someone's career. In my free time, I enjoy playing chess. It's a great way to unwind and exercise my mind. I find that playing chess helps me to stay sharp and focused, which translates to better productivity when I'm back at work. Overall, I'm proud of the work I've done as a software engineer and I'm excited to continue growing and learning in this field.
Here's what I've written (so far):
Baeldung on Kotlin
- All
- Kotlin Strings (11)
- Kotlin Collections (11)
- Patterns (4)
- Kotlin Basics (3)
- Algorithms (3)
- Libraries (2)
- Kotlin-Java Interop (2)
- Kotlin Numbers (2)
- Kotlin Classes and Objects (2)
- Kotlin Arrays (2)
- Testing (1)
- Kotlin IO (1)
- Kotlin Functions (1)
- Kotlin Dates (1)
- Kotlin (1)
The Chain of Responsibility Pattern in Kotlin
Filed under Patterns
Learn how to apply the Chain of Responsibility pattern in Kotlin with a practical example.
Convert Binary Number to Decimal and Vice Versa in Kotlin
Filed under Kotlin Numbers
Learn how to convert between binary and decimal numbers in Kotlin.
Kotest: Assert a List Has Elements with Specific Properties
Filed under Testing
Learn strategies for verifying properties on objects inside of lists with Kotest.
Converting a Map to a String in Kotlin
Filed under Kotlin Collections
Learn several strategies to convert Maps to Strings in Kotlin, including some techniques to create JSON representations.
Get Difference Between Two Lists in Kotlin
Filed under Kotlin Collections
Learn several ways of computing the difference between two lists in Kotlin.
Callback Functions in Kotlin
Filed under Kotlin Functions
Learn how to use Kotlin callback functions effectively.
Opt-in Requirements in Kotlin
Filed under Kotlin
Learn about Opt-in APIs in Kotlin, including how to use them and how to make your own.
Using the Gson TypeToken in Kotlin
Filed under Libraries
Explore how to deserialize JSON to generic Kotlin objects with the Gson TypeToken.