Tag: enums

如何使用Kotlin enum和Retrofit?

我怎样才能解析JSON模型与枚举? 这是我的枚举类: enum class VehicleEnumEntity(val value: String) { CAR("vehicle"), MOTORCYCLE("motorcycle"), VAN("van"), MOTORHOME("motorhome"), OTHER("other") } 我需要解析type为一个枚举 “vehicle”:{“data”:{“type”:“vehicle”,“id”:“F9dubDYLYN”}} 编辑 我试过标准的方式,只是通过我的枚举POJO,它总是空