PrincipalImpl.java
1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* org.apache.jackrabbit.api.security.principal.JackrabbitPrincipal
*/
package com.adobe.aem.formsndocuments.bootstrap;
import java.io.Serializable;
import java.security.Principal;
import org.apache.jackrabbit.api.security.principal.JackrabbitPrincipal;
public class PrincipalImpl
implements JackrabbitPrincipal,
Serializable {
private static final long serialVersionUID = 384040549033267804L;
private final String name;
public PrincipalImpl(String name) {
if (name == null || name.length() == 0) {
throw new IllegalArgumentException("Principal name can neither be null nor empty String.");
}
this.name = name;
}
public String getName() {
return this.name;
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof JackrabbitPrincipal) {
return this.name.equals(((Principal)obj).getName());
}
return false;
}
public int hashCode() {
return this.name.hashCode();
}
public String toString() {
return this.getClass().getName() + ":" + this.name;
}
}