Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Fixing TimestampValidationStrategy <-> gson impcompabibility #8

Merged
merged 1 commit into from
Oct 22, 2019

Conversation

franmontiel
Copy link
Contributor

Added changes to avoid lastUpdate and expiryTime to be null when parsing using gson:

  • For lastUpdate I've created an nullable private var and a custom getter to avoid the NullPointerException when accessing the field.

    • From the perspective of anyone that uses the class everything is the same as if we were using "val lastUpdate" in the constructor
  • For expiryTime I changed to be an abstract member to make it possible to implement it with a custom getter instead of forcing it to be implemented as a constructor parameter.

Both changes give us the possibility to use gson without worrying about having to create a copy of the objects and assigning values each time they are parsed.

Copy link
Contributor

@joselufo joselufo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All ok, thanks for fixing the issue.

@franmontiel franmontiel merged commit 9506a5e into master Oct 22, 2019
@franmontiel franmontiel deleted the feature/fix-vastra-gson-issues branch October 23, 2019 14:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants