@@ -3,11 +3,45 @@ package com.fasterxml.jackson.module.kotlin
3
3
import java.util.BitSet
4
4
import kotlin.math.pow
5
5
6
+ /* *
7
+ * @see KotlinModule.Builder
8
+ */
6
9
enum class KotlinFeature (val enabledByDefault : Boolean ) {
10
+ /* *
11
+ * This feature represents whether to deserialize `null` values for collection properties as empty collections.
12
+ */
7
13
NullToEmptyCollection (enabledByDefault = false ),
14
+
15
+ /* *
16
+ * This feature represents whether to deserialize `null` values for a map property to an empty map object.
17
+ */
8
18
NullToEmptyMap (enabledByDefault = false ),
19
+
20
+ /* *
21
+ * This feature represents whether to treat `null` values as absent when deserializing,
22
+ * thereby using the default value provided in Kotlin.
23
+ */
9
24
NullIsSameAsDefault (enabledByDefault = false ),
25
+
26
+ /* *
27
+ * By default, there's no special handling of singletons (pre-2.10 behavior).
28
+ * Each time a Singleton object is deserialized a new instance is created.
29
+ *
30
+ * When this feature is enabled, it will deserialize then canonicalize (was the default in 2.10).
31
+ * Deserializing a singleton overwrites the value of the single instance.
32
+ *
33
+ * See [jackson-module-kotlin#225]: keep Kotlin singletons as singletons.
34
+ * @see com.fasterxml.jackson.module.kotlin.SingletonSupport
35
+ */
10
36
SingletonSupport (enabledByDefault = false ),
37
+
38
+ /* *
39
+ * This feature represents whether to check deserialized collections.
40
+ *
41
+ * With this disabled, the default, collections which are typed to disallow null members (e.g. `List<String>`)
42
+ * may contain null values after deserialization.
43
+ * Enabling it protects against this but has significant performance impact.
44
+ */
11
45
StrictNullChecks (enabledByDefault = false );
12
46
13
47
internal val bitSet: BitSet = 2.0 .pow(ordinal).toInt().toBitSet()
0 commit comments