File tree Expand file tree Collapse file tree 3 files changed +17
-121
lines changed Expand file tree Collapse file tree 3 files changed +17
-121
lines changed Original file line number Diff line number Diff line change 1
1
package com .bean ;
2
2
3
3
import lombok .AllArgsConstructor ;
4
- import lombok .Builder ;
5
4
import lombok .Data ;
6
5
import lombok .NoArgsConstructor ;
7
6
8
- import java .util .Optional ;
9
-
10
7
/**
11
8
* @Author: EnjoyCoding
12
9
* @Date: 2020\3\6 0006 23:31
13
10
* @Description:
14
11
*/
15
-
12
+ @ Data
13
+ @ AllArgsConstructor
14
+ @ NoArgsConstructor
16
15
public class Address {
17
16
private String country ;
18
17
private String province ;
19
18
private String city ;
20
19
21
- public Address (String country , String province , String city ) {
22
- this .country = country ;
23
- this .province = province ;
24
- this .city = city ;
25
- }
26
-
27
- public Address () {
28
- }
29
-
30
- public String getCountry () {
31
- return country ;
32
- }
33
-
34
- public void setCountry (String country ) {
35
- this .country = country ;
36
- }
37
-
38
- public String getProvince () {
39
- return province ;
40
- }
41
-
42
- public void setProvince (String province ) {
43
- this .province = province ;
44
- }
45
-
46
- public void setCity (String city ) {
47
- this .city = city ;
48
- }
49
20
50
- // public Optional<String> getCity() {
51
- // return Optional.ofNullable(this.city);
52
- // }
53
21
54
- public String getCity () {
55
- return this .city ;
56
- }
57
22
}
Original file line number Diff line number Diff line change 1
1
package com .bean ;
2
2
3
+
4
+ import lombok .AllArgsConstructor ;
5
+ import lombok .Data ;
6
+ import lombok .NoArgsConstructor ;
7
+
8
+ @ Data
9
+ @ AllArgsConstructor
10
+ @ NoArgsConstructor
3
11
public class LocalUser {
4
12
private int id ;
5
13
private String userName ;
6
14
private String password ;
7
15
private int age ;
8
16
9
- public LocalUser (int id , String userName , String password , int age ) {
10
- this .id = id ;
11
- this .userName = userName ;
12
- this .password = password ;
13
- this .age = age ;
14
- }
15
-
16
- public int getId () {
17
- return id ;
18
- }
19
-
20
- public void setId (int id ) {
21
- this .id = id ;
22
- }
23
-
24
- public String getUserName () {
25
- return userName ;
26
- }
27
-
28
- public void setUserName (String userName ) {
29
- this .userName = userName ;
30
- }
31
-
32
- public String getPassword () {
33
- return password ;
34
- }
35
-
36
- public void setPassword (String password ) {
37
- this .password = password ;
38
- }
39
-
40
- public int getAge () {
41
- return age ;
42
- }
43
17
44
- public void setAge (int age ) {
45
- this .age = age ;
46
- }
47
18
}
Original file line number Diff line number Diff line change 1
1
package com .bean ;
2
2
3
- import java .util .Optional ;
3
+ import lombok .AllArgsConstructor ;
4
+ import lombok .Data ;
5
+ import lombok .NoArgsConstructor ;
4
6
5
7
/**
6
8
* Created by lenovo on 三月
7
9
*/
10
+ @ Data
11
+ @ AllArgsConstructor
12
+ @ NoArgsConstructor
8
13
public class User {
9
14
private String name ;
10
15
private String password ;
11
16
private String email ;
12
17
private Address address ;
13
18
14
- public Optional <Address > getAddress () {
15
- return Optional .ofNullable (address );
16
- }
17
19
18
-
19
- public User () {
20
- }
21
-
22
- public User (String name , String password , String email ) {
23
- this .name = name ;
24
- this .password = password ;
25
- this .email = email ;
26
- }
27
-
28
- public String getName () {
29
- return name ;
30
- }
31
-
32
- public void setName (String name ) {
33
- this .name = name ;
34
- }
35
-
36
- public String getPassword () {
37
- return password ;
38
- }
39
-
40
- public void setPassword (String password ) {
41
- this .password = password ;
42
- }
43
-
44
- public String getEmail () {
45
- return email ;
46
- }
47
-
48
- public void setEmail (String email ) {
49
- this .email = email ;
50
- }
51
-
52
- @ Override
53
- public String toString () {
54
- return "User{" +
55
- "name='" + name + '\'' +
56
- ", password='" + password + '\'' +
57
- ", email='" + email + '\'' +
58
- '}' ;
59
- }
60
20
}
You can’t perform that action at this time.
0 commit comments