Skip to content

Instantly share code, notes, and snippets.

@steliosfran
Created November 17, 2022 10:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steliosfran/b424bae2b7b8ad750c7921624a415b35 to your computer and use it in GitHub Desktop.
Save steliosfran/b424bae2b7b8ad750c7921624a415b35 to your computer and use it in GitHub Desktop.
class GenericEnumJsonAdapter<T> : JsonAdapter<T>() {
@FromJson
override fun fromJson(reader: JsonReader): T? {
// Cannot access enumValues<T>()
}
@ToJson
override fun toJson(writer: JsonWriter, value: T?) {
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment