Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

dampcake/gson-immutable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ This project is no longer maintained.

gson-immutable

Build Status Coverage Status Maven GitHub license

Gson TypeAdapters for Guava Immutable Objects.

Requires JDK 1.6 or higher (Guava)

Javadoc

http://dampcake.github.io/gson-immutable

Usage

Maven

<dependency>
    <groupId>com.dampcake</groupId>
    <artifactId>gson-immutable</artifactId>
    <version>1.2</version>
</dependency>

Gradle

compile 'com.dampcake:gson-immutable:1.2'

Examples

Register Guava Immutable interfaces:

final Gson gson = new GsonBuilder().registerTypeAdapterFactory(ImmutableAdapterFactory.forGuava()).create();

Register Java interfaces:

final Gson gson = new GsonBuilder().registerTypeAdapterFactory(ImmutableAdapterFactory.forJava()).create();

Supported Types

Interface Immutable Version Supported?
Collection ImmutableCollection ✔️
List ImmutableList ✔️
Set ImmutableSet ✔️
SortedSet ImmutableSortedSet ✔️
NavigableSet ImmutableSortedSet ✔️
Map ImmutableMap ✔️
SortedMap ImmutableSortedMap ✔️

About

Immutable TypeAdapters for Gson

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages