Firebase ServerValue.TIMESTAMP in Java data models objects
<p>I'm new to Firebase, and I've been really enjoying it so far.  I'm running into a problem; I'm using the FirebaseListAdapter similar to the tutorial outline here: <a href="https://github.com/firebase/AndroidChat" rel="noreferrer">https://github.com/firebase/AndroidChat</a></p>

<p>To use the FirebaseListAdapter, I need to use data model objects (to get the automatic binding to work nicely). The problem is I also want to keep a timestamp value with that model object, and I want to get the timestamp from the Firebase server.  </p>

<p>What I have currently that is NOT working is a class DataModelObject (similar to com.firebase.androidchat.Chat in the demo example) with a constructor like :</p>

<pre><code>DataModelObject(String data1, String data2, Map enQTimeStamp)
</code></pre>

<p>which I then try to use like this:</p>

<pre><code>DataModelObject dmo = new DataModelObject ("foo", "bar", ServerValue.TIMESTAMP);
myFirebaseRef.push().setValue(dmo);
</code></pre>

<p>This causes a JsonMappingException when I try to run that code.  I found a code snippet here : </p>

<p><a href="https://www.firebase.com/blog/2015-02-11-firebase-unique-identifiers.html" rel="noreferrer">https://www.firebase.com/blog/2015-02-11-firebase-unique-identifiers.html</a></p>

<p>But it's worthwhile to note that on line 4 of the Android code example, that will cause a compile time error (as he is trying to put ServerValue.TIMESTAMP into a Map, and TIMESTAMP is a Map itself)</p>

<p>What is the right way to do this and maintain compatibility with FirebaseListAdapter?</p>