Skip to content

Instantly share code, notes, and snippets.

@Value
@Builder
public class ApiProduct {
private Long id;
private String caption;
private String description;
}
@JsonProperty("date")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd")
private Calendar someDate;
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern= "yyyy-MM-dd")
private Calendar someDate;
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Calendar someDate;
import com.fasterxml.jackson.annotation.JsonFormat;
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum JacksonExampleEnum {
OPTION_1("0", "0"), OPTION_2("1", "1");
private String a;
private String b;
JacksonTestEnum(String a, String b) {
import com.fasterxml.jackson.annotation.JsonValue;
public enum JacksonExampleEnum {
OPTION_1("0", "0"), OPTION_2("1", "1");
private String a;
private String b;
JacksonTestEnum(String a, String b) {
this.a = a;
this.b = b;
import java.util.Calendar;
import lombok.Builder;
import lombok.Value;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
public enum JacksonExampleEnum {
OPTION_1("0", "0"), OPTION_2("1", "1");
private String a;
private String b;
JacksonTestEnum(String a, String b) {
this.a = a;
this.b = b;
}
import java.util.Calendar;
import lombok.Builder;
import lombok.Value;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import java.util.Calendar;
import lombok.Builder;
import lombok.Value;
import com.fasterxml.jackson.annotation.JsonIgnore;
@Builder
@Value