diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-10-29 14:11:43 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-10-29 14:11:43 +0300 |
commit | 842f4b79f5f71a5656ab41911e083d900d08c087 (patch) | |
tree | c08ddf30ad9a567b40b201c2b9735398be12fa59 /app/src/main/java/it/niedermann/nextcloud/deck/api | |
parent | af9ffdff5bf98a45406fbb003214bd2c0ba60604 (diff) |
#715 Use java.time.*
Fix formatting
Signed-off-by: Stefan Niedermann <info@niedermann.it>
Diffstat (limited to 'app/src/main/java/it/niedermann/nextcloud/deck/api')
-rw-r--r-- | app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java | 90 |
1 files changed, 36 insertions, 54 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java b/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java index c748e0e03..b5fcd1f90 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/api/GsonConfig.java @@ -32,65 +32,47 @@ public class GsonConfig { private static final Gson INSTANCE; static { - Type boardList = new TypeToken<List<FullBoard>>() { - }.getType(); - Type board = new TypeToken<FullBoard>() { - }.getType(); - Type cardList = new TypeToken<FullCard>() { - }.getType(); - Type card = new TypeToken<FullCard>() { - }.getType(); - Type labelList = new TypeToken<Label>() { - }.getType(); - Type label = new TypeToken<Label>() { - }.getType(); - Type stackList = new TypeToken<List<FullStack>>() { - }.getType(); - Type stack = new TypeToken<FullStack>() { - }.getType(); - Type capabilities = new TypeToken<Capabilities>() { - }.getType(); - Type ocsUserList = new TypeToken<OcsUserList>() { - }.getType(); - Type ocsUser = new TypeToken<OcsUser>() { - }.getType(); - Type activity = new TypeToken<Activity>() { - }.getType(); - Type activityList = new TypeToken<List<Activity>>() { - }.getType(); - Type attachment = new TypeToken<Attachment>() { - }.getType(); - Type attachmentList = new TypeToken<List<Attachment>>() { - }.getType(); - Type comment = new TypeToken<OcsComment>() { - }.getType(); - Type projectList = new TypeToken<OcsProjectList>() { - }.getType(); - Type groupMembers = new TypeToken<GroupMemberUIDs>() { - }.getType(); + Type boardList = new TypeToken<List<FullBoard>>() {}.getType(); + Type board = new TypeToken<FullBoard>() {}.getType(); + Type cardList = new TypeToken<FullCard>() {}.getType(); + Type card = new TypeToken<FullCard>() {}.getType(); + Type labelList = new TypeToken<Label>() {}.getType(); + Type label = new TypeToken<Label>() {}.getType(); + Type stackList = new TypeToken<List<FullStack>>() {}.getType(); + Type stack = new TypeToken<FullStack>() {}.getType(); + Type capabilities = new TypeToken<Capabilities>() {}.getType(); + Type ocsUserList = new TypeToken<OcsUserList>() {}.getType(); + Type ocsUser = new TypeToken<OcsUser>() {}.getType(); + Type activity = new TypeToken<Activity>() {}.getType(); + Type activityList = new TypeToken<List<Activity>>() {}.getType(); + Type attachment = new TypeToken<Attachment>() {}.getType(); + Type attachmentList = new TypeToken<List<Attachment>>() {}.getType(); + Type comment = new TypeToken<OcsComment>() {}.getType(); + Type projectList = new TypeToken<OcsProjectList>() {}.getType(); + Type groupMembers = new TypeToken<GroupMemberUIDs>() {}.getType(); INSTANCE = new GsonBuilder() .setDateFormat(DATE_PATTERN) .setLenient() - .registerTypeAdapter(Instant.class, new GsonUTCInstantAdapter()) - .registerTypeAdapter(boardList, new NextcloudArrayDeserializer<>("boards", FullBoard.class)) - .registerTypeAdapter(board, new NextcloudDeserializer<>("board", FullBoard.class)) - .registerTypeAdapter(cardList, new NextcloudArrayDeserializer<>("cards", FullCard.class)) - .registerTypeAdapter(card, new NextcloudDeserializer<>("card", FullCard.class)) - .registerTypeAdapter(labelList, new NextcloudArrayDeserializer<>("labels", Label.class)) - .registerTypeAdapter(label, new NextcloudDeserializer<>("label", Label.class)) - .registerTypeAdapter(stackList, new NextcloudArrayDeserializer<>("stacks", FullStack.class)) - .registerTypeAdapter(stack, new NextcloudDeserializer<>("stack", FullStack.class)) - .registerTypeAdapter(capabilities, new NextcloudDeserializer<>("capability", Capabilities.class)) - .registerTypeAdapter(ocsUserList, new NextcloudDeserializer<>("ocsUserList", OcsUserList.class)) - .registerTypeAdapter(ocsUser, new NextcloudDeserializer<>("ocsUser", OcsUser.class)) - .registerTypeAdapter(activity, new NextcloudDeserializer<>("activity", Activity.class)) - .registerTypeAdapter(activityList, new NextcloudDeserializer<>("activityList", Activity.class)) + .registerTypeAdapter(Instant.class, new GsonUTCInstantAdapter()) + .registerTypeAdapter(boardList, new NextcloudArrayDeserializer<>("boards", FullBoard.class)) + .registerTypeAdapter(board, new NextcloudDeserializer<>("board", FullBoard.class)) + .registerTypeAdapter(cardList, new NextcloudArrayDeserializer<>("cards", FullCard.class)) + .registerTypeAdapter(card, new NextcloudDeserializer<>("card", FullCard.class)) + .registerTypeAdapter(labelList, new NextcloudArrayDeserializer<>("labels", Label.class)) + .registerTypeAdapter(label, new NextcloudDeserializer<>("label", Label.class)) + .registerTypeAdapter(stackList, new NextcloudArrayDeserializer<>("stacks", FullStack.class)) + .registerTypeAdapter(stack, new NextcloudDeserializer<>("stack", FullStack.class)) + .registerTypeAdapter(capabilities, new NextcloudDeserializer<>("capability", Capabilities.class)) + .registerTypeAdapter(ocsUserList, new NextcloudDeserializer<>("ocsUserList", OcsUserList.class)) + .registerTypeAdapter(ocsUser, new NextcloudDeserializer<>("ocsUser", OcsUser.class)) + .registerTypeAdapter(activity, new NextcloudDeserializer<>("activity", Activity.class)) + .registerTypeAdapter(activityList, new NextcloudDeserializer<>("activityList", Activity.class)) .registerTypeAdapter(attachmentList, new NextcloudArrayDeserializer<>("attachments", Attachment.class)) - .registerTypeAdapter(attachment, new NextcloudDeserializer<>("attachment", Attachment.class)) - .registerTypeAdapter(comment, new NextcloudDeserializer<>("comment", OcsComment.class)) - .registerTypeAdapter(projectList, new NextcloudDeserializer<>("projectList", OcsProjectList.class)) - .registerTypeAdapter(groupMembers, new NextcloudDeserializer<>("groupMembers", GroupMemberUIDs.class)) + .registerTypeAdapter(attachment, new NextcloudDeserializer<>("attachment", Attachment.class)) + .registerTypeAdapter(comment, new NextcloudDeserializer<>("comment", OcsComment.class)) + .registerTypeAdapter(projectList, new NextcloudDeserializer<>("projectList", OcsProjectList.class)) + .registerTypeAdapter(groupMembers, new NextcloudDeserializer<>("groupMembers", GroupMemberUIDs.class)) .create(); } |