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

Adds direct encoding of property types. Fixes #12 #16

Merged
merged 4 commits into from Nov 2, 2015

Conversation

rharter
Copy link
Owner

@rharter rharter commented Oct 30, 2015

No description provided.

@@ -36,6 +43,34 @@
@AutoService(AutoValueExtension.class)
public class AutoValueParcelExtension extends AutoValueExtension {

public static final class Property {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop public

@JakeWharton
Copy link
Collaborator

This looks like it's missing @Nullable support. Generated code will need to read/write a 0 or 1 indicator of null.

in.readInt() == 0 ? in.readParcelable : null,
if (d() == null) {
  dest.writeInt(1);
} else {
  dest.writeInt(0);
  dest.writeParcelable(d());
}

@JakeWharton
Copy link
Collaborator

Looks great though!

@rharter
Copy link
Owner Author

rharter commented Nov 2, 2015

Good call on the @Nullable. I had completely forgotten that case.

@rharter
Copy link
Owner Author

rharter commented Nov 2, 2015

@JakeWharton Thanks for the feedback!

rharter added a commit that referenced this pull request Nov 2, 2015
Adds direct encoding of property types. Fixes #12
@rharter rharter merged commit c532581 into master Nov 2, 2015
@rharter rharter deleted the feature/property_types branch June 22, 2016 18:27
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

Successfully merging this pull request may close these issues.

None yet

2 participants