View Javadoc
1   /*
2    * This file is part of dependency-check-core.
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   * Copyright (c) 2022 Jeremy Long. All Rights Reserved.
17   */
18  package org.owasp.dependencycheck.xml.pom;
19  
20  import java.io.Serializable;
21  import java.util.Objects;
22  import javax.annotation.concurrent.ThreadSafe;
23  
24  /**
25   * Represents the developer node within the pom.xml.
26   *
27   * @author Jeremy Long
28   */
29  @ThreadSafe
30  public class Developer implements Serializable {
31  
32      /**
33       * Generated UUID.
34       */
35      private static final long serialVersionUID = 7016253914202775026L;
36  
37      /**
38       * The id of the developer.
39       */
40      private String id;
41      /**
42       * The developers name.
43       */
44      private String name;
45      /**
46       * The developers email.
47       */
48      private String email;
49      /**
50       * The developer's organization.
51       */
52      private String organization;
53      /**
54       * The developer's organization URL.
55       */
56      private String organizationUrl;
57  
58      /**
59       * Get the value of id.
60       *
61       * @return the value of id
62       */
63      public String getId() {
64          return id;
65      }
66  
67      /**
68       * Set the value of id.
69       *
70       * @param id new value of id
71       */
72      public void setId(String id) {
73          this.id = id;
74      }
75  
76      /**
77       * Get the value of name.
78       *
79       * @return the value of name
80       */
81      public String getName() {
82          return name;
83      }
84  
85      /**
86       * Set the value of name.
87       *
88       * @param name new value of name
89       */
90      public void setName(String name) {
91          this.name = name;
92      }
93  
94      /**
95       * Get the value of email.
96       *
97       * @return the value of email
98       */
99      public String getEmail() {
100         return email;
101     }
102 
103     /**
104      * Set the value of email.
105      *
106      * @param email new value of email
107      */
108     public void setEmail(String email) {
109         this.email = email;
110     }
111 
112     /**
113      * Get the value of organization.
114      *
115      * @return the value of organization
116      */
117     public String getOrganization() {
118         return organization;
119     }
120 
121     /**
122      * Set the value of organization.
123      *
124      * @param organization new value of organization
125      */
126     public void setOrganization(String organization) {
127         this.organization = organization;
128     }
129 
130     /**
131      * Get the value of organizationUrl.
132      *
133      * @return the value of organizationUrl
134      */
135     public String getOrganizationUrl() {
136         return organizationUrl;
137     }
138 
139     /**
140      * Set the value of organizationUrl.
141      *
142      * @param organizationUrl new value of organizationUrl
143      */
144     public void setOrganizationUrl(String organizationUrl) {
145         this.organizationUrl = organizationUrl;
146     }
147 
148     @Override
149     public int hashCode() {
150         int hash = 3;
151         hash = 61 * hash + Objects.hashCode(this.id);
152         hash = 61 * hash + Objects.hashCode(this.name);
153         hash = 61 * hash + Objects.hashCode(this.email);
154         hash = 61 * hash + Objects.hashCode(this.organization);
155         hash = 61 * hash + Objects.hashCode(this.organizationUrl);
156         return hash;
157     }
158 
159     @Override
160     public boolean equals(Object obj) {
161         if (this == obj) {
162             return true;
163         }
164         if (obj == null) {
165             return false;
166         }
167         if (getClass() != obj.getClass()) {
168             return false;
169         }
170         final Developer other = (Developer) obj;
171         if (!Objects.equals(this.id, other.id)) {
172             return false;
173         }
174         if (!Objects.equals(this.name, other.name)) {
175             return false;
176         }
177         if (!Objects.equals(this.email, other.email)) {
178             return false;
179         }
180         if (!Objects.equals(this.organization, other.organization)) {
181             return false;
182         }
183         //noinspection RedundantIfStatement
184         if (!Objects.equals(this.organizationUrl, other.organizationUrl)) {
185             return false;
186         }
187         return true;
188     }
189 
190     @Override
191     public String toString() {
192         return "Developer{"
193                 + "id=" + id
194                 + ", name=" + name
195                 + ", email=" + email
196                 + ", organization=" + organization
197                 + ", organizationUrl=" + organizationUrl + '}';
198     }
199 
200 }