如果我想使用fasterxml.jackson
创建如下的Json有效负载,我该怎么办?
{
"email":
}
这就是我的模型类的样子:
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import java.io.Serializable;
@JsonInclude(JsonInclude.Include.ALWAYS)
@JsonPropertyOrder({ "email" })
public class ApiRequest implements Serializable {
private static final long serialVersionUID = 1L;
@JsonProperty("email")
private String email;
public ApiRequest() {
}
/**
* @param email
*/
public ApiRequest(String email) {
this.email = email.equalsIgnoreCase("null") ? null : email;
}
@JsonProperty("email")
public String getEmail() {
return email;
}
@JsonProperty("email")
public void setEmail(String email) {
this.email = email.equalsIgnoreCase("null") ? null : email;
}
}
谢谢!