2 * Sonar, open source software quality management tool.
3 * Copyright (C) 2009 SonarSource SA
4 * mailto:contact AT sonarsource DOT com
6 * Sonar is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * Sonar is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with Sonar; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
20 package org.sonar.updatecenter.common;
22 import org.apache.commons.lang.StringUtils;
24 public final class Plugin extends Artifact {
27 private String description;
28 private String homepageUrl;
29 private String license;
30 private String organization;
31 private String organizationUrl;
32 private String termsConditionsUrl;
33 private String category;
34 private String issueTrackerUrl;
36 public Plugin(String key) {
40 public String getName() {
44 public Plugin setName(String name) {
49 public String getDescription() {
53 public Plugin setDescription(String description) {
54 this.description = description;
58 public String getHomepageUrl() {
62 public Plugin setHomepageUrl(String s) {
67 public String getLicense() {
71 public Plugin setLicense(String license) {
72 this.license = license;
76 public String getOrganization() {
80 public Plugin setOrganization(String organization) {
81 this.organization = organization;
85 public String getOrganizationUrl() {
86 return organizationUrl;
89 public Plugin setOrganizationUrl(String url) {
90 this.organizationUrl = url;
94 public String getCategory() {
98 public Plugin setCategory(String category) {
99 this.category = category;
103 public String getTermsConditionsUrl() {
104 return termsConditionsUrl;
107 public Plugin setTermsConditionsUrl(String url) {
108 this.termsConditionsUrl = url;
112 public String getIssueTrackerUrl() {
113 return issueTrackerUrl;
116 public Plugin setIssueTrackerUrl(String url) {
117 this.issueTrackerUrl = url;
121 public Plugin merge(PluginManifest manifest) {
122 if (StringUtils.equals(key, manifest.getKey())) {
123 name = manifest.getName();
124 description = manifest.getDescription();
125 organization = manifest.getOrganization();
126 organizationUrl = manifest.getOrganizationUrl();
127 issueTrackerUrl = manifest.getIssueTrackerUrl();
128 license = manifest.getLicense();
129 homepageUrl = manifest.getHomepage();
130 termsConditionsUrl = manifest.getTermsConditionsUrl();