Package-level declarations

Types

Link copied to clipboard
@SerialInfo
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class DocumentId

Marks a String or DocumentReference property that receives the document id when a Firestore document is mapped to a class.

Link copied to clipboard
sealed class FirebaseFormat : SerialFormat

The multiplatform counterpart of the class mappers inside the Firebase Android SDK: Firestore's and Realtime Database's CustomClassMapper and Cloud Functions' Serializer.

Link copied to clipboard
@SerialInfo
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class IgnoreExtraProperties

Makes the mapper ignore properties of the data that the class does not have (they are logged otherwise).

Link copied to clipboard
class PlainValue(val value: Any?)

A value a FirebaseFormat has already converted (the result of FirebaseFormat.convertToPlainValue or FirebaseFormat.encodeToPlainValue), which the formats pass through as it is: the com.google.firebase layers convert what they are given in one place and hand the result on to platform code that converts whatever it receives, so this marks the values that need no second pass.

Link copied to clipboard
@SerialInfo
@Target(allowedTargets = [AnnotationTarget.PROPERTY])
annotation class ServerTimestamp

Marks a Firestore Timestamp or Instant property written as the server timestamp when it is null.

Link copied to clipboard
@SerialInfo
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class ThrowOnExtraProperties

Makes the mapper fail on properties of the data that the class does not have.

Functions

Link copied to clipboard
inline fun <T> FirebaseFormat.decodeFromPlainValue(value: Any?, documentReference: Any? = null): T

Decodes plain values to a T with the serializer of its type, where Any stands for any plain value.

Link copied to clipboard
inline fun <T> FirebaseFormat.encodeToPlainValue(value: T): Any?

Encodes value to plain values with the serializer of its type, where Any stands for any plain value.