Sync Integ to Master
[sdc.git] / catalog-be / src / main / java / org / openecomp / sdc / be / components / distribution / engine / JsonContainerResourceInstance.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.components.distribution.engine;
22
23 import org.openecomp.sdc.be.model.ComponentInstance;
24
25 import java.util.List;
26
27 public class JsonContainerResourceInstance {
28     private String resourceInstanceName;
29     private String resourceName;
30     private String resourceVersion;
31     private String resourceType;
32     private String resourceUUID;
33     private String resourceInvariantUUID;
34     private String resourceCustomizationUUID;
35     private String category;
36     private String subcategory;
37     private List<ArtifactInfoImpl> artifacts;
38
39     public JsonContainerResourceInstance(ComponentInstance resourceInstance, String resourceType, List<ArtifactInfoImpl> artifacts) {
40         super();
41         this.resourceInstanceName = resourceInstance.getName();
42         this.resourceName = resourceInstance.getComponentName();
43         this.resourceVersion = resourceInstance.getComponentVersion();
44         this.resourceType = resourceType;
45         this.resourceUUID = resourceInstance.getComponentUid();
46         this.artifacts = artifacts;
47         this.resourceCustomizationUUID = resourceInstance.getCustomizationUUID();
48     }
49     
50     public JsonContainerResourceInstance(ComponentInstance resourceInstance, List<ArtifactInfoImpl> artifacts) {
51         super();
52         this.resourceInstanceName = resourceInstance.getName();
53         this.resourceName = resourceInstance.getComponentName();
54         this.resourceVersion = resourceInstance.getComponentVersion();
55         if(resourceInstance.getOriginType() != null)
56             this.resourceType = resourceInstance.getOriginType().getValue();
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 resourceType;
88     }
89
90     public void setResoucreType(String resoucreType) {
91         this.resourceType = 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=" + resourceVersion + ", resoucreType=" + resourceType + ", resourceUUID=" + resourceUUID
145                 + ", resourceInvariantUUID=" + resourceInvariantUUID + ", resourceCustomizationUUID=" + resourceCustomizationUUID + ", category=" + category + ", subcategory=" + subcategory + ", artifacts=" + artifacts + "]";
146     }
147
148 }