[SO] Macro flow for PNF-Modify operation
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / Pnf.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2018 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 import javax.persistence.Id;
25 import org.apache.commons.lang3.builder.EqualsBuilder;
26 import org.apache.commons.lang3.builder.HashCodeBuilder;
27 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf;
28 import org.onap.so.db.catalog.beans.OrchestrationStatus;
29 import com.fasterxml.jackson.annotation.JsonProperty;
30 import com.fasterxml.jackson.annotation.JsonRootName;
31 import org.onap.so.bpmn.servicedecomposition.ShallowCopy;
32
33 @JsonRootName("pnf")
34 public class Pnf implements Serializable, ShallowCopy<Pnf> {
35
36     private static final long serialVersionUID = -2544848120774529501L;
37
38     @Id
39     @JsonProperty("pnf-id")
40     private String pnfId;
41
42     @JsonProperty("pnf-name")
43     private String pnfName;
44
45     @JsonProperty("nf-role")
46     private String role;
47
48     @JsonProperty("orchestration-status")
49     private OrchestrationStatus orchestrationStatus;
50
51     @JsonProperty("cloud-region")
52     private CloudRegion cloudRegion;
53
54     @JsonProperty("in-maint")
55     private Boolean inMaint;
56
57     @JsonProperty("model-info-pnf")
58     private ModelInfoPnf modelInfoPnf;
59
60     public String getPnfId() {
61         return pnfId;
62     }
63
64     public void setPnfId(String pnfId) {
65         this.pnfId = pnfId;
66     }
67
68     public String getPnfName() {
69         return pnfName;
70     }
71
72     public void setPnfName(String pnfName) {
73         this.pnfName = pnfName;
74     }
75
76     /**
77      * Distinguishes Primary or Secondary
78      */
79     public String getRole() {
80         return role;
81     }
82
83     /**
84      * Distinguishes Primary or Secondary
85      */
86     public void setRole(String role) {
87         this.role = role;
88     }
89
90     public OrchestrationStatus getOrchestrationStatus() {
91         return orchestrationStatus;
92     }
93
94     public void setOrchestrationStatus(OrchestrationStatus orchestrationStatus) {
95         this.orchestrationStatus = orchestrationStatus;
96     }
97
98     public Boolean isInMaint() {
99         return inMaint;
100     }
101
102     public void setInMaint(Boolean inMaint) {
103         this.inMaint = inMaint;
104     }
105
106     public CloudRegion getCloudRegion() {
107         return cloudRegion;
108     }
109
110     public void setCloudRegion(CloudRegion cloudRegion) {
111         this.cloudRegion = cloudRegion;
112     }
113
114     public ModelInfoPnf getModelInfoPnf() {
115         return modelInfoPnf;
116     }
117
118     public void setModelInfoPnf(ModelInfoPnf modelInfoPnf) {
119         this.modelInfoPnf = modelInfoPnf;
120     }
121
122     @Override
123     public boolean equals(final Object other) {
124         if (!(other instanceof Pnf)) {
125             return false;
126         }
127         Pnf castOther = (Pnf) other;
128         return new EqualsBuilder().append(pnfId, castOther.pnfId).isEquals();
129     }
130
131     @Override
132     public int hashCode() {
133         return new HashCodeBuilder().append(pnfId).toHashCode();
134     }
135 }