Skip to content

Instantly share code, notes, and snippets.

View shadygoneinsane's full-sized avatar
📚
Learning new things everyday

Vikesh Dass shadygoneinsane

📚
Learning new things everyday
View GitHub Profile
@shadygoneinsane
shadygoneinsane / AttendanceRelationShip
Created June 18, 2019 08:17
Sealed Class example for mapping enums for Relationship Types for Attendance
sealed class AttendanceRelationship(val status: String) {
class Present : AttendanceRelationship("Present")
class Absent : AttendanceRelationship("Absent")
class WeeklyOff : AttendanceRelationship("Weekly off")
companion object {
fun create(int: Int): AttendanceRelationship {
return when (RelationshipType.valueOf(int)) {