@@ -16,6 +16,8 @@ import kotlin.reflect.KClass
16
16
fun Class <* >.isKotlinClass (): Boolean = this .isAnnotationPresent(Metadata ::class .java)
17
17
18
18
/* *
19
+ * @constructor To avoid binary compatibility issues, the primary constructor is not published.
20
+ * Please use KotlinModule.Builder or extensions that use it.
19
21
* @property reflectionCacheSize Default: 512. Size, in items, of the caches used for mapping objects.
20
22
* @property nullToEmptyCollection Default: false. Whether to deserialize null values for collection properties as
21
23
* empty collections.
@@ -36,21 +38,7 @@ fun Class<*>.isKotlinClass(): Boolean = this.isAnnotationPresent(Metadata::class
36
38
* @property useJavaDurationConversion Default: false. Whether to use [java.time.Duration] as a bridge for [kotlin.time.Duration].
37
39
* This allows use Kotlin Duration type with [com.fasterxml.jackson.datatype.jsr310.JavaTimeModule].
38
40
*/
39
- class KotlinModule @Deprecated(
40
- level = DeprecationLevel .ERROR ,
41
- message = " Use KotlinModule.Builder instead of named constructor parameters. It will be HIDDEN at 2.18." ,
42
- replaceWith = ReplaceWith (
43
- """ KotlinModule.Builder()
44
- .withReflectionCacheSize(reflectionCacheSize)
45
- .configure(KotlinFeature.NullToEmptyCollection, nullToEmptyCollection)
46
- .configure(KotlinFeature.NullToEmptyMap, nullToEmptyMap)
47
- .configure(KotlinFeature.NullIsSameAsDefault, nullIsSameAsDefault)
48
- .configure(KotlinFeature.SingletonSupport, singletonSupport)
49
- .configure(KotlinFeature.StrictNullChecks, strictNullChecks)
50
- .build()""" ,
51
- " com.fasterxml.jackson.module.kotlin.KotlinFeature"
52
- )
53
- ) constructor(
41
+ class KotlinModule private constructor(
54
42
val reflectionCacheSize : Int = Builder .DEFAULT_CACHE_SIZE ,
55
43
val nullToEmptyCollection : Boolean = NullToEmptyCollection .enabledByDefault,
56
44
val nullToEmptyMap : Boolean = NullToEmptyMap .enabledByDefault,
@@ -83,7 +71,6 @@ class KotlinModule @Deprecated(
83
71
level = DeprecationLevel .HIDDEN ,
84
72
message = " If you have no choice but to initialize KotlinModule from reflection, use this constructor."
85
73
)
86
- @Suppress(" DEPRECATION_ERROR" )
87
74
constructor () : this ()
88
75
89
76
@Suppress(" DEPRECATION_ERROR" )
0 commit comments