Repository navigation
Expand file tree
/
Copy pathChampion.java
More file actions
71 lines (62 loc) · 1.89 KB
/
Copy pathChampion.java
File metadata and controls
71 lines (62 loc) · 1.89 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
public class Champion {
private int id;
private String name;
private String role;
private String difficulty;
private String description;
public Champion (int id, String name, String role, String difficulty, String description){
this.id = id;
this.name = name;
this.role = role;
this.difficulty = difficulty;
this.description = description;
}
public int getId(){ return id; }
public String getName(){ return name; }
public String getRole(){ return role; }
public String getDifficulty(){ return difficulty; }
public String getDescription() { return description; }
public boolean setId(int id) {
if(id > 0){
this.id = id;
return true;
} else
return false;
}
public boolean setName(String name){
if(!name.isEmpty()){
this.name = name;
return true;
}else
return false;
}
public boolean setRole(String role){
if(!role.isEmpty()){
this.role = role;
return true;
}else
return false;
}
public boolean setDifficulty(String difficulty) {
if(!difficulty.isEmpty()){
this.difficulty = difficulty;
return true;
}else
return false;
}
public boolean setDescription(String description){
if(!difficulty.isEmpty()){
this.description = description;
return true;
}else
return false;
}
public String showMessage(){
return
"Id: "+id+"\n"+
"Name: "+name+"\n"+
"Role: "+role+"\n"+
"Difficulty: "+difficulty+"\n"+
"Description: "+description+"\n"+"\n";
}
}