Skip to content

A set of GSON serialiser/deserialisers for dealing with Java 8 java.time entities.

License

Notifications You must be signed in to change notification settings

gkopff/gson-javatime-serialisers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gson-javatime-serialisers

What is it?

A set of GSON serialiser/deserialisers for dealing with Java 8 java.time entities. Wherever possible, ISO 8601 string representations are used.

Getting it

<dependency>
  <groupId>com.fatboyindustrial.gson-javatime-serialisers</groupId>
  <artifactId>gson-javatime-serialisers</artifactId>
  <version>1.1.2</version>
</dependency>

Using it

final Gson gson = Converters.registerOffsetDateTime(new GsonBuilder()).create();
final OffsetDateTime original = OffsetDateTime.now();

final String json = gson.toJson(original);
final OffsetDateTime reconstituted = gson.fromJson(json, OffsetDateTime.class);

Testing

Unrelated to gson-javatime-serialisers itself, but if you're working with Java 8 time, you may be interested in spencerwi/hamcrest-jdk8-time

About

A set of GSON serialiser/deserialisers for dealing with Java 8 java.time entities.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages