Skip to content

Instantly share code, notes, and snippets.

@miquelbeltran
Last active May 19, 2017 06:33
Show Gist options
  • Select an option

  • Save miquelbeltran/6e7c4116718009f8ed7f2447e607dc05 to your computer and use it in GitHub Desktop.

Select an option

Save miquelbeltran/6e7c4116718009f8ed7f2447e607dc05 to your computer and use it in GitHub Desktop.
@AutoValue
public abstract class MyValue implements Parcelable {
public abstract int getId();
public abstract String getTitle();
public abstract int getCount();
public abstract boolean getEnabled();
public static Builder builder() {
return new AutoValue_MyValue.Builder()
.setTitle("")
.setCount(0)
.setEnabled(false);
}
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setId(int newId);
public abstract Builder setTitle(String newTitle);
public abstract Builder setCount(int newCount);
public abstract Builder setEnabled(boolean newEnabled);
public abstract HoodValue build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment