1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package com.atlassian.jira.rest.client.api.domain;
18
19 import com.atlassian.jira.rest.client.api.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 public BasicUser getLead() {
68 return lead;
69 }
70
71
72
73
74 @Nullable
75 public URI getUri() {
76 return uri;
77 }
78
79
80
81
82 public Iterable<Version> getVersions() {
83 return versions;
84 }
85
86
87
88
89 public Iterable<BasicComponent> getComponents() {
90 return components;
91 }
92
93
94
95
96
97
98 public OptionalIterable<IssueType> getIssueTypes() {
99 return issueTypes;
100 }
101
102
103
104
105 public Iterable<BasicProjectRole> getProjectRoles() {
106 return projectRoles;
107 }
108
109
110
111
112 @Override
113 protected Objects.ToStringHelper getToStringHelper() {
114 return super.getToStringHelper().
115 add("description", description).
116 add("lead", lead).
117 add("uri", uri).
118 add("components", components).
119 add("issueTypes", issueTypes).
120 add("versions", versions);
121 }
122
123 @Override
124 public boolean equals(Object o) {
125 if (o instanceof Project) {
126 Project that = (Project) o;
127 return super.equals(that)
128 && Objects.equal(this.lead, that.lead)
129 && Objects.equal(this.uri, that.uri)
130 && Objects.equal(this.description, that.description)
131 && Objects.equal(this.components, that.components)
132 && Objects.equal(this.issueTypes, that.issueTypes)
133 && Objects.equal(this.versions, that.versions);
134 }
135 return false;
136 }
137
138 @Override
139 public int hashCode() {
140 return Objects.hashCode(super.hashCode(), description, lead, uri);
141 }
142 }