|
23 | 23 | * Marks a field to be renamed when serialized. |
24 | 24 | * |
25 | 25 | * <h3>Kotlin Note</h3> |
26 | | - * When applying this annotation to a property of a Kotlin class, both the <code>@get</code> and |
27 | | - * <code>@set</code> use-site targets should be used. |
| 26 | + * When applying this annotation to a property of a Kotlin class, both the {@code @get} and |
| 27 | + * {@code @set} use-site targets should be used. |
28 | 28 | * <p> |
29 | 29 | * Here is an example of a class that can both be written into and read from Firestore whose |
30 | | - * <code>foo</code> property will be stored into and read from a field named "my_foo" in the |
| 30 | + * {@code foo} property will be stored into and read from a field named {@code my_foo} in the |
31 | 31 | * Firestore document: |
32 | 32 | * <pre> |
33 | | - * data class Pojo( |
34 | | - * @get:PropertyName("my_foo") |
35 | | - * @set:PropertyName("my_foo") |
36 | | - * var foo: String? = null |
37 | | - * ) { |
| 33 | + * data class Pojo(@get:PropertyName("my_foo") @set:PropertyName("my_foo") var foo: String? = null) { |
38 | 34 | * constructor() : this(null) // Used by Firestore to create new instances |
39 | 35 | * } |
40 | 36 | * </pre> |
41 | 37 | * <p> |
42 | 38 | * If the class only needs to be <em>written</em> into Firestore (and not read from Firestore) then |
43 | 39 | * the class can be simplified as follows: |
44 | 40 | * <pre> |
45 | | - * data class Pojo(@get:PropertyName("my_foo") val foo: String? = null) |
| 41 | + * {@literal data class Pojo(@get:PropertyName("my_foo") val foo: String? = null)} |
46 | 42 | * </pre> |
47 | | - * That is, <code>var</code> can be tightened to <code>val</code>, the secondary no-argument |
48 | | - * constructor can be omitted, and the <code>@set</code> use-site target can be omitted. |
| 43 | + * That is, {@code var} can be tightened to {@code val}, the secondary no-argument constructor can |
| 44 | + * be omitted, and the {@code @set} use-site target can be omitted. |
49 | 45 | */ |
50 | 46 | @Retention(RetentionPolicy.RUNTIME) |
51 | 47 | @Target({ElementType.METHOD, ElementType.FIELD}) |
|
0 commit comments