@@ -265,8 +265,7 @@ public Version version() {
265
265
* Method for constructing a new instance that is configured
266
266
* with specified feature enabled.
267
267
*/
268
- public ObjectWriter with (SerializationFeature feature )
269
- {
268
+ public ObjectWriter with (SerializationFeature feature ) {
270
269
SerializationConfig newConfig = _config .with (feature );
271
270
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
272
271
}
@@ -275,9 +274,7 @@ public ObjectWriter with(SerializationFeature feature)
275
274
* Method for constructing a new instance that is configured
276
275
* with specified features enabled.
277
276
*/
278
- public ObjectWriter with (SerializationFeature first ,
279
- SerializationFeature ... other )
280
- {
277
+ public ObjectWriter with (SerializationFeature first , SerializationFeature ... other ) {
281
278
SerializationConfig newConfig = _config .with (first , other );
282
279
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
283
280
}
@@ -286,8 +283,7 @@ public ObjectWriter with(SerializationFeature first,
286
283
* Method for constructing a new instance that is configured
287
284
* with specified features enabled.
288
285
*/
289
- public ObjectWriter withFeatures (SerializationFeature ... features )
290
- {
286
+ public ObjectWriter withFeatures (SerializationFeature ... features ) {
291
287
SerializationConfig newConfig = _config .withFeatures (features );
292
288
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
293
289
}
@@ -296,8 +292,7 @@ public ObjectWriter withFeatures(SerializationFeature... features)
296
292
* Method for constructing a new instance that is configured
297
293
* with specified feature enabled.
298
294
*/
299
- public ObjectWriter without (SerializationFeature feature )
300
- {
295
+ public ObjectWriter without (SerializationFeature feature ) {
301
296
SerializationConfig newConfig = _config .without (feature );
302
297
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
303
298
}
@@ -306,9 +301,7 @@ public ObjectWriter without(SerializationFeature feature)
306
301
* Method for constructing a new instance that is configured
307
302
* with specified features enabled.
308
303
*/
309
- public ObjectWriter without (SerializationFeature first ,
310
- SerializationFeature ... other )
311
- {
304
+ public ObjectWriter without (SerializationFeature first , SerializationFeature ... other ) {
312
305
SerializationConfig newConfig = _config .without (first , other );
313
306
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
314
307
}
@@ -317,8 +310,7 @@ public ObjectWriter without(SerializationFeature first,
317
310
* Method for constructing a new instance that is configured
318
311
* with specified features enabled.
319
312
*/
320
- public ObjectWriter withoutFeatures (SerializationFeature ... features )
321
- {
313
+ public ObjectWriter withoutFeatures (SerializationFeature ... features ) {
322
314
SerializationConfig newConfig = _config .withoutFeatures (features );
323
315
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
324
316
}
@@ -331,8 +323,7 @@ public ObjectWriter withoutFeatures(SerializationFeature... features)
331
323
* Note that the method does NOT change state of this reader, but
332
324
* rather construct and returns a newly configured instance.
333
325
*/
334
- public ObjectWriter with (DateFormat df )
335
- {
326
+ public ObjectWriter with (DateFormat df ) {
336
327
SerializationConfig newConfig = _config .with (df );
337
328
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
338
329
}
@@ -341,29 +332,24 @@ public ObjectWriter with(DateFormat df)
341
332
* Method that will construct a new instance that will use the default
342
333
* pretty printer for serialization.
343
334
*/
344
- public ObjectWriter withDefaultPrettyPrinter ()
345
- {
335
+ public ObjectWriter withDefaultPrettyPrinter () {
346
336
return with (new DefaultPrettyPrinter ());
347
337
}
348
338
349
339
/**
350
340
* Method that will construct a new instance that uses specified
351
341
* provider for resolving filter instances by id.
352
342
*/
353
- public ObjectWriter with (FilterProvider filterProvider )
354
- {
355
- if (filterProvider == _config .getFilterProvider ()) { // no change?
356
- return this ;
357
- }
358
- return new ObjectWriter (this , _config .withFilters (filterProvider ));
343
+ public ObjectWriter with (FilterProvider filterProvider ) {
344
+ return (filterProvider == _config .getFilterProvider ()) ? this
345
+ : new ObjectWriter (this , _config .withFilters (filterProvider ));
359
346
}
360
347
361
348
/**
362
349
* Method that will construct a new instance that will use specified pretty
363
350
* printer (or, if null, will not do any pretty-printing)
364
351
*/
365
- public ObjectWriter with (PrettyPrinter pp )
366
- {
352
+ public ObjectWriter with (PrettyPrinter pp ) {
367
353
if (pp == _prettyPrinter ) {
368
354
return this ;
369
355
}
@@ -383,8 +369,7 @@ public ObjectWriter with(PrettyPrinter pp)
383
369
* Note that method does NOT change state of this reader, but
384
370
* rather construct and returns a newly configured instance.
385
371
*/
386
- public ObjectWriter withRootName (String rootName )
387
- {
372
+ public ObjectWriter withRootName (String rootName ) {
388
373
SerializationConfig newConfig = _config .withRootName (rootName );
389
374
return (newConfig == _config ) ? this : new ObjectWriter (this , newConfig );
390
375
}
@@ -397,8 +382,7 @@ public ObjectWriter withRootName(String rootName)
397
382
* rather construct and returns a newly configured instance.
398
383
*/
399
384
400
- public ObjectWriter withSchema (FormatSchema schema )
401
- {
385
+ public ObjectWriter withSchema (FormatSchema schema ) {
402
386
if (_schema == schema ) {
403
387
return this ;
404
388
}
@@ -415,8 +399,7 @@ public ObjectWriter withSchema(FormatSchema schema)
415
399
* Note that method does NOT change state of this reader, but
416
400
* rather construct and returns a newly configured instance.
417
401
*/
418
- public ObjectWriter withType (JavaType rootType )
419
- {
402
+ public ObjectWriter withType (JavaType rootType ) {
420
403
// 15-Mar-2013, tatu: Important! Indicate that static typing is needed:
421
404
rootType = rootType .withStaticTyping ();
422
405
JsonSerializer <Object > rootSer = _prefetchRootSerializer (_config , rootType );
@@ -486,10 +469,7 @@ public ObjectWriter with(CharacterEscapes escapes) {
486
469
* @since 2.3
487
470
*/
488
471
public ObjectWriter with (JsonFactory f ) {
489
- if (f == _generatorFactory ) {
490
- return this ;
491
- }
492
- return new ObjectWriter (this , f );
472
+ return (f == _generatorFactory ) ? this : new ObjectWriter (this , f );
493
473
}
494
474
495
475
/**
0 commit comments