spand
04/16/2020, 2:14 PM.method(true)
or .method(false)
. I would like to migrate that to .method(SortOrder.ASC)
and .method(SortOrder.DESC)
respectively. Can I do that with @Deprecated
or something similar that can be triggered on an entire project?
(I can easily end up with .method(if(true) SortOrder.ASC else SortOrder.DESC)
but I would like to automate the final step)CLOVIS
04/16/2020, 2:25 PM@Deprecated
fun method(thing: Boolean) { method(if (true) ASC else DESC) }
fun method(thing: SortedOrder) { ... }
This way your old code can continue calling the old function, and you can use the new code for everything elsenkiesel
04/20/2020, 7:00 PMSortOrder
to keep the knowledge of true == ASC
in a single place and then use
@Deprecated("Use SortOrder")
fun method(asc: Boolean) {
method(SortOrder.fromBoolean(asc))
}