June 2018
Intermediate to advanced
310 pages
6h 32m
English
You've probably encountered those adapters too. Mostly, they adapt between concepts and implementations. For example, let's take the concept of collection versus the concept of a stream:
val l = listOf("a", "b", "c")fun <T> streamProcessing(stream: Stream<T>) { // Do something with stream}
You cannot simply pass a collection to a function that receives a stream, even though it may make sense:
streamProcessing(l) // Doesn't compile
Luckily, collections provide us with the .stream() method:
streamProcessing(l.stream()) // Adapted successfully
Read now
Unlock full access