aeruhxi
02/11/2020, 6:19 AMkyleg
02/11/2020, 6:27 AMaeruhxi
02/11/2020, 6:28 AMaeruhxi
02/11/2020, 6:29 AMkyleg
02/11/2020, 6:30 AMkyleg
02/11/2020, 6:30 AMenum class
instead depending on your goal.Fleshgrinder
02/11/2020, 6:47 AMjw
02/11/2020, 1:47 PMFleshgrinder
02/11/2020, 2:08 PMaeruhxi
02/13/2020, 6:25 AMinterface ID
inline class AID(val value: String) : ID
inline class BID(val value: String) : ID
val result = when (id) {
is AID -> /* do something with AID */
is BID -> /* do something with BID */
else -> Either.Left(
DatabaseError.Unhandled("Wrong type of ID")
)
}
aeruhxi
02/13/2020, 6:40 AMFleshgrinder
02/13/2020, 8:03 AM