Sync Integ to Master
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / info / GroupDefinitionInfo.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
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.openecomp.sdc.be.info;
22
23 import org.openecomp.sdc.be.model.GroupDefinition;
24 import org.openecomp.sdc.be.model.GroupInstance;
25 import org.openecomp.sdc.be.model.GroupProperty;
26
27 import java.util.List;
28
29 public class GroupDefinitionInfo {
30     private String name;
31
32     // the id is unique per group instance on graph.
33     private String uniqueId;
34
35     // the id is unique per group instance on graph.
36     private String groupInstanceUniqueId;
37
38     // the group UUID should be changed when one of the artifacts/component
39     // instances has been changed.
40     private String groupUUID;
41
42     // version should be changed when there is a change to the group's metadata
43     // or to the groups members
44     // (not necessarily when the VF version is changed). This field cannot be
45     // updated by user
46     private String version;
47
48     private String invariantUUID;
49     private String customizationUUID;
50
51     Boolean isBase = null;
52
53     // artifacts - list of artifact uid. All artifacts in the group must already
54     // be uploaded to the VF
55     private List<ArtifactDefinitionInfo> artifacts;
56
57     private List<? extends GroupProperty> properties;
58
59     public GroupDefinitionInfo() {
60         super();
61     }
62
63     public GroupDefinitionInfo(GroupDefinition other) {
64         this.setName(other.getName());
65         this.setUniqueId(other.getUniqueId());
66         this.setVersion(other.getVersion());
67         this.setGroupUUID(other.getGroupUUID());
68         this.setInvariantUUID(other.getInvariantUUID());
69         this.setProperties(other.convertToGroupProperties());
70
71
72     }
73
74     public GroupDefinitionInfo(GroupInstance other) {
75         this.setName(other.getGroupName());
76         this.setUniqueId(other.getGroupUid());
77         this.setGroupInstanceUniqueId(other.getUniqueId());
78         this.setVersion(other.getVersion());
79         this.setGroupUUID(other.getGroupUUID());
80         this.setCustomizationUUID(other.getCustomizationUUID());
81         this.setInvariantUUID(other.getInvariantUUID());
82         this.setProperties(other.convertToGroupInstancesProperties());
83
84
85     }
86
87     public String getInvariantUUID() {
88         return invariantUUID;
89     }
90
91     public void setInvariantUUID(String invariantUUID) {
92         this.invariantUUID = invariantUUID;
93     }
94
95     public String getName() {
96         return name;
97     }
98
99     public void setName(String name) {
100         this.name = name;
101     }
102
103     public String getUniqueId() {
104         return uniqueId;
105     }
106
107     public void setUniqueId(String uniqueId) {
108         this.uniqueId = uniqueId;
109     }
110
111     public String getGroupUUID() {
112         return groupUUID;
113     }
114
115     public void setGroupUUID(String groupUUID) {
116         this.groupUUID = groupUUID;
117     }
118
119     public String getVersion() {
120         return version;
121     }
122
123     public void setVersion(String version) {
124         this.version = version;
125     }
126
127
128     public String getCustomizationUUID() {
129         return customizationUUID;
130     }
131
132     public void setCustomizationUUID(String customizationUUID) {
133         this.customizationUUID = customizationUUID;
134     }
135
136     public Boolean getIsBase() {
137         return isBase;
138     }
139
140     public void setIsBase(Boolean isBase) {
141         this.isBase = isBase;
142     }
143
144     public List<ArtifactDefinitionInfo> getArtifacts() {
145         return artifacts;
146     }
147
148     public void setArtifacts(List<ArtifactDefinitionInfo> artifacts) {
149         this.artifacts = artifacts;
150     }
151
152     public List<? extends GroupProperty> getProperties() {
153         return properties;
154     }
155
156     public void setProperties(List<? extends GroupProperty> properties) {
157         this.properties = properties;
158     }
159
160
161
162     public String getGroupInstanceUniqueId() {
163         return groupInstanceUniqueId;
164     }
165
166     public void setGroupInstanceUniqueId(String groupInstanceUniqueId) {
167         this.groupInstanceUniqueId = groupInstanceUniqueId;
168     }
169
170     @Override
171     public String toString() {
172         return "GroupDefinitionInfo [" + super.toString() + ", isBase=" + isBase + ", artifacts=" + artifacts + "]";
173     }
174
175
176 }