forked from artem-zinnatullin/qualitymatters
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replaced Jackson by combination of GSON and AutoValue extension. (art…
…em-zinnatullin#205) * Added dependencies on gson and autovalue-gson libraries. * Implemented GsonTypeAdapterFactory which spits out Item.GsonTypeAdapter generated by autovalue. Added test which ensures that Item type is registered within factory. * Replaced EqualsVerifier in Item unit tests, which was failing against AutoValue_Item (it was trying to instantiate super type ($AutoValue_Type) with null arguments, as the result .equals() and .hascode() methods were throwing NPE. Suppressing warnings did not help. * Replaced GsonTypeAdapterFactory with generated implementation from autovalue-gson. Removed redundant tests.
- Loading branch information
1 parent
4b3aeae
commit 8b9389b
Showing
9 changed files
with
77 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
app/src/main/java/com/artemzin/qualitymatters/other/EntityTypeAdapterFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.artemzin.qualitymatters.other; | ||
|
||
import com.google.gson.TypeAdapterFactory; | ||
import com.ryanharter.auto.value.gson.GsonTypeAdapterFactory; | ||
|
||
@GsonTypeAdapterFactory | ||
public abstract class EntityTypeAdapterFactory implements TypeAdapterFactory { | ||
|
||
public static TypeAdapterFactory create() { | ||
return new AutoValueGson_EntityTypeAdapterFactory(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters