Created
January 6, 2017 14:04
-
-
Save agustarc/550a16a0bbcde81aeb4466700cc91a13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@AutoValue | |
public abstract class Product { | |
@SerializedName("id") | |
public abstract long getId(); | |
@SerializedName("name") | |
public abstract String getName(); | |
@SerializedName("price") | |
public abstract float getPrice(); | |
public static TypeAdapter<Product> typeAdapter(Gson gson) { | |
return new AutoValue_Product.GsonTypeAdapter(gson); | |
} | |
public static Product create(long id, String name, float price) { | |
return new AutoValue_Product(id, name, price); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment