-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add class that handles ServerValue #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ServerValue
ServerValue.TIMESTAMP also exists on iOS: On Sun, Oct 2, 2016 at 11:19 AM Alex Saveau [email protected]
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a huge feature so hopefully it will be quick to implement on iOS. I left some thoughts below about null timestamps.
@Exclude | ||
public long getTimestamp() { | ||
return mTimestamp; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I check to see if mTimestamp
is 0 (null) here? If so, I would return the system time. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we'd want to return system time, that's not the same as unset. I prefer how it is now, it's the least opinionated and most likely to solve the original problem (serialization/deserialization of time stamps is annoying)
@SUPERCILEX I am a little confused by your intended usage. When I first saw this one I imagined it as a class you'd use in an instance variable, something like:
But your PR description implies that the major usage method is extending |
@samtstern I was extending just because it was more convenient for me. However, while trying to figure out how to make
Is it possible with Firebase to flatten an object into another object? (merge variables from one object into another) |
Nope. The Object graph must exactly match the JSON tree with the default But for timestamp it'll always be tricky, since the value-type that is On Sun, Oct 9, 2016 at 1:09 AM Alex Saveau [email protected] wrote:
|
So is it fine to have a nested timestamp like that? I really don't like it, but if you say there is no other way... |
@samstern: can you think of a way to annotate a class to write one type and On Sun, Oct 9, 2016 at 9:21 AM Alex Saveau [email protected] wrote:
|
@puf sorry for the delay here ... not that I know of. Upon further thought I don't think this feature belongs in FirebaseUI because it will have to be some sort of compromise 😐 |
Closing because of the tradeoffs. |
Example usage: