Class FirestoreValues
java.lang.Object
com.codename1.cloud.firebase.FirestoreValues
Converts between plain Java values and the Firestore REST value encoding.
Firestore wraps every value in a single-key map naming its type, such as
{"integerValue": "42"}. This class maps those to Java types and back:
| Firestore | Java |
|---|---|
nullValue |
null |
booleanValue |
Boolean |
integerValue |
Long (encoded from any integral type) |
doubleValue |
Double (encoded from Float or Double) |
stringValue |
String |
timestampValue |
Date |
bytesValue |
byte[] |
geoPointValue |
GeoPoint |
referenceValue |
DocumentReference |
arrayValue |
List |
mapValue |
Map<String, Object> |
Timestamps keep millisecond precision. Firestore stores microseconds, and the extra digits are dropped when decoding.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectDecodes a Firestore value map.decodeFields(Object fields) Decodes a document'sfieldsobject.Encodes a Java value.encodeFields(Map data) Encodes every entry of a map, producing a document'sfieldsobject.
-
Method Details
-
encode
-
encodeFields
-
decodeFields
-
decode
-