1 package org.onap.vid.model;
3 import org.onap.vid.asdc.beans.tosca.Input;
4 import org.onap.vid.asdc.parser.ToscaParserImpl2;
14 /** The invariant uuid. */
15 private String invariantUuid;
17 /** The customization uuid. */
18 private String customizationUuid;
20 /** The description. */
21 private String description;
27 private String version;
29 /** The model customization name. */
30 private String modelCustomizationName;
32 /** The group properties. */
33 private GroupProperties properties;
35 private Map<String, Input> inputs;
39 * Gets the model customization name.
41 * @return the model customization name
43 public String getModelCustomizationName() {
44 return modelCustomizationName;
51 public String getUuid() {
56 * Gets the invariant uuid.
58 * @return the invariant uuid
60 public String getInvariantUuid() {
64 * Gets the customization uuid.
66 * @return the invariant uuid
68 public String getCustomizationUuid() {
69 return customizationUuid;
72 * Gets the description.
74 * @return the description
76 public String getDescription() {
84 public String getName() {
93 public String getVersion() {
98 * Gets the properties.
100 * @return the properties
102 public GroupProperties getProperties() {
108 * @param uuid the new uuid
110 public void setUuid(String uuid) {
115 * Sets the invariant uuid.
117 * @param invariantUuid the new invariant uuid
119 public void setInvariantUuid(String invariantUuid) {
120 this.invariantUuid = invariantUuid;
123 * Sets the customization uuid.
125 * @param customizationUuid the new customization uuid
127 public void setCustomizationUuid(String customizationUuid) {
128 this.customizationUuid = customizationUuid;
131 * Sets the description.
133 * @param description the new description
135 public void setDescription(String description) {
136 this.description = description;
142 * @param name the new name
144 public void setName(String name) {
151 * @param version the new version
153 public void setVersion(String version) {
154 this.version = version;
157 public Map<String, Input> getInputs() {
161 public void setInputs(Map<String, Input> inputs) {
162 this.inputs = inputs;
166 * Sets the model customization name.
168 * @param modelCustomizationName the new model customization name
170 public void setModelCustomizationName(String modelCustomizationName) {
171 this.modelCustomizationName = modelCustomizationName;
174 * Sets the group properties.
176 * @param properties the new model customization name
178 public void setProperties(GroupProperties properties) {
179 this.properties = properties;
184 protected static GroupProperties extractPropertiesForGroup(org.onap.vid.asdc.beans.tosca.Group group){
185 String [] propertyKeys = {ToscaParserImpl2.Constants.MIN_VF_MODULE_INSTANCES, ToscaParserImpl2.Constants.MAX_VF_MODULE_INSTANCES, ToscaParserImpl2.Constants.INITIAL_COUNT};
186 GroupProperties groupProperties = new GroupProperties();
188 for(String propertyKey : propertyKeys){
189 Object val = group.getProperties().get(propertyKey);
190 if (val != null && val instanceof Integer) {
191 setInGroupProperties(groupProperties, propertyKey, (Integer) val);
194 return groupProperties;
197 private static void setInGroupProperties(GroupProperties groupProperties, String propertyKey, Integer propertyValue){
198 switch (propertyKey) {
199 case ToscaParserImpl2.Constants.MIN_VF_MODULE_INSTANCES:
200 groupProperties.setMinCountInstances(propertyValue);
202 case ToscaParserImpl2.Constants.MAX_VF_MODULE_INSTANCES:
203 groupProperties.setMaxCountInstances(propertyValue);
205 case ToscaParserImpl2.Constants.INITIAL_COUNT:
206 groupProperties.setInitialCount(propertyValue);