2 * ============LICENSE_START=======================================================
\r
4 * ================================================================================
\r
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
\r
6 * ================================================================================
\r
7 * Licensed under the Apache License, Version 2.0 (the "License");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
\r
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.vid.asdc.beans;
\r
23 import java.util.Collection;
\r
24 import java.util.UUID;
\r
27 * The Class Resource.
\r
29 public class Resource {
\r
53 * The Enum LifecycleState.
\r
55 public enum LifecycleState {
\r
57 /** The not certified checkout. */
\r
58 NOT_CERTIFIED_CHECKOUT,
\r
60 /** The not certified checkin. */
\r
61 NOT_CERTIFIED_CHECKIN,
\r
63 /** The ready for certification. */
\r
64 READY_FOR_CERTIFICATION,
\r
66 /** The certification in progress. */
\r
67 CERTIFICATION_IN_PROGRESS,
\r
69 /** The certified. */
\r
74 private String uuid;
\r
76 /** The invariant UUID. */
\r
77 private String invariantUUID;
\r
80 private String name;
\r
82 /** The description. */
\r
83 private String description;
\r
86 private String version;
\r
88 /** The tosca model URL. */
\r
89 private String toscaModelURL;
\r
91 /** The category. */
\r
92 private String category;
\r
94 /** The sub category. */
\r
95 private String subCategory;
\r
97 /** The resource type. */
\r
98 private Resource.Type resourceType;
\r
100 /** The lifecycle state. */
\r
101 private Resource.LifecycleState lifecycleState;
\r
103 /** The last updater user ID. */
\r
104 private String lastUpdaterUserId;
\r
106 /** The last updater full name. */
\r
107 private String lastUpdaterFullName;
\r
109 /** The tosca model. */
\r
110 private String toscaModel;
\r
112 /** The tosca resource name. */
\r
113 private String toscaResourceName;
\r
115 /** The artifacts. */
\r
116 private Collection<Artifact> artifacts;
\r
118 /** The resources. */
\r
119 private Collection<SubResource> resources;
\r
126 public String getUuid() {
\r
131 * Gets the invariant UUID.
\r
133 * @return the invariant UUID
\r
135 public String getInvariantUUID() {
\r
136 return invariantUUID;
\r
144 public String getName() {
\r
149 * Gets the description.
\r
151 * @return the description
\r
153 public String getDescription() {
\r
154 return description;
\r
158 * Gets the version.
\r
160 * @return the version
\r
162 public String getVersion() {
\r
167 * Gets the tosca model URL.
\r
169 * @return the tosca model URL
\r
171 public String getToscaModelURL() {
\r
172 return toscaModelURL;
\r
176 * Gets the category.
\r
178 * @return the category
\r
180 public String getCategory() {
\r
185 * Gets the sub category.
\r
187 * @return the sub category
\r
189 public String getSubCategory() {
\r
190 return subCategory;
\r
194 * Gets the resource type.
\r
196 * @return the resource type
\r
198 public Resource.Type getResourceType() {
\r
199 return resourceType;
\r
203 * Gets the lifecycle state.
\r
205 * @return the lifecycle state
\r
207 public Resource.LifecycleState getLifecycleState() {
\r
208 return lifecycleState;
\r
212 * Gets the last updater user ID.
\r
214 * @return the last updater user ID
\r
216 public String getLastUpdaterUserId() {
\r
217 return lastUpdaterUserId;
\r
221 * Gets the last updater full name.
\r
223 * @return the last updater full name
\r
225 public String getLastUpdaterFullName() {
\r
226 return lastUpdaterFullName;
\r
230 * Gets the tosca model.
\r
232 * @return the tosca model
\r
234 public String getToscaModel() {
\r
239 * Gets the tosca resource name.
\r
241 * @return the tosca resource name
\r
243 public String getToscaResourceName() {
\r
244 return toscaResourceName;
\r
248 * Gets the artifacts.
\r
250 * @return the artifacts
\r
252 public Collection<Artifact> getArtifacts() {
\r
257 * Gets the resources.
\r
259 * @return the resources
\r
261 public Collection<SubResource> getResources() {
\r
268 * @param uuid the new uuid
\r
270 public void setUuid(String uuid) {
\r
275 * Sets the invariant UUID.
\r
277 * @param invariantUUID the new invariant UUID
\r
279 public void setInvariantUUID(String invariantUUID) {
\r
280 this.invariantUUID = invariantUUID;
\r
286 * @param name the new name
\r
288 public void setName(String name) {
\r
292 * Sets the description.
\r
294 * @param name the new description
\r
296 public void setDescription(String description) {
\r
297 this.description = description;
\r
300 * Sets the version.
\r
302 * @param version the new version
\r
304 public void setVersion(String version) {
\r
305 this.version = version;
\r
309 * Sets the tosca model URL.
\r
311 * @param toscaModelURL the new tosca model URL
\r
313 public void setToscaModelURL(String toscaModelURL) {
\r
314 this.toscaModelURL = toscaModelURL;
\r
318 * Sets the category.
\r
320 * @param category the new category
\r
322 public void setCategory(String category) {
\r
323 this.category = category;
\r
327 * Sets the sub category.
\r
329 * @param subCategory the new sub category
\r
331 public void setSubCategory(String subCategory) {
\r
332 this.subCategory = subCategory;
\r
336 * Sets the resource type.
\r
338 * @param resourceType the new resource type
\r
340 public void setResourceType(Resource.Type resourceType) {
\r
341 this.resourceType = resourceType;
\r
345 * Sets the lifecycle state.
\r
347 * @param lifecycleState the new lifecycle state
\r
349 public void setLifecycleState(Resource.LifecycleState lifecycleState) {
\r
350 this.lifecycleState = lifecycleState;
\r
354 * Sets the last updater user ID.
\r
356 * @param lastUpdaterUserId the new last updater user ID
\r
358 public void setLastUpdaterUserId(String lastUpdaterUserId) {
\r
359 this.lastUpdaterUserId = lastUpdaterUserId;
\r
363 * Sets the last updater full name.
\r
365 * @param lastUpdaterFullName the new last updater full name
\r
367 public void setLastUpdaterFullName(String lastUpdaterFullName) {
\r
368 this.lastUpdaterFullName = lastUpdaterFullName;
\r
372 * Sets the tosca model.
\r
374 * @param toscaModel the new tosca model
\r
376 public void setToscaModel(String toscaModel) {
\r
377 this.toscaModel = toscaModel;
\r
381 * Sets the tosca resource name.
\r
383 * @param toscaResourceName the new tosca resource name
\r
385 public void setToscaResourceName(String toscaResourceName) {
\r
386 this.toscaResourceName = toscaResourceName;
\r
390 * Sets the artifacts.
\r
392 * @param artifacts the new artifacts
\r
394 public void setArtifacts(Collection<Artifact> artifacts) {
\r
395 this.artifacts = artifacts;
\r
399 * Sets the resources.
\r
401 * @param resources the new resources
\r
403 public void setResources(Collection<SubResource> resources) {
\r
404 this.resources = resources;
\r
408 * @see java.lang.Object#hashCode()
\r
411 public int hashCode() {
\r
412 final UUID uuid = UUID.fromString(getUuid());
\r
414 return uuid.hashCode();
\r
418 * @see java.lang.Object#equals(java.lang.Object)
\r
421 public boolean equals(Object o) {
\r
422 if (o == this) return true;
\r
423 if (!(o instanceof Resource)) return false;
\r
425 final Resource resource = (Resource) o;
\r
427 return (resource.getUuid().equals(getUuid()));
\r