序列和反序列設定,可以設定物件轉換模式

EX:

package com.bean.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;


@lombok.Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class Response {

  @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	String message;
  
  @JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	String code;

}

refer:  http://fasterxml.github.io/jackson-annotations/javadoc/2.6/com/fasterxml/jackson/annotation/JsonProperty.Access.html

    咪卡恰比 發表在 痞客邦 留言(0) 人氣()