Immutable Lombok annotated class with Jackson

后端 未结 9 2263
再見小時候
再見小時候 2020-12-25 13:02

What is the preferred way to create class that is

  • Immutable
  • Can be serialized/deserialized with Jackson
  • Human-readable and with low level of
9条回答
  •  没有蜡笔的小新
    2020-12-25 14:01

    The simplest way to configure immutable class for Jackson is to use lombok annotation: @Value and @Jacksonized:

        @Jacksonized
        @Builder
        @Value
        class Foo {
    
            
        }
    

提交回复
热议问题