Change to enable SDC list type input
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / DataTypeDefinition.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.model;
22
23 import org.openecomp.sdc.be.datatypes.elements.DataTypeDataDefinition;
24 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
25
26 import java.util.List;
27 import java.util.stream.Collectors;
28
29 public class DataTypeDefinition extends DataTypeDataDefinition {
30
31     private DataTypeDefinition derivedFrom;
32
33     private List<PropertyConstraint> constraints;
34
35     private List<PropertyDefinition> properties;
36
37     public DataTypeDefinition() {
38         super();
39     }
40
41     public DataTypeDefinition(DataTypeDataDefinition p) {
42         super(p);
43     }
44
45     public DataTypeDefinition(DataTypeDefinition pd) {
46         this.setName(pd.getName());
47         this.setDerivedFrom(pd.getDerivedFrom());
48         this.setDerivedFromName(pd.getDerivedFromName());
49         this.setUniqueId(pd.getUniqueId());
50         this.setConstraints(pd.getConstraints());
51         this.setDescription(pd.getDescription());
52     }
53
54     public List<PropertyConstraint> getConstraints() {
55         return constraints;
56     }
57
58     public void setConstraints(List<PropertyConstraint> constraints) {
59         this.constraints = constraints;
60     }
61
62     public DataTypeDefinition getDerivedFrom() {
63         return derivedFrom;
64     }
65
66     public void setDerivedFrom(DataTypeDefinition derivedFrom) {
67         this.derivedFrom = derivedFrom;
68     }
69
70     public List<PropertyDefinition> getProperties() {
71         return properties;
72     }
73
74     public void setProperties(List<PropertyDefinition> properties) {
75         this.properties = properties;
76     }
77
78     @Override
79     public String toString() {
80         return super.toString() + " DataTypeDefinition [derivedFrom=" + derivedFrom + ", constraints=" + constraints
81                 + ", properties=" + properties + "]";
82     }
83
84 }