moshi/adapters
Jesse Wilson 5ad9d31bd8 Move modules into their own packages.
This sets the Automatic-Module-Name for moshi, moshi-adapters, and moshi-kotlin.
It moves moshi-adapters into its own .adapters package and forwards the existing
adapter. It moves the moshi-kotlin into its own .kotlin package and forwards the
existing adapter.

I'm not certain this is necessary or sufficient, but I think it's the right idea
for JPMS compatibility.
2018-02-07 04:41:06 -05:00
..
src Move modules into their own packages. 2018-02-07 04:41:06 -05:00
pom.xml Move modules into their own packages. 2018-02-07 04:41:06 -05:00
README.md Fix builder calls to new API 2017-08-01 12:58:20 +09: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:

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

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