Containerization feature of SO
[so.git] / bpmn / MSOCommonBPMN / src / main / java / org / onap / so / bpmn / servicedecomposition / bbobjects / InstanceGroup.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 import java.util.ArrayList;
25 import java.util.List;
26
27 import javax.persistence.Id;
28
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 import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup;
33
34 import com.fasterxml.jackson.annotation.JsonProperty;
35 import com.fasterxml.jackson.annotation.JsonRootName;
36
37 @JsonRootName("instance-group")
38 public class InstanceGroup  implements Serializable, ShallowCopy<InstanceGroup> {
39
40         private static final long serialVersionUID = -2330859693128099141L;
41         
42         @Id
43         @JsonProperty("id")
44         private String id;
45         @JsonProperty("description")
46         private String description;
47         @JsonProperty("resource-version")
48         private String resourceVersion;
49         @JsonProperty("instance-group-name")
50         private String instanceGroupName;
51         @JsonProperty("model-info-instance-group")
52         private ModelInfoInstanceGroup modelInfoInstanceGroup;
53         @JsonProperty("instance-group-function")
54         private String instanceGroupFunction;
55         
56         public String getId() {
57                 return id;
58         }
59         public void setId(String id) {
60                 this.id = id;
61         }
62         public String getDescription() {
63                 return description;
64         }
65         public void setDescription(String description) {
66                 this.description = description;
67         }
68         public String getResourceVersion() {
69                 return resourceVersion;
70         }
71         public void setResourceVersion(String resourceVersion) {
72                 this.resourceVersion = resourceVersion;
73         }
74         public String getInstanceGroupName() {
75                 return instanceGroupName;
76         }
77         public void setInstanceGroupName(String instanceGroupName) {
78                 this.instanceGroupName = instanceGroupName;
79         }
80         public ModelInfoInstanceGroup getModelInfoInstanceGroup() {
81                 return modelInfoInstanceGroup;
82         }
83         public void setModelInfoInstanceGroup(ModelInfoInstanceGroup modelInfoInstanceGroup) {
84                 this.modelInfoInstanceGroup = modelInfoInstanceGroup;
85         }
86         public String getInstanceGroupFunction() {
87                 return instanceGroupFunction;
88         }
89         public void setInstanceGroupFunction(String instanceGroupFunction) {
90                 this.instanceGroupFunction = instanceGroupFunction;
91         }
92         @Override
93         public boolean equals(final Object other) {
94                 if (!(other instanceof InstanceGroup)) {
95                         return false;
96                 }
97                 InstanceGroup castOther = (InstanceGroup) other;
98                 return new EqualsBuilder().append(id, castOther.id).isEquals();
99         }
100         @Override
101         public int hashCode() {
102                 return new HashCodeBuilder().append(id).toHashCode();
103         }
104 }