Created
January 6, 2017 14:27
-
-
Save agustarc/b7d423369ace01318a0395103e5a94c2 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 | |
abstract class ProductBuilder { | |
@SerializedName("id") | |
abstract long getId(); | |
@SerializedName("name") | |
abstract String getName(); | |
@SerializedName("price") | |
abstract float getPrice(); | |
static TypeAdapter<ProductBuilder> typeAdapter(Gson gson) { | |
return new AutoValue_ProductBuilder.GsonTypeAdapter(gson); | |
} | |
static Builder builder() { | |
return new AutoValue_ProductBuilder.Builder(); | |
} | |
@AutoValue.Builder | |
static abstract class Builder { | |
abstract Builder setId(long id); | |
abstract Builder setName(String name); | |
abstract Builder setPrice(float price); | |
abstract ProductBuilder build(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment