Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Fu alexfu

View GitHub Profile
@JakeWharton
JakeWharton / AutoGson.java
Last active Aug 7, 2021
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
View AutoGson.java
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>