re base code
[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
25 import java.util.List;
26
27 public class DataTypeDefinition extends DataTypeDataDefinition {
28
29     private DataTypeDefinition derivedFrom;
30
31     private List<PropertyConstraint> constraints;
32
33     private List<PropertyDefinition> properties;
34
35     public DataTypeDefinition() {
36         super();
37     }
38
39     public DataTypeDefinition(DataTypeDataDefinition p) {
40         super(p);
41     }
42
43     public DataTypeDefinition(DataTypeDefinition pd) {
44         this.setName(pd.getName());
45         this.setDerivedFrom(pd.getDerivedFrom());
46         this.setDerivedFromName(pd.getDerivedFromName());
47         this.setUniqueId(pd.getUniqueId());
48         this.setConstraints(pd.getConstraints());
49         this.setDescription(pd.getDescription());
50     }
51
52     public List<PropertyConstraint> getConstraints() {
53         return constraints;
54     }
55
56     public void setConstraints(List<PropertyConstraint> constraints) {
57         this.constraints = constraints;
58     }
59
60     public DataTypeDefinition getDerivedFrom() {
61         return derivedFrom;
62     }
63
64     public void setDerivedFrom(DataTypeDefinition derivedFrom) {
65         this.derivedFrom = derivedFrom;
66     }
67
68     public List<PropertyDefinition> getProperties() {
69         return properties;
70     }
71
72     public void setProperties(List<PropertyDefinition> properties) {
73         this.properties = properties;
74     }
75
76     @Override
77     public String toString() {
78         return super.toString() + " DataTypeDefinition [derivedFrom=" + derivedFrom + ", constraints=" + constraints
79                 + ", properties=" + properties + "]";
80     }
81
82 }