@@ -129,32 +129,33 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
129
129
KotlinFeature .values().filter { it.enabledByDefault }.forEach { or (it.bitSet) }
130
130
}
131
131
132
- fun withReflectionCacheSize (reflectionCacheSize : Int ) = apply {
132
+ fun withReflectionCacheSize (reflectionCacheSize : Int ): Builder = apply {
133
133
this .reflectionCacheSize = reflectionCacheSize
134
134
}
135
135
136
- fun enable (feature : KotlinFeature ) = apply {
136
+ fun enable (feature : KotlinFeature ): Builder = apply {
137
137
bitSet.or (feature.bitSet)
138
138
}
139
139
140
- fun disable (feature : KotlinFeature ) = apply {
140
+ fun disable (feature : KotlinFeature ): Builder = apply {
141
141
bitSet.andNot(feature.bitSet)
142
142
}
143
143
144
- fun configure (feature : KotlinFeature , enabled : Boolean ) = when {
145
- enabled -> enable(feature)
146
- else -> disable(feature)
147
- }
144
+ fun configure (feature : KotlinFeature , enabled : Boolean ): Builder =
145
+ when {
146
+ enabled -> enable(feature)
147
+ else -> disable(feature)
148
+ }
148
149
149
- fun isEnabled (feature : KotlinFeature ): Boolean = bitSet.intersects(feature.bitSet)
150
+ fun isEnabled (feature : KotlinFeature ): Boolean =
151
+ bitSet.intersects(feature.bitSet)
150
152
151
153
@Deprecated(
152
154
message = " Deprecated, use withReflectionCacheSize(reflectionCacheSize) instead." ,
153
155
replaceWith = ReplaceWith (" withReflectionCacheSize(reflectionCacheSize)" )
154
156
)
155
- fun reflectionCacheSize (reflectionCacheSize : Int ) = apply {
156
- this .reflectionCacheSize = reflectionCacheSize
157
- }
157
+ fun reflectionCacheSize (reflectionCacheSize : Int ): Builder =
158
+ withReflectionCacheSize(reflectionCacheSize)
158
159
159
160
@Deprecated(
160
161
message = " Deprecated, use isEnabled(NullToEmptyCollection) instead." ,
@@ -163,7 +164,8 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
163
164
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
164
165
)
165
166
)
166
- fun getNullToEmptyCollection () = isEnabled(NullToEmptyCollection )
167
+ fun getNullToEmptyCollection (): Boolean =
168
+ isEnabled(NullToEmptyCollection )
167
169
168
170
@Deprecated(
169
171
message = " Deprecated, use configure(NullToEmptyCollection, enabled) instead." ,
@@ -172,7 +174,7 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
172
174
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
173
175
)
174
176
)
175
- fun nullToEmptyCollection (nullToEmptyCollection : Boolean ) =
177
+ fun nullToEmptyCollection (nullToEmptyCollection : Boolean ): Builder =
176
178
configure(NullToEmptyCollection , nullToEmptyCollection)
177
179
178
180
@Deprecated(
@@ -182,7 +184,8 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
182
184
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
183
185
)
184
186
)
185
- fun getNullToEmptyMap () = isEnabled(NullToEmptyMap )
187
+ fun getNullToEmptyMap (): Boolean =
188
+ isEnabled(NullToEmptyMap )
186
189
187
190
@Deprecated(
188
191
message = " Deprecated, use configure(NullToEmptyMap, enabled) instead." ,
@@ -191,7 +194,8 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
191
194
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
192
195
)
193
196
)
194
- fun nullToEmptyMap (nullToEmptyMap : Boolean ) = configure(NullToEmptyMap , nullToEmptyMap)
197
+ fun nullToEmptyMap (nullToEmptyMap : Boolean ): Builder =
198
+ configure(NullToEmptyMap , nullToEmptyMap)
195
199
196
200
@Deprecated(
197
201
message = " Deprecated, use isEnabled(NullIsSameAsDefault) instead." ,
@@ -200,7 +204,8 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
200
204
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
201
205
)
202
206
)
203
- fun getNullIsSameAsDefault () = isEnabled(NullIsSameAsDefault )
207
+ fun getNullIsSameAsDefault (): Boolean =
208
+ isEnabled(NullIsSameAsDefault )
204
209
205
210
@Deprecated(
206
211
message = " Deprecated, use configure(NullIsSameAsDefault, enabled) instead." ,
@@ -209,7 +214,8 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
209
214
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
210
215
)
211
216
)
212
- fun nullIsSameAsDefault (nullIsSameAsDefault : Boolean ) = configure(NullIsSameAsDefault , nullIsSameAsDefault)
217
+ fun nullIsSameAsDefault (nullIsSameAsDefault : Boolean ): Builder =
218
+ configure(NullIsSameAsDefault , nullIsSameAsDefault)
213
219
214
220
@Deprecated(
215
221
message = " Deprecated, use isEnabled(SingletonSupport) instead." ,
@@ -218,10 +224,11 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
218
224
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
219
225
)
220
226
)
221
- fun getSingletonSupport () = when {
222
- isEnabled(KotlinFeature .SingletonSupport ) -> CANONICALIZE
223
- else -> DISABLED
224
- }
227
+ fun getSingletonSupport (): SingletonSupport =
228
+ when {
229
+ isEnabled(KotlinFeature .SingletonSupport ) -> CANONICALIZE
230
+ else -> DISABLED
231
+ }
225
232
226
233
@Deprecated(
227
234
message = " Deprecated, use configure(SingletonSupport, enabled) instead." ,
@@ -230,10 +237,11 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
230
237
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
231
238
)
232
239
)
233
- fun singletonSupport (singletonSupport : SingletonSupport ) = when (singletonSupport) {
234
- CANONICALIZE -> enable(KotlinFeature .SingletonSupport )
235
- else -> disable(KotlinFeature .SingletonSupport )
236
- }
240
+ fun singletonSupport (singletonSupport : SingletonSupport ): Builder =
241
+ when (singletonSupport) {
242
+ CANONICALIZE -> enable(KotlinFeature .SingletonSupport )
243
+ else -> disable(KotlinFeature .SingletonSupport )
244
+ }
237
245
238
246
@Deprecated(
239
247
message = " Deprecated, use isEnabled(StrictNullChecks) instead." ,
@@ -242,7 +250,8 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
242
250
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
243
251
)
244
252
)
245
- fun getStrictNullChecks () = isEnabled(StrictNullChecks )
253
+ fun getStrictNullChecks (): Boolean =
254
+ isEnabled(StrictNullChecks )
246
255
247
256
@Deprecated(
248
257
message = " Deprecated, use configure(StrictNullChecks, enabled) instead." ,
@@ -251,8 +260,10 @@ class KotlinModule @Deprecated(level = DeprecationLevel.WARNING, message = "Use
251
260
" com.fasterxml.jackson.module.kotlin.KotlinFeature"
252
261
)
253
262
)
254
- fun strictNullChecks (strictNullChecks : Boolean ) = configure(StrictNullChecks , strictNullChecks)
263
+ fun strictNullChecks (strictNullChecks : Boolean ): Builder =
264
+ configure(StrictNullChecks , strictNullChecks)
255
265
256
- fun build () = KotlinModule (this )
266
+ fun build (): KotlinModule =
267
+ KotlinModule (this )
257
268
}
258
269
}
0 commit comments