moshi/adapters
Eric Cochran 5f0b2ee8e3 Allow Object base type for PolymorphicJsonAdapterFactory. (#744)
* Allow Object base type for PolymorphicJsonAdapterFactory

This works now.
Using general types like Object, Map, or List for the base type is error-prone, but the checks for these cases are not worth the code cost.

* Delete redundant test.

Let's not encourage users to use Object as a base type by showing it in a test.
2018-11-18 10:15:41 -05:00
..
src Allow Object base type for PolymorphicJsonAdapterFactory. (#744) 2018-11-18 10:15:41 -05:00
pom.xml [maven-release-plugin] prepare for next development iteration 2018-11-09 10:04:52 +11:00
README.md Use direct link to adapters snapshots. 2018-04-06 16:23:51 -07:00

Adapters

Prebuilt Moshi JsonAdapters for various things, such as Rfc3339DateJsonAdapter for parsing java.util.Dates

To use, supply an instance of your desired converter when building your Moshi instance.

Moshi moshi = new Moshi.Builder()
    .add(Date.class, new Rfc3339DateJsonAdapter())
    //etc
    .build();

Download

Download the latest JAR or grab via Maven:

<dependency>
  <groupId>com.squareup.moshi</groupId>
  <artifactId>moshi-adapters</artifactId>
  <version>latest.version</version>
</dependency>

or Gradle:

implementation 'com.squareup.moshi:moshi-adapters:latest.version'

Snapshots of the development version are available in Sonatype's snapshots repository.