1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package com.atlassian.jira.rest.client.domain;
17
18 import com.atlassian.jira.rest.client.IdentifiableEntity;
19 import com.google.common.base.Objects;
20
21 import java.net.URI;
22 import java.util.Collection;
23
24
25
26
27
28
29
30
31 @SuppressWarnings("JavadocReference")
32 public class ProjectRole extends BasicProjectRole implements IdentifiableEntity<Long> {
33
34 private final String description;
35 private final Collection<RoleActor> actors;
36 private final long id;
37
38 public ProjectRole(long id, URI self, String name, String description, Collection<RoleActor> actors) {
39 super(self, name);
40 this.id = id;
41 this.description = description;
42 this.actors = actors;
43 }
44
45
46
47
48 public String getDescription() {
49 return description;
50 }
51
52
53
54
55 public Iterable<RoleActor> getActors() {
56 return actors;
57 }
58
59
60
61
62 public Long getId() {
63 return id;
64 }
65
66 @Override
67 public boolean equals(Object o) {
68 if (o instanceof ProjectRole) {
69 final ProjectRole that = (ProjectRole) o;
70 return super.equals(o)
71 && Objects.equal(this.description, that.description)
72 && Objects.equal(this.actors, that.actors)
73 && Objects.equal(this.id, that.id);
74 }
75 return false;
76 }
77
78 @Override
79 public int hashCode() {
80 return Objects.hashCode(super.hashCode(), description, actors);
81 }
82
83 @Override
84 protected Objects.ToStringHelper getToStringHelper() {
85 return super.getToStringHelper()
86 .add("description", description)
87 .add("actors", actors);
88 }
89 }