Using with Enum

Bulldog supports Enum type using the @Enum annotation.

@Bulldog(name = "UserSettings")
object UserModel {
    @Enum(value = Roles.user)
    val role: Roles = Roles.USER
}

enum class Roles{
  ADMIN, USER;
  
  companion object {
        const val user = "USER"
        const val admin = "ADMIN"
    }
}

You just need annotate the field the enum field and pass a default value.

Last updated