Giter VIP home page Giter VIP logo

Comments (4)

rharter avatar rharter commented on June 21, 2024 1

I don't think that really fits.

First of all, this isn't an Android project, it's a Java project. I'm sure you were thinking of an AAR in addition to a JAR, but I'm not sure that it makes sense just for a lint check.

Secondly, not having a typeAdapter method is completely valid. The idea is that you might not want all AutoValue annotated classes to have generated type adapters. In my cases, this is particularly useful since I use AutoValue types for local db related items in addition to objects returns from the web services, but only the remote items need type adapters.

If there's something I'm missing, I'm happy to discuss.

from auto-value-gson.

williamwebb avatar williamwebb commented on June 21, 2024

No you understood correctly.

For my information the adapter is always created regardless if the method is present or not correct?

from auto-value-gson.

rharter avatar rharter commented on June 21, 2024

No, you do need to include a public static method returning a TypeAdapter<Foo> that takes a Gson object. That's how the extension determines if it should generate a TypeAdapter or not. That is defined here

from auto-value-gson.

williamwebb avatar williamwebb commented on June 21, 2024

Gotcha, makes a lost more sense now :). Thanks.

from auto-value-gson.

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.