push addional code
[sdc.git] / openecomp-be / backend / openecomp-sdc-vendor-software-product-manager / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / types / CompositionEntityValidationData.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.vendorsoftwareproduct.types;
22
23 import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType;
24
25 import java.util.ArrayList;
26 import java.util.Collection;
27
28 /**
29  * The type Composition entity validation data.
30  */
31 public class CompositionEntityValidationData {
32   private CompositionEntityType entityType;
33   private String entityId;
34   private Collection<String> errors;
35   private Collection<CompositionEntityValidationData> subEntitiesValidationData;
36
37   /**
38    * Instantiates a new Composition entity validation data.
39    *
40    * @param entityType the entity type
41    * @param entityId   the entity id
42    */
43   public CompositionEntityValidationData(CompositionEntityType entityType, String entityId) {
44     this.entityType = entityType;
45     this.entityId = entityId;
46   }
47
48   /**
49    * Gets entity type.
50    *
51    * @return the entity type
52    */
53   public CompositionEntityType getEntityType() {
54     return entityType;
55   }
56
57   /**
58    * Sets entity type.
59    *
60    * @param entityType the entity type
61    */
62   public void setEntityType(CompositionEntityType entityType) {
63     this.entityType = entityType;
64   }
65
66   /**
67    * Gets entity id.
68    *
69    * @return the entity id
70    */
71   public String getEntityId() {
72     return entityId;
73   }
74
75   /**
76    * Sets entity id.
77    *
78    * @param entityId the entity id
79    */
80   public void setEntityId(String entityId) {
81     this.entityId = entityId;
82   }
83
84   /**
85    * Gets errors.
86    *
87    * @return the errors
88    */
89   public Collection<String> getErrors() {
90     return errors;
91   }
92
93   /**
94    * Sets errors.
95    *
96    * @param errors the errors
97    */
98   public void setErrors(Collection<String> errors) {
99     this.errors = errors;
100   }
101
102   /**
103    * Gets sub entities validation data.
104    *
105    * @return the sub entities validation data
106    */
107   public Collection<CompositionEntityValidationData> getSubEntitiesValidationData() {
108     return subEntitiesValidationData;
109   }
110
111   /**
112    * Add sub entity validation data.
113    *
114    * @param subEntityValidationData the sub entity validation data
115    */
116   public void addSubEntityValidationData(CompositionEntityValidationData subEntityValidationData) {
117     if (subEntitiesValidationData == null) {
118       subEntitiesValidationData = new ArrayList<>();
119     }
120     subEntitiesValidationData.add(subEntityValidationData);
121   }
122 }