Skip to content

Add LabelInterfaces #16

@programmerr47

Description

@programmerr47

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions