A quick tutorial on implementing the composite design pattern in Kotlin.
Baeldung Author
Ewane Enombe
Here's what I've written (so far):
Baeldung on Kotlin
- All
- Kotlin Collections (12)
- Kotlin Strings (11)
- Patterns (4)
- Algorithms (3)
- Libraries (2)
- Kotlin Numbers (2)
- Testing (1)
- Kotlin-Java Interop (1)
- Kotlin IO (1)
- Kotlin Functions (1)
- Kotlin Dates (1)
- Kotlin Classes and Objects (1)
- Kotlin Basics (1)
- Kotlin (1)
In Place Modification of Map Entry in Kotlin
Filed under Kotlin Collections
A quick tutorial on in-place modification of maps in Kotlin.
Check if an Enum Value Contains a Given String in Kotlin
Filed under Kotlin Basics
A quick tutorial on checking if a given string matches an enum value in Kotlin.
Convert String to Char in Kotlin
Filed under Kotlin Strings
A quick tutorial on converting strings to characters in Kotlin.
Creating a Map from Two Arrays in Kotlin
Filed under Kotlin Collections
A quick tutorial on converting two arrays into a map in Kotlin.
Counting Occurrences of a Value in a List in Kotlin
Filed under Kotlin Collections
A quick tutorial on counting the number of times an item appears in a list in Kotlin.
Skip Null Values When Converting a List to a Map in Kotlin
Filed under Kotlin Collections
A quick tutorial on removing null values when converting a list to a map in Kotlin.
Calling Private Methods of a Class From Outside the Class
Filed under Kotlin Classes and Objects
A quick tutorial on calling private methods from outside of the class they are declared within in Kotlin.
How to Calculate Standard Deviation in Kotlin
Filed under Algorithms
A quick guide to calculating standard deviation of sets of numbers in Kotlin.
How to Extract Individual Values From a JSON String
Filed under Kotlin Strings
A quick guide to extracting individual values from JSON strings in Kotlin.
How to Reverse the Order of Words in a Sentence in Kotlin
Filed under Kotlin Strings
A quick tutorial on reversing the word order in a sentence with Kotlin.
How to Convert a String to a Float in Kotlin
Filed under Kotlin Numbers, Kotlin Strings
A quick tutorial about converting strings to floats in Kotlin.
How to Repeat a String N Times in Kotlin
Filed under Kotlin Strings
A quick tutorial on repeating strings in Kotlin.
Idiomatic Ways to Transform Maps in Kotlin
Filed under Kotlin Collections
Explore several strategies for transforming Maps in Kotlin.
How to Reverse a String in Kotlin
Filed under Kotlin Strings
Explore the techniques of reversing a string in Kotlin.
How to Create a Frequency Map in Kotlin
Filed under Kotlin Collections
Explore several strategies for creating a frequency map in Kotlin.
Matrix Addition and Multiplication in Kotlin
Filed under Kotlin Collections
Learn how to perform matrix addition and multiplication in Kotlin.
How to Sort Elements in Lexicographical Order in Kotlin
Filed under Kotlin Collections
Learn several strategies for ignoring the case when sorting word collections lexicographically.
Merge Sort in Kotlin
Filed under Kotlin Collections
Learn several strategies of implementing the merge sort in Kotlin.
Quicksort in Kotlin
Filed under Algorithms
Explore a few variations of the quicksort algorithm in Kotlin.
Check if a Character Is Alphabetic or Not in Kotlin
Filed under Kotlin Strings
Explore various techniques to determine if a character is alphabetic in Kotlin.
Check Whether a Character Is a Vowel or Consonant in Kotlin
Filed under Kotlin Strings
Learn several strategies for determining if a char is a consonant or vowel in Kotlin.
The Facade Pattern in Kotlin
Filed under Patterns
Explore how to manage complexity with the facade pattern in Kotlin.
Check if a String Is a Palindrome in Kotlin
Filed under Kotlin Strings
Discover a few strategies for determining if a string is a palindrome in Kotlin.
The Adapter Pattern in Kotlin
Filed under Patterns
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.
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.
Convert Java to Kotlin
Filed under Kotlin-Java Interop
This article explores various ways of converting Java code to Kotlin code, including using IntelliJ IDE or Android Studio, an online tool called JavaInUse, and the advantages of Kotlin over Java. It also discusses the limitations of each method and provides recommendations for when to use them.
Calculate the Power of a Number in Kotlin
Filed under Algorithms
Learn how to calculate the power of a number in different ways, using Kotlin.
Using Lombok With Kotlin
Filed under Libraries
While Kotlin provides many features that remove the need for Lombok, we may wish to use Lombok with Java classes in Kotlin. We look at how this is possible and its limitations.
How to Serialize Arrays in Kotlin With Kotlinx.serialization
Filed under Kotlin Collections
Learn how data can be serialized using Kotlin’s kotlinx-serialization library.
How to Convert a Date Time String to Instant in Kotlin
Filed under Kotlin Dates, Kotlin Strings
Learn how to convert a date time string to Instant in Kotlin.
Serialize Kotlin Data Class With Default Values Into JSON
Filed under Kotlin IO
A quick and practical guide to serializing Kotlin classes to JSON with default values.
Common String Extension Functions in Kotlin
Filed under Kotlin Strings
Learn how to use several common extension functions for strings in Kotlin.