Skip to content

Commit ae01585

Browse files
committed
Add polymorphic serialization section to Readme
1 parent 477a10e commit ae01585

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ data class Post(
102102

103103
```
104104

105+
<h4>Polymorphic serialization (sealed classes)</h4>
106+
107+
This sdk will handle polymorphic serialization automatically if you have a sealed class and its children marked as `Serializable`. It will include a `type` property that will be used to discriminate which child class is the serialized.
108+
109+
You can change this `type` property by using the `@FirebaseClassDiscrminator` annotation in the parent sealed class.
110+
105111
<h3><a href="https://kotlinlang.org/docs/reference/functions.html#default-arguments">Default arguments</a></h3>
106112

107113
To reduce boilerplate, default arguments are used in the places where the Firebase Android SDK employs the builder pattern:

0 commit comments

Comments
 (0)