yelp / parcelgen Goto Github PK
View Code? Open in Web Editor NEWHelpful tool to make data objects easier for Android
License: Other
Helpful tool to make data objects easier for Android
License: Other
Tracking here, add support for marking fields as transient in the generated java class. I'm already done with these (easy) changes.
"transient": [ currentLocation, statusUpdate ]
Looks like we're always getting an extra space character when overriding equals()
if (object == this ) {
return true;
}
When the CREATOR is autogenerated the methods createFromParcel and newArray don't have the @OverRide annotation.
I think enums, being specific class, should be also defined in a specific json file, with of format like
{
"do_json": true,
"package": "com.yelp.android.biz.serializable",
"type": "enum",
"values": [
"VALUE_1",
"VALUE_2",
...
]
}
The fact that they are currently generated inside another class makes it impossible to reuse them among parcel generated classes.
Right now I believe the parser will default to defaulting to 0 when parsing nonexistent keys with optInt and optLong; it would be better if long and int parsing defaulted to -1. Double parsing already correctly defaults to NaN.
However, the best option would be if the fallback value were definable in the json.
Should create equals method. This will allow subclasses of generated classes to not need to recreate the equals method.
Remove imports.add(com.yelp.android.BuildConfig) on line 234, this is a hardcoded import that will cause issues if the script is being used with another package. We need it just to log out some stuff if in debug mode, we can get rid of those lines for now.
when adding extends field it doesn't call super in overriden methods like readFromJson, writeJSON, writeToParcel, and readFromParcel
Most libraries like this are now not used statically but included in build.gradle. Can this one be done that way?
When declaring an enum a .json file, after running parcel gen, the different values of the enum are created in PascalCase.
This is rather inconsistent with the generic consensus for this, which would be to use SCREAMING_SNAKE_CASE.
And actually, in our Yelp apps, we 99% of the time use the SCREAMING_SNAKE_CASE.
The official java tutorial (https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html) uses that as well.
Providing support for Enum values (we'll need a way to define all the possible values, too).
Should include both Parcelable and JSON support.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.