Skip to content

Commit 7c90a8e

Browse files
committed
Add missing documentation based on KotlinModule constructor KDoc.
1 parent 879557c commit 7c90a8e

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

src/main/kotlin/com/fasterxml/jackson/module/kotlin/KotlinFeature.kt

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,45 @@ package com.fasterxml.jackson.module.kotlin
33
import java.util.BitSet
44
import kotlin.math.pow
55

6+
/**
7+
* @see KotlinModule.Builder
8+
*/
69
enum class KotlinFeature(val enabledByDefault: Boolean) {
10+
/**
11+
* This feature represents whether to deserialize `null` values for collection properties as empty collections.
12+
*/
713
NullToEmptyCollection(enabledByDefault = false),
14+
15+
/**
16+
* This feature represents whether to deserialize `null` values for a map property to an empty map object.
17+
*/
818
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+
*/
924
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+
*/
1036
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+
*/
1145
StrictNullChecks(enabledByDefault = false);
1246

1347
internal val bitSet: BitSet = 2.0.pow(ordinal).toInt().toBitSet()

0 commit comments

Comments
 (0)