c4b51ffaacacdd1346d66828d6b98a6652a0f784
[sdc.git] /
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 package org.openecomp.sdc.be.components.distribution.engine;
21
22 import java.util.List;
23 import org.openecomp.sdc.be.model.ComponentInstance;
24
25 public class JsonContainerResourceInstance {
26
27     private String resourceInstanceName;
28     private String resourceName;
29     private String resourceVersion;
30     private String resoucreType;
31     private String resourceUUID;
32     private String resourceInvariantUUID;
33     private String resourceCustomizationUUID;
34     private String category;
35     private String subcategory;
36     private List<ArtifactInfoImpl> artifacts;
37
38     public JsonContainerResourceInstance(ComponentInstance resourceInstance, String resourceType, List<ArtifactInfoImpl> artifacts) {
39         super();
40         this.resourceInstanceName = resourceInstance.getName();
41         this.resourceName = resourceInstance.getComponentName();
42         this.resourceVersion = resourceInstance.getComponentVersion();
43         this.resoucreType = resourceType;
44         this.resourceUUID = resourceInstance.getComponentUid();
45         this.artifacts = artifacts;
46         this.resourceCustomizationUUID = resourceInstance.getCustomizationUUID();
47     }
48
49     public JsonContainerResourceInstance(ComponentInstance resourceInstance, List<ArtifactInfoImpl> artifacts) {
50         super();
51         this.resourceInstanceName = resourceInstance.getName();
52         this.resourceName = resourceInstance.getComponentName();
53         this.resourceVersion = resourceInstance.getComponentVersion();
54         if (resourceInstance.getOriginType() != null) {
55             this.resoucreType = resourceInstance.getOriginType().getValue();
56         }
57         this.resourceUUID = resourceInstance.getComponentUid();
58         this.artifacts = artifacts;
59         this.resourceCustomizationUUID = resourceInstance.getCustomizationUUID();
60     }
61
62     public String getResourceInstanceName() {
63         return resourceInstanceName;
64     }
65
66     public void setResourceInstanceName(String resourceInstanceName) {
67         this.resourceInstanceName = resourceInstanceName;
68     }
69
70     public String getResourceName() {
71         return resourceName;
72     }
73
74     public void setResourceName(String resourceName) {
75         this.resourceName = resourceName;
76     }
77
78     public String getResourceVersion() {
79         return resourceVersion;
80     }
81
82     public void setResourceVersion(String resourceVersion) {
83         this.resourceVersion = resourceVersion;
84     }
85
86     public String getResoucreType() {
87         return resoucreType;
88     }
89
90     public void setResoucreType(String resoucreType) {
91         this.resoucreType = resoucreType;
92     }
93
94     public String getResourceUUID() {
95         return resourceUUID;
96     }
97
98     public void setResourceUUID(String resourceUUID) {
99         this.resourceUUID = resourceUUID;
100     }
101
102     public List<ArtifactInfoImpl> getArtifacts() {
103         return artifacts;
104     }
105
106     public void setArtifacts(List<ArtifactInfoImpl> artifacts) {
107         this.artifacts = artifacts;
108     }
109
110     public String getResourceInvariantUUID() {
111         return resourceInvariantUUID;
112     }
113
114     public void setResourceInvariantUUID(String resourceInvariantUUID) {
115         this.resourceInvariantUUID = resourceInvariantUUID;
116     }
117
118     public String getResourceCustomizationUUID() {
119         return resourceCustomizationUUID;
120     }
121
122     public void setResourceCustomizationUUID(String customizationUUID) {
123         this.resourceCustomizationUUID = customizationUUID;
124     }
125
126     public String getCategory() {
127         return category;
128     }
129
130     public void setCategory(String category) {
131         this.category = category;
132     }
133
134     public String getSubcategory() {
135         return subcategory;
136     }
137
138     public void setSubcategory(String subcategory) {
139         this.subcategory = subcategory;
140     }
141
142     @Override
143     public String toString() {
144         return "JsonContainerResourceInstance [resourceInstanceName=" + resourceInstanceName + ", resourceName=" + resourceName + ", resourceVersion="
145             + resourceVersion + ", resoucreType=" + resoucreType + ", resourceUUID=" + resourceUUID + ", resourceInvariantUUID="
146             + resourceInvariantUUID + ", resourceCustomizationUUID=" + resourceCustomizationUUID + ", category=" + category + ", subcategory="
147             + subcategory + ", artifacts=" + artifacts + "]";
148     }
149 }