-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProfile.java
More file actions
82 lines (78 loc) · 1.56 KB
/
Copy pathProfile.java
File metadata and controls
82 lines (78 loc) · 1.56 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
/**
* Write a description of class Profile here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Profile
{
private String biography;
private String name;
private String school;
private String workplace;
private String location;
//Setters and Getters
public Profile()
{
biography="";
name="";
school="";
workplace="";
location="";
}
//Getters
public String getBio()
{
return biography;
}
public String getName()
{
return name;
}
public String getSchool()
{
return school;
}
public String getWorkplace()
{
return workplace;
}
//Setters
public void setBio(String b)
{
biography=b;
}
public void setName(String n)
{
name=n;
}
public void setSchool(String b)
{
biography=b;
}
public void setWorkplace(String w)
{
workplace=w;
}
public String toString(User u)
{
String returnString=("Username: "+u.getUsername());
if(name.equals("")==false)
{
returnString+="\n\nName: "+name;
}
if(biography.equals("")==false)
{
returnString+="\n\nBiography: "+biography;
}
if(school.equals("")==false)
{
returnString+="\n\nLives in "+location;
}
if(location.equals("")==false)
{
returnString+="\n\nLives in "+location;
}
return returnString;
}
}