-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'developer' of https://github.com/eluchsinger/After-Hour…
…-Android into developer Updated Ticket.class
- Loading branch information
Showing
5 changed files
with
65 additions
and
20 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
31 changes: 31 additions & 0 deletions
31
app/src/main/java/ch/hsr/afterhour/service/server/CustomGsonParser.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,31 @@ | ||
package ch.hsr.afterhour.service.server; | ||
|
||
import com.google.gson.Gson; | ||
import com.google.gson.GsonBuilder; | ||
|
||
import java.io.Serializable; | ||
|
||
import ch.viascom.groundwork.foxhttp.parser.FoxHttpParser; | ||
|
||
/** | ||
* Created by eluch on 26.05.2017. | ||
*/ | ||
|
||
public class CustomGsonParser implements FoxHttpParser { | ||
|
||
private final Gson gson; | ||
|
||
public CustomGsonParser(final Gson gson) { | ||
this.gson = gson; | ||
} | ||
|
||
@Override | ||
public Serializable serializedToObject(String json, Class<Serializable> type) { | ||
return gson.fromJson(json, type); | ||
} | ||
|
||
@Override | ||
public String objectToSerialized(Serializable o) { | ||
return gson.toJson(o); | ||
} | ||
} |
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