Personal financial management system springboot project development (four) pojo

In the pojo, place the various classes we defined.

Traditionally, we define attributes as private variables, which is safe. After writing all the properties, the getter and setter do not need us to write by hand, you can use IDEA's shortcut key Alt+Insert

Click Getter and Setter and select all attributes.

I refactored toString. This is because when debugging, the direct output class will output an address, and I want to see all the content in this class, so I override a toString so that System.out.println will output the class All attributes.

(The output of Java is actually the toString function called, which is similar to Python.)

ToString can also use Alt+Insert, as you can see in the screenshot above, just click toString().

package com.demo.pojo;

public class User {
    private Integer id;
    private String username;
    private String realname;
    private String phone;
    private String email;
    private String password;
    private String reputation;
    private Integer status;
    private String IDcard;
    private String paypwd;


    public String getIDcard() {
        return IDcard;
    }

    public void setIDcard(String IDcard) {
        this.IDcard = IDcard;
    }

    public String getPaypwd() {
        return paypwd;
    }

    public void setPaypwd(String paypwd) {
        this.paypwd = paypwd;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getRealname() {
        return realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getReputation() {
        return reputation;
    }

    public void setReputation(String reputation) {
        this.reputation = reputation;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", realname='" + realname + '\'' +
                ", phone='" + phone + '\'' +
                ", email='" + email + '\'' +
                ", password='" + password + '\'' +
                ", reputation='" + reputation + '\'' +
                ", status=" + status +
                ", IDcard='" + IDcard + '\'' +
                ", paypwd='" + paypwd + '\'' +
                '}';
    }

    public User() {
    }
}

 

Guess you like

Origin blog.csdn.net/Luowaterbi/article/details/107693117