1 package de.matthias_burbach.deputy.swing;
2
3 import de.matthias_burbach.deputy.core.rule.RetentionRule;
4 import de.matthias_burbach.deputy.core.rule.Rule;
5
6 /***
7 * @author Matthias Burbach
8 */
9 public class RetentionRuleTreeNode extends RuleTreeNode {
10 /***
11 * The rule to display.
12 */
13 private RetentionRule rule;
14
15 /***
16 * @param rule The rule to display.
17 */
18 public RetentionRuleTreeNode(
19 final RetentionRule rule) {
20 this.rule = rule;
21 }
22
23
24
25
26 /***
27 * {@inheritDoc}
28 */
29 public String toString() {
30 String result = "Retain " + rule.getArtifactId();
31 if (rule.getVersion() != null) {
32 result = result + "-" + rule.getVersion();
33 }
34 return result;
35 }
36
37
38
39
40 /***
41 * {@inheritDoc}
42 */
43 public boolean isLeaf() {
44 return true;
45 }
46
47
48
49
50 /***
51 * {@inheritDoc}
52 */
53 public Rule getRule() {
54 return rule;
55 }
56 }