1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.domain;
18
19 import com.atlassian.jira.rest.client.OptionalIterable;
20 import com.google.common.base.Objects;
21
22 import javax.annotation.Nullable;
23 import java.net.URI;
24 import java.util.Collection;
25
26
27
28
29
30
31
32 public class Project extends BasicProject {
33 @Nullable
34 private final String description;
35 private final BasicUser lead;
36 @Nullable
37 private final URI uri;
38 private final Collection<Version> versions;
39 private final Collection<BasicComponent> components;
40 private final OptionalIterable<IssueType> issueTypes;
41 private final Collection<BasicProjectRole> projectRoles;
42
43 public Project(URI self, String key, String name, String description, BasicUser lead, URI uri,
44 Collection<Version> versions,Collection<BasicComponent> components,
45 OptionalIterable<IssueType> issueTypes, Collection<BasicProjectRole> projectRoles) {
46 super(self, key, name);
47 this.description = description;
48 this.lead = lead;
49 this.uri = uri;
50 this.versions = versions;
51 this.components = components;
52 this.issueTypes = issueTypes;
53 this.projectRoles = projectRoles;
54 }
55
56
57
58
59 @Nullable
60 public String getDescription() {
61 return description;
62 }
63
64
65
66
67
68 public BasicUser getLead() {
69 return lead;
70 }
71
72
73
74
75 @Nullable
76 public URI getUri() {
77 return uri;
78 }
79
80
81
82
83 public Iterable<Version> getVersions() {
84 return versions;
85 }
86
87
88
89
90
91 public Iterable<BasicComponent> getComponents() {
92 return components;
93 }
94
95
96
97
98
99
100 public OptionalIterable<IssueType> getIssueTypes() {
101 return issueTypes;
102 }
103
104
105
106
107 public Iterable<BasicProjectRole> getProjectRoles() {
108 return projectRoles;
109 }
110
111
112
113
114 @Override
115 protected Objects.ToStringHelper getToStringHelper() {
116 return super.getToStringHelper().
117 add("description", description).
118 add("lead", lead).
119 add("uri", uri).
120 add("components", components).
121 add("issueTypes", issueTypes).
122 add("versions", versions);
123 }
124
125 @Override
126 public boolean equals(Object o) {
127 if (o instanceof Project) {
128 Project that = (Project) o;
129 return super.equals(that)
130 && Objects.equal(this.lead, that.lead)
131 && Objects.equal(this.uri, that.uri)
132 && Objects.equal(this.description, that.description)
133 && Objects.equal(this.components, that.components)
134 && Objects.equal(this.issueTypes, that.issueTypes)
135 && Objects.equal(this.versions, that.versions);
136 }
137 return false;
138 }
139
140 @Override
141 public int hashCode() {
142 return Objects.hashCode(super.hashCode(), description, lead, uri);
143 }
144 }