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