|
@@ -0,0 +1,56 @@
|
|
|
|
+package org.example.jdkSerializable;
|
|
|
|
+
|
|
|
|
+import java.io.Serializable;
|
|
|
|
+
|
|
|
|
+public class Account implements Serializable {
|
|
|
|
+ private static final long serialVersionUID = -547309094426427798L;
|
|
|
|
+ private Long id;
|
|
|
|
+ private String account;
|
|
|
|
+ // transient 作用是在序列化的时候忽略当前属性的值,可以屏蔽掉一些敏感或者没用的数据
|
|
|
|
+ // 可以从后面的验证结果输出的内容看到具体效果
|
|
|
|
+ transient private String password;
|
|
|
|
+ private String email;
|
|
|
|
+
|
|
|
|
+ public Long getId() {
|
|
|
|
+ return id;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setId(Long id) {
|
|
|
|
+ this.id = id;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getAccount() {
|
|
|
|
+ return account;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setAccount(String account) {
|
|
|
|
+ this.account = account;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getPassword() {
|
|
|
|
+ return password;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setPassword(String password) {
|
|
|
|
+ this.password = password;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getEmail() {
|
|
|
|
+ return email;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public void setEmail(String email) {
|
|
|
|
+ this.email = email;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //-----------省略get set 方法-----------
|
|
|
|
+ @Override
|
|
|
|
+ public String toString() {
|
|
|
|
+ return "Account{" +
|
|
|
|
+ "id=" + id +
|
|
|
|
+ ", account='" + account + '\'' +
|
|
|
|
+ ", password='" + password + '\'' +
|
|
|
|
+ ", email='" + email + '\'' +
|
|
|
|
+ '}';
|
|
|
|
+ }
|
|
|
|
+}
|