Mercurial > dive4elements > framework
comparison artifact-database/src/main/java/org/dive4elements/artifactdatabase/DefaultUser.java @ 473:d0ac790a6c89 dive4elements-move
Moved directories to org.dive4elements
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 10:57:18 +0200 |
parents | artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUser.java@4748949c4f19 |
children | 415df0fc4fa1 |
comparison
equal
deleted
inserted
replaced
472:783cc1b6b615 | 473:d0ac790a6c89 |
---|---|
1 /* | |
2 * Copyright (c) 2011 by Intevation GmbH | |
3 * | |
4 * This program is free software under the LGPL (>=v2.1) | |
5 * Read the file LGPL.txt coming with the software for details | |
6 * or visit http://www.gnu.org/licenses/ if it does not exist. | |
7 */ | |
8 package de.intevation.artifactdatabase; | |
9 | |
10 import org.w3c.dom.Document; | |
11 | |
12 import de.intevation.artifacts.User; | |
13 | |
14 | |
15 /** | |
16 * Trivial implementation of a user. Useful to be subclassed. | |
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
18 */ | |
19 public class DefaultUser | |
20 implements User | |
21 { | |
22 /** The identifier of the user.*/ | |
23 protected String identifier; | |
24 | |
25 /** The name of the user.*/ | |
26 protected String name; | |
27 | |
28 /** The account name of the user.*/ | |
29 protected String account; | |
30 | |
31 /** The role of the user.*/ | |
32 protected Document role; | |
33 | |
34 | |
35 /** | |
36 * The default constructor. | |
37 */ | |
38 public DefaultUser() { | |
39 } | |
40 | |
41 public DefaultUser(String identifier) { | |
42 this.identifier = identifier; | |
43 } | |
44 | |
45 /** | |
46 * A constructor that creates a new user. | |
47 * | |
48 * @param identifier The uuid of the user. | |
49 * @param name The name of the user. | |
50 * @param account The account name of the user. | |
51 * @param role The role of the user. | |
52 */ | |
53 public DefaultUser(String identifier, String name, String account, | |
54 Document role) { | |
55 this.identifier = identifier; | |
56 this.name = name; | |
57 this.role = role; | |
58 this.account = account; | |
59 } | |
60 | |
61 | |
62 /** | |
63 * Returns the identifier of this user. | |
64 * | |
65 * @return the identifier of this user. | |
66 */ | |
67 @Override | |
68 public String identifier() { | |
69 return identifier; | |
70 } | |
71 | |
72 | |
73 /** | |
74 * Returns the name of the user. | |
75 * | |
76 * @return the name of the user. | |
77 */ | |
78 @Override | |
79 public String getName() { | |
80 return name; | |
81 } | |
82 | |
83 | |
84 /** | |
85 * Set the name of the user. | |
86 * | |
87 * @param name The name for this user. | |
88 */ | |
89 @Override | |
90 public void setName(String name) { | |
91 this.name = name; | |
92 } | |
93 | |
94 | |
95 /** | |
96 * Set the identifier of the user. | |
97 * | |
98 * @param identifier The new identifier. | |
99 */ | |
100 @Override | |
101 public void setIdentifier(String identifier) { | |
102 this.identifier = identifier; | |
103 } | |
104 | |
105 | |
106 /** | |
107 * Set the role of the user. | |
108 * | |
109 * @param role The new role of the user. | |
110 */ | |
111 @Override | |
112 public void setRole(Document role) { | |
113 this.role = role; | |
114 } | |
115 | |
116 | |
117 /** | |
118 * Returns the role of the user. | |
119 * | |
120 * @return the role of the user. | |
121 */ | |
122 @Override | |
123 public Document getRole() { | |
124 return role; | |
125 } | |
126 | |
127 /** | |
128 * Returns the account of the user. | |
129 * | |
130 * @return the account name of the user. | |
131 */ | |
132 @Override | |
133 public String getAccount() { | |
134 return account; | |
135 } | |
136 } | |
137 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |