Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toBuilder() function is included in the constructor for the auto generated parcel code. #51

Open
RoryKelly opened this issue Dec 11, 2016 · 0 comments

Comments

@RoryKelly
Copy link

Builder toBuilder() function is included in the constructor for the auto generated parcel code.

Error:(128, 14) error: no suitable constructor found for AutoValue_TestSection(String,List<QuoteGroup>,Integer)
constructor AutoValue_TestSection.AutoValue_TestSection(String,List<QuoteGroup>,Integer,Builder) is not applicable
(actual and formal argument lists differ in length)
constructor AutoValue_TestSection.AutoValue_TestSection(Parcel) is not applicable
(actual and formal argument lists differ in length)

Example class.

@AutoValue @AutoGson public abstract class TestSection implements Parcelable, Comparable<TestSection> {

    public abstract String name();
    public abstract List<QuoteGroup> quoteGroups();
    public abstract Integer id();
    public abstract Builder toBuilder();

    @Override public int compareTo(@NonNull TestSection testSection) {
        return id().compareTo(testSection.id());
    }

    @AutoValue.Builder public abstract static class Builder {
        public abstract Builder name(String name);
        public abstract Builder quoteGroups(List<QuoteGroup> quoteGroups);
        public abstract Builder id(Integer id);
        public abstract TestSection build();
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant