|
5 | 5 | public class Method implements Member { |
6 | 6 | private String name; |
7 | 7 | private String description; |
8 | | - private boolean isStatic; |
| 8 | + private boolean isStatic = false; |
| 9 | + private boolean isPublic = true; |
9 | 10 | private String returnType; |
10 | 11 | private ArrayList<Parameter> parameters; |
11 | | - |
| 12 | + |
12 | 13 | public Method(String name){ |
13 | 14 | this.name = name; |
14 | 15 | this.parameters = new ArrayList<>(); |
15 | 16 | } |
16 | | - |
| 17 | + |
| 18 | + public boolean isPublic(){ |
| 19 | + return isPublic; |
| 20 | + } |
| 21 | + |
| 22 | + public void setPublic(boolean isPublic){ |
| 23 | + this.isPublic = isPublic; |
| 24 | + } |
| 25 | + |
17 | 26 | public void setStatic(boolean isStatic){ |
18 | 27 | this.isStatic = isStatic; |
19 | 28 | } |
20 | | - |
| 29 | + |
21 | 30 | public boolean isStatic(){ |
22 | 31 | return isStatic; |
23 | 32 | } |
24 | | - |
| 33 | + |
25 | 34 | public void setReturnType(String returnType){ |
26 | 35 | this.returnType = returnType; |
27 | 36 | } |
28 | | - |
| 37 | + |
29 | 38 | public String getReturnType(){ |
30 | 39 | return returnType; |
31 | 40 | } |
32 | | - |
| 41 | + |
33 | 42 | public String getName(){ |
34 | 43 | return name; |
35 | 44 | } |
36 | | - |
| 45 | + |
37 | 46 | public void setDescription(String description){ |
38 | 47 | this.description = description; |
39 | 48 | } |
40 | | - |
| 49 | + |
41 | 50 | public String getDescription(){ |
42 | 51 | return description; |
43 | 52 | } |
44 | | - |
| 53 | + |
45 | 54 | public void addParameter(Parameter parameter){ |
46 | 55 | this.parameters.add(parameter); |
47 | 56 | } |
48 | | - |
| 57 | + |
49 | 58 | public ArrayList<Parameter> getParameters(){ |
50 | 59 | return parameters; |
51 | 60 | } |
52 | | - |
| 61 | + |
53 | 62 | public String toString(){ |
54 | 63 | return name; |
55 | 64 | } |
56 | | - |
| 65 | + |
57 | 66 | public JSONObject toJson(){ |
58 | 67 | JSONObject json = new JSONObject(); |
59 | 68 | json.set("name", name); |
|
0 commit comments