View Javadoc

1   /*
2    * Copyright (C) 2010 Atlassian
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package com.atlassian.jira.rest.client.domain;
18  
19  import javax.annotation.Nullable;
20  import java.net.URI;
21  import java.util.Collection;
22  
23  /**
24   * Complete information about single JIRA project.
25   * Many REST resources instead include just @{}BasicProject 
26   *
27   * @since v0.1
28   */
29  public class Project extends BasicProject {
30  	@Nullable
31  	private final String description;
32  	private final BasicUser lead;
33  	@Nullable
34  	private final URI uri;
35  	private final Collection<Version> versions;
36  	private final Collection<BasicComponent> components;
37  
38  	public Project(URI self, String key, String name, String description, BasicUser lead, URI uri, Collection<Version> versions,
39  				   Collection<BasicComponent> components) {
40  		super(self, key, name);
41  		this.description = description;
42  		this.lead = lead;
43  		this.uri = uri;
44  		this.versions = versions;
45  		this.components = components;
46  	}
47  
48  	/**
49  	 * @return description provided for this project or null if there is no description specific for this project.
50  	 */
51  	@Nullable
52  	public String getDescription() {
53  		return description;
54  	}
55  
56  	/**
57  	 *
58  	 * @return the person who leads this project
59  	 */
60  	public BasicUser getLead() {
61  		return lead;
62  	}
63  
64  	/**
65  	 * @return user-defined URI to a web page for this project, or <code>null</code> if not defined.
66  	 */
67  	@Nullable
68  	public URI getUri() {
69  		return uri;
70  	}
71  
72  	/**
73  	 * @return versions defined for this project
74  	 */
75  	public Iterable<Version> getVersions() {
76  		return versions;
77  	}
78  
79  	/**
80  	 *
81  	 * @return components defined for this project
82  	 */
83  	public Iterable<BasicComponent> getComponents() {
84  		return components;
85  	}
86  }