Bean automatically generates Get, set, toString to achieve full automation

1. First add the plugin to the androidstudio plugin, as shown below


2. Add jar package

//bean automatically generates get/set/toString
    provided 'org.projectlombok:lombok:1.16.16'
    annotationProcessor "org.projectlombok:lombok:1.16.16"
    provided 'org.glassfish:javax.annotation:10.0-b28'

3. You can add annotations directly to the bean, as follows:

package com.hongdaoai.hdzy.fzzl.model.login;


import com.google.gson.annotations.SerializedName;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * Created by xi
 * Class Note:
 * Login interface data
 */
@Getter
@Setter
@ToString
public class LoginResponseBean {
    @SerializedName("token")
    private String token;
    private String uid;
    private String pwdChgFlg;
    private int prescriptionFlg;
    private int approvalFlg;

}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324831159&siteId=291194637