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