dalexander
11/10/2016, 5:48 PMval currentIndexName = indexToAliasMappings.filter {
val (index, aliasMappings) = it
aliasMappings.get("aliases")?.containsKey(alias) ?: false
}.lastOrNull() ?: “”
will do the same thing as what you have. (haven’t tested). val evens = listOf(1, 2, 3, 4).filter{ it % 2 == 0 }
is a simple example of using filter, evens
will be a list with the values 2, 4