In case when we have an action method in Category Interface with enumeration of labels, we need to create special enum for it, if there are no other options. I think, it will be better to provide special LabelInterface. So for example, this:
interface AnalyticsPerson {
fun live(type: LiveTypeLabel)
}
enum class LiveTypeLabel { FLAT, HOUSE, APARTMENT }
will be converted to this:
interface AnalyticsPerson {
fun live(): LiveLabel
}
interface LiveLabel {
fun flat()
fun house()
fun apartment()
}
So the invocation of it will look like:
analyticsPerson.live().flat() instead of analyticsPerson.live(FLAT)
Moreover it can help to decrease number of duplication since there could be several action methods with same enum params, and when they will be used we can totally replace one invocation with another.
In case when we have an action method in Category Interface with enumeration of labels, we need to create special enum for it, if there are no other options. I think, it will be better to provide special LabelInterface. So for example, this:
will be converted to this:
So the invocation of it will look like:
analyticsPerson.live().flat()instead ofanalyticsPerson.live(FLAT)Moreover it can help to decrease number of duplication since there could be several action methods with same enum params, and when they will be used we can totally replace one invocation with another.