技能的纯数据对象。 s07 为了便于新手阅读,继续使用普通 Java 类表达数据, 不使用 record 或复杂元数据模型。
| 7 | * 不使用 record 或复杂元数据模型。 |
| 8 | */ |
| 9 | public class Skill { |
| 10 | |
| 11 | private String name; |
| 12 | |
| 13 | private String description; |
| 14 | |
| 15 | private String body; |
| 16 | |
| 17 | public Skill(String name, String description, String body) { |
| 18 | this.name = name; |
| 19 | this.description = description; |
| 20 | this.body = body; |
| 21 | } |
| 22 | |
| 23 | public String getName() { |
| 24 | return name; |
| 25 | } |
| 26 | |
| 27 | public String getDescription() { |
| 28 | return description; |
| 29 | } |
| 30 | |
| 31 | public String getBody() { |
| 32 | return body; |
| 33 | } |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected