gson-javatime-serialisers

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

License

License

The MIT License (MIT)
Categories

Categories

Gson Data JSON
GroupId

GroupId

com.fatboyindustrial.gson-javatime-serialisers
ArtifactId

ArtifactId

gson-javatime-serialisers
Last Version

Last Version

1.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

gson-javatime-serialisers
A set of GSON serialisers/deserialisers for dealing with Java 8 java.time entities.
Project URL

Project URL

https://github.com/gkopff/gson-javatime-serialisers
Source Code Management

Source Code Management

https://github.com/gkopff/gson-javatime-serialisers

Download gson-javatime-serialisers

How to add to project

<!-- https://jarcasting.com/artifacts/com.fatboyindustrial.gson-javatime-serialisers/gson-javatime-serialisers/ -->
<dependency>
    <groupId>com.fatboyindustrial.gson-javatime-serialisers</groupId>
    <artifactId>gson-javatime-serialisers</artifactId>
    <version>1.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.fatboyindustrial.gson-javatime-serialisers/gson-javatime-serialisers/
implementation 'com.fatboyindustrial.gson-javatime-serialisers:gson-javatime-serialisers:1.1.1'
// https://jarcasting.com/artifacts/com.fatboyindustrial.gson-javatime-serialisers/gson-javatime-serialisers/
implementation ("com.fatboyindustrial.gson-javatime-serialisers:gson-javatime-serialisers:1.1.1")
'com.fatboyindustrial.gson-javatime-serialisers:gson-javatime-serialisers:jar:1.1.1'
<dependency org="com.fatboyindustrial.gson-javatime-serialisers" name="gson-javatime-serialisers" rev="1.1.1">
  <artifact name="gson-javatime-serialisers" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.fatboyindustrial.gson-javatime-serialisers', module='gson-javatime-serialisers', version='1.1.1')
)
libraryDependencies += "com.fatboyindustrial.gson-javatime-serialisers" % "gson-javatime-serialisers" % "1.1.1"
[com.fatboyindustrial.gson-javatime-serialisers/gson-javatime-serialisers "1.1.1"]

Dependencies

compile (1)

Group / Artifact Type Version
com.google.code.gson : gson jar 2.3.1

test (2)

Group / Artifact Type Version
junit : junit jar 4.11
org.hamcrest : hamcrest-all jar 1.3

Project Modules

There are no modules declared in this project.

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.1</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

Versions

Version
1.1.1
1.1.0
1.0.0