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

Exporting of individual Enum Values #74

Closed
creativepsyco opened this issue Dec 10, 2013 · 5 comments
Closed

Exporting of individual Enum Values #74

creativepsyco opened this issue Dec 10, 2013 · 5 comments

Comments

@creativepsyco
Copy link
Contributor

Currently Google Protocol Buffer code generation exports a VALUE field for Enums, whereas Wire does not do so. Is this by design?

@JakeWharton
Copy link
Collaborator

What does this field contain? The tag number?

@creativepsyco
Copy link
Contributor Author

Not really something like this:

message EditError
{
    enum ErrorType
    {
        MAX_NUM_OPTIONS = 1;
        MAX_NUM_SESSION = 2;
    }
    required ErrorType Error = 1;
}

In Java I am unable to extract the enum integer value from a Wire code generated class, something that Google Protocol Buffer Code generation allowed me to have via a public EnumName_VALUE field.

@danrice67
Copy link
Collaborator

Seems simple enough. You're welcome to submit a pull request to add it, or I can do it sometime after the New Year.

@creativepsyco
Copy link
Contributor Author

Which code sections should I be looking at? Wire has helped me remove 14K protobuf methods from the generated APK. I shall be very happy to contribute =)

@danrice67
Copy link
Collaborator

Look for

writer.beginType(enumType.getName(), "enum", EnumSet.of(PUBLIC));

in MessageEmitter.java.

JakeWharton added a commit that referenced this issue Jan 15, 2014
Add Additional statements for exporting individual Enum Values See #74
mattprecious pushed a commit that referenced this issue Apr 15, 2014
month_name_format LLLL breaks build and API compatibility
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

3 participants