Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / mso / model / VfModuleMacro.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
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 package org.onap.vid.mso.model;
21
22 import com.fasterxml.jackson.annotation.JsonInclude;
23 import com.fasterxml.jackson.annotation.JsonProperty;
24
25 import java.util.Collections;
26 import java.util.List;
27 import java.util.Map;
28
29 import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
30
31 public class VfModuleMacro {
32
33     private final ModelInfo modelInfo;
34
35     @JsonInclude(NON_NULL)
36     private final String instanceName;
37
38     private final List<Map<String, String>> instanceParams;
39
40     @JsonInclude(NON_NULL)
41     private final String volumeGroupInstanceName;
42
43     public VfModuleMacro(@JsonProperty("modelInfo") ModelInfo modelInfo,
44                     @JsonProperty("instanceName") String instanceName,
45                     @JsonProperty("volumeGroupName") String volumeGroupInstanceName,
46                     @JsonProperty("instanceParams") List<Map<String, String>> instanceParams) {
47         this.modelInfo = modelInfo;
48         this.modelInfo.setModelType("vfModule");
49         this.instanceName = instanceName;
50         this.instanceParams = instanceParams;
51         this.volumeGroupInstanceName = volumeGroupInstanceName;
52     }
53
54     public ModelInfo getModelInfo() {
55         return modelInfo;
56     }
57
58     public String getInstanceName() {
59         return instanceName;
60     }
61
62     public String getVolumeGroupInstanceName() {
63         return volumeGroupInstanceName;
64     }
65
66     public List<Map<String, String>> getInstanceParams() {
67         return instanceParams == null ? Collections.emptyList() : instanceParams;
68     }
69 }
70
71