Created
September 30, 2019 14:33
-
-
Save AdamMc331/8c6a9ea40ba36803aef3993acfb1e7ce to your computer and use it in GitHub Desktop.
A quick gist that shows a KtLint formatting issue with enum classes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum class DayEnum( | |
val index: Int, | |
val dayName: String | |
) { | |
SUNDAY( | |
index = 0, | |
dayName = "Sunday" | |
), | |
MONDAY( | |
index = 1, | |
dayName = "Monday" | |
), | |
TUESDAY( | |
index = 2, | |
dayName = "Tuesday" | |
), | |
WEDNESDAY( | |
index = 3, | |
dayName = "Wednesday" | |
), | |
THURSDAY( | |
index = 4, | |
dayName = "Thursday" | |
), | |
FRIDAY( | |
index = 5, | |
dayName = "Friday" | |
), | |
SATURDAY( | |
index = 6, | |
dayName = "Saturday" | |
); | |
fun isWeekend(): Boolean { | |
return this in listOf(SUNDAY, SATURDAY) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum class DayEnum( | |
val index: Int, | |
val dayName: String | |
) { | |
SUNDAY( | |
index = 0, | |
dayName = "Sunday" | |
), | |
MONDAY( | |
index = 1, | |
dayName = "Monday" | |
), | |
TUESDAY( | |
index = 2, | |
dayName = "Tuesday" | |
), | |
WEDNESDAY( | |
index = 3, | |
dayName = "Wednesday" | |
), | |
THURSDAY( | |
index = 4, | |
dayName = "Thursday" | |
), | |
FRIDAY( | |
index = 5, | |
dayName = "Friday" | |
), | |
SATURDAY( | |
index = 6, | |
dayName = "Saturday" | |
); | |
fun isWeekend(): Boolean { | |
return this in listOf(SUNDAY, SATURDAY) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment