Yelp / parcelgen

Helpful tool to make data objects easier for Android
Other
65 stars 35 forks source link

enum should be in their own files #37

Open redwarp opened 8 years ago

redwarp commented 8 years ago

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.

jbrick commented 8 years ago

The counterargument is what happens when you have two parcel generate classes that define an enum of the same name, but for different purposes?

We originally had them separated, but decided we wanted to be safe and avoid this problem.