Giter Club home page Giter Club logo

autovaluedemo's Introduction

  • 👋 Hi, I’m @LiushuiXiaoxia
  • 👀 I’m interested in ...
  • 🌱 I’m currently learning ...
  • 💞️ I’m looking to collaborate on ...
  • 📫 How to reach me ...

autovaluedemo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

autovaluedemo's Issues

AutoValueGson_MyAdapterFactory 未生成

@GsonTypeAdapterFactory
public abstract class MyAdapterFactory implements TypeAdapterFactory {

    public static TypeAdapterFactory create() {
        return new AutoValueGson_MyAdapterFactory();
    }
}

找不到AutoValueGson_MyAdapterFactory ;其他AutoValue可以生成成功,求指导

请教个问题,autoValue配gson怎么用泛型?

@AutoValue
public abstract class Result<T> {

    public abstract int code();
    public abstract String error();
    public abstract T data();

    public static <T> TypeAdapter<Result<T>> typeAdapter(Gson gson, TypeToken<T> typeToken) {
        return new AutoValue_Result.GsonTypeAdapter(gson, typeToken).nullSafe();
    }

}

请求返回固定格式,这样一个泛型,请求成功是没有问题,但是失败了,返回
{"code":0,"error":"","data":""}或{"code":0,"error":""}解析都出错,这种怎么解决呢?(不使用autovalue是没有问题的)

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.