-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserInfo.java
More file actions
109 lines (86 loc) · 2.36 KB
/
userInfo.java
File metadata and controls
109 lines (86 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
package application;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.Period;
import java.util.ArrayList;
public class userInfo implements Serializable {
private String name;
private String address;
private String gender;
private ArrayList<String> hobbies;
private ArrayList<String> jobs;
private String relationshipStatus;
private String school;
private int numOfFriends;
public userInfo() {
this.hobbies = new ArrayList<String>();
numOfFriends = 0;
name = "";
gender = "";
this.jobs = new ArrayList<String>();
}
//getter and setter
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public ArrayList<String> getHobbies() {
return hobbies;
}
public void setHobbies(String[] hobbies) {
if(this.hobbies != null) {
this.hobbies.clear(); }
for (String content : hobbies) {
this.hobbies.add(content);
}
}
public ArrayList<String> getJobs() {
return jobs;
}
public void setJobs(String[] jobs) {
if(this.jobs != null) {
this.jobs.clear(); }
for (String content : jobs) {
this.jobs.add(content);
}
}
public void updateFriends(int i) {
this.numOfFriends = i;
}
public int getNumOfFriends() {
return numOfFriends;
}
public void setSchool(String school) {
this.school = school;
}
public String getSchool() {
return school;
}
public void setRelationshipStatus(String status) {
this.relationshipStatus = status;
}
public String getRelationshipStatus() {
return relationshipStatus;
}
public String printArraylist(ArrayList<String> arraytoPrint) {
String full_content = "";
for (String content: arraytoPrint) {
full_content += content + " ";
}
return full_content;
}
}