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

Getters/Setters instead of public fields? #53

Closed
matheusjardimb opened this issue Nov 13, 2014 · 3 comments
Closed

Getters/Setters instead of public fields? #53

matheusjardimb opened this issue Nov 13, 2014 · 3 comments

Comments

@matheusjardimb
Copy link

It seems that class fields need to be public in order to parceler work. Is it right?

Can't we use getter/setter methods instead?

@matheusjardimb
Copy link
Author

BTW, great project!

@johncarl81
Copy link
Owner

You can use any available modifier on fields: public, protected, nothing (package private) or private. Private requires reflection so it is not advised.

To use getters and setters instead of fields (which need to be public per the java bean spec) annotate your bean like so:

@Parcel(Serialization.METHOD)

And thanks!

@matheusjardimb
Copy link
Author

Thanks for the quick response! Not a bug :)

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

2 participants