Giter Site home page Giter Site logo

Exporting of individual Enum Values about wire HOT 5 CLOSED

square avatar square commented on August 28, 2024
Exporting of individual Enum Values

from wire.

Comments (5)

JakeWharton avatar JakeWharton commented on August 28, 2024

What does this field contain? The tag number?

from wire.

creativepsyco avatar creativepsyco commented on August 28, 2024

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.

from wire.

danrice67 avatar danrice67 commented on August 28, 2024

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

from wire.

creativepsyco avatar creativepsyco commented on August 28, 2024

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 =)

from wire.

danrice67 avatar danrice67 commented on August 28, 2024

Look for

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

in MessageEmitter.java.

from wire.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.