Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AbstractRoleCommand |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport | |
3 | * (http://www.vbs.admin.ch) | |
4 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
5 | * All rights reserved. | |
6 | * | |
7 | * Licensed under the Open Permis License which accompanies this distribution, | |
8 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
9 | */ | |
10 | package org.openpermis.editor.policy.command; | |
11 | ||
12 | import org.openpermis.policy.bean.RoleHierarchyBean; | |
13 | ||
14 | ||
15 | /** | |
16 | * Keeps the information needed for the different role hierarchy commands. | |
17 | * | |
18 | * @since 0.3.0 | |
19 | */ | |
20 | public abstract class AbstractRoleCommand extends AbstractCommand { | |
21 | ||
22 | //---- State | |
23 | ||
24 | /** | |
25 | * @since 0.3.0 | |
26 | */ | |
27 | private final String roleName; | |
28 | ||
29 | /** | |
30 | * @since 0.3.0 | |
31 | */ | |
32 | private final RoleHierarchyBean roleHierarchyBean; | |
33 | ||
34 | //---- Constructors | |
35 | ||
36 | /** | |
37 | * Creates an {@link AbstractRoleCommand}. | |
38 | * @param name the command name. | |
39 | * @param roleName the role name. | |
40 | * @param roleHierarchyBean the hierarchy object. | |
41 | * @since 0.3.0 | |
42 | */ | |
43 | public AbstractRoleCommand ( | |
44 | String name, | |
45 | String roleName, | |
46 | RoleHierarchyBean roleHierarchyBean) { | |
47 | ||
48 | 0 | super(name); |
49 | 0 | this.roleName = roleName; |
50 | 0 | this.roleHierarchyBean = roleHierarchyBean; |
51 | 0 | } |
52 | ||
53 | //---- Methods | |
54 | ||
55 | /** | |
56 | * Returns the role name. | |
57 | * @return the role name. | |
58 | * @since 0.3.0 | |
59 | */ | |
60 | protected String getRoleName () { | |
61 | 0 | return this.roleName; |
62 | } | |
63 | ||
64 | /** | |
65 | * Returns the hierarchy object. | |
66 | * @return the hierarchy object. | |
67 | * @since 0.3.0 | |
68 | */ | |
69 | protected RoleHierarchyBean getRoleHierarchyBean () { | |
70 | 0 | return this.roleHierarchyBean; |
71 | } | |
72 | ||
73 | } |