a815f6af1a8dd1a811c5c4b47c12a78c6e4f9bbb
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / Project.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.bpmn.servicedecomposition.bbobjects;
22
23 import java.io.Serializable;
24
25 import javax.persistence.Id;
26
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.annotation.JsonRootName;
29 import org.apache.commons.lang3.builder.EqualsBuilder;
30 import org.apache.commons.lang3.builder.HashCodeBuilder;
31 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
32
33 @JsonRootName("project")
34 public class Project implements Serializable, ShallowCopy<Project> {
35
36         private static final long serialVersionUID = 2449880559554533585L;
37         
38         @Id
39         @JsonProperty("project-name")
40         private String projectName;
41
42         public String getProjectName() {
43                 return projectName;
44         }
45
46         public void setProjectName(String projectName) {
47                 this.projectName = projectName;
48         }
49
50         @Override
51         public boolean equals(final Object other) {
52                 if (!(other instanceof Project)) {
53                         return false;
54                 }
55                 Project castOther = (Project) other;
56                 return new EqualsBuilder().append(projectName, castOther.projectName).isEquals();
57         }
58
59         @Override
60         public int hashCode() {
61                 return new HashCodeBuilder().append(projectName).toHashCode();
62         }
63 }