ProjectMemberImpl.java
1.83 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.cq.projects.api.ProjectMember
* com.adobe.cq.projects.api.ProjectMemberRole
*/
package com.adobe.cq.projects.impl;
import com.adobe.cq.projects.api.ProjectMember;
import com.adobe.cq.projects.api.ProjectMemberRole;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
public class ProjectMemberImpl
implements ProjectMember {
private final String id;
private final Set<ProjectMemberRole> roles;
public ProjectMemberImpl(String id, Set<ProjectMemberRole> roles) {
this.id = id;
this.roles = roles == null ? Collections.emptySet() : Collections.unmodifiableSet(new HashSet<ProjectMemberRole>(roles));
}
public /* varargs */ ProjectMemberImpl(String id, ProjectMemberRole ... roles) {
this.id = id;
this.roles = roles == null ? Collections.emptySet() : Collections.unmodifiableSet(new HashSet<ProjectMemberRole>(Arrays.asList(roles)));
}
public String getId() {
return this.id;
}
public Set<ProjectMemberRole> getRoles() {
return this.roles;
}
public String toString() {
return "ProjectMember{id='" + this.id + '\'' + '}';
}
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || this.getClass() != o.getClass()) {
return false;
}
ProjectMemberImpl that = (ProjectMemberImpl)o;
if (!this.id.equals(that.id)) {
return false;
}
if (this.roles != null ? !this.roles.equals(that.roles) : that.roles != null) {
return false;
}
return true;
}
public int hashCode() {
return this.id != null ? this.id.hashCode() : 0;
}
}