2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.test.mock;
19
20 import java.security.Principal;
21
22 /***
23 * <p>Mock implementation of <code>Principal</code>.</p>
24 */
25 public class MockPrincipal implements Principal {
26
27
28
29
30
31 /***
32 * <p>Construct a default Principal instance.</p>
33 */
34 public MockPrincipal() {
35 this(null);
36 }
37
38
39 /***
40 * <p>Construct a Principal with the specified name.</p>
41 *
42 * @param name Name for this Principal
43 */
44 public MockPrincipal(String name) {
45 this.name = name;
46 }
47
48
49
50
51
52 /***
53 * <p>The name for this Principal intance.</p>
54 */
55 private String name = null;
56
57
58
59
60
61 /***
62 * <p>Set the name for this Principal.</p>
63 *
64 * @param name The new name
65 */
66 public void setName(String name) {
67 this.name = name;
68 }
69
70
71
72
73
74 /*** {@inheritDoc} */
75 public String getName() {
76 return this.name;
77 }
78
79
80 }