diesieben07
05/07/2018, 9:14 AMlist.associate { key to value } or list.associateBy { key }elect
05/07/2018, 9:16 AMpartition step?elect
05/07/2018, 9:16 AMval properties = FiledOrder::class.declaredMemberProperties
val parts = properties.partition { it.findAnnotation<FiledOrder.Order>() != null }
val plain = parts.first.sortedBy { it.name }
val annotated = parts.second.associateBy { it.findAnnotation<FiledOrder.Order>()!!.value }elect
05/07/2018, 9:17 AMvalue as keyelect
05/07/2018, 9:17 AMclass FiledOrder {
@Retention(AnnotationRetention.RUNTIME)
annotation class Order(val value: Int)diesieben07
05/07/2018, 9:19 AMelect
05/07/2018, 9:38 AM