Last active
March 25, 2022 00:37
-
-
Save MichaelF25/6ba2aa8daddf6eee2a33 to your computer and use it in GitHub Desktop.
Immutable Data with builder and proper Jackson mapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package de.cpg.test; | |
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder; | |
import lombok.Builder; | |
import lombok.Value; | |
@Value | |
@Builder(builderClassName = "Builder") | |
@JsonDeserialize(builder = ImmutableData.Builder.class) | |
public class ImmutableData { | |
private final int someInt; | |
private final String someString; | |
@JsonPOJOBuilder(withPrefix = "") | |
public static final class Builder { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment