orhanobut / hawk

✔️ Secure, simple key-value storage for Android
Apache License 2.0
3.98k stars 388 forks source link

Extract GsonParser into another artifact and provide other parsers such as Jackson etc #210

Open orhanobut opened 6 years ago

orhanobut commented 6 years ago

Hawk requires Gson to serialize/deserialize the value. There is a way to invert this dependency by using Parser interface but transitively Gson will be added to the final apk. In order to avoid that, both consumer and Hawk should depend on abstraction and concrete implementation should be provided by the consumer.

Hawk.init(context)
  .setParser(new GsonParser())
  .build();
shenghaiyang commented 6 years ago

Like retrofit converter, add a built in converter and some third part converters.