Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
RoleAssignmentRuleBeanOverview |
|
| 2.0;2 |
1 | /* | |
2 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
3 | * All rights reserved. | |
4 | * | |
5 | * Licensed under the Open Permis License which accompanies this distribution, | |
6 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
7 | */ | |
8 | package org.openpermis.editor.policy.adapter.overview; | |
9 | ||
10 | import org.openpermis.policy.bean.RoleAssignmentRuleBean; | |
11 | ||
12 | ||
13 | /** | |
14 | * Describes a {@link RoleAssignmentRuleBean} that has been adapted to a short overview string. | |
15 | * @since 0.4.0 | |
16 | */ | |
17 | 1 | public class RoleAssignmentRuleBeanOverview implements Overview { |
18 | ||
19 | ||
20 | //---- Static | |
21 | ||
22 | //---- State | |
23 | ||
24 | private RoleAssignmentRuleBean rule; | |
25 | ||
26 | //---- Constructors | |
27 | ||
28 | /** | |
29 | * Creates a role assignment rule bean overview adaptee. | |
30 | * @param rule the {@link RoleAssignmentRuleBean}. | |
31 | * @since 0.4.0 | |
32 | */ | |
33 | 2 | public RoleAssignmentRuleBeanOverview (RoleAssignmentRuleBean rule) { |
34 | 2 | if (rule == null) { |
35 | 1 | throw new IllegalArgumentException("Role assignment rule is null."); |
36 | } | |
37 | 1 | this.rule = rule; |
38 | 1 | } |
39 | ||
40 | //---- Methods | |
41 | ||
42 | //---- Overview | |
43 | ||
44 | /** | |
45 | * @since 0.4.0 | |
46 | */ | |
47 | public String get () { | |
48 | 1 | return "Role Assignment Rule " + this.rule.getSerialNumber().toString(); |
49 | } | |
50 | ||
51 | } |