73b5d77599684809e7c1659daa942eb7aa93b00e
[sdc.git] /
1 /*
2  * Copyright © 2016-2018 European Support Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.sdc.tosca.datatypes.model;
17
18 import java.util.List;
19 import java.util.Objects;
20 import org.onap.sdc.tosca.services.DataModelCloneUtil;
21
22 public class DefinitionOfDataType implements Cloneable {
23
24     private String type;
25     private String description;
26     private Object value;
27     private Boolean required;
28     private Object _default;
29     private String status;
30     private List<Constraint> constraints;
31     private EntrySchema entry_schema;
32
33     public String getType() {
34         return type;
35     }
36
37     public void setType(String type) {
38         this.type = type;
39     }
40
41     public String getDescription() {
42         return description;
43     }
44
45     public void setDescription(String description) {
46         this.description = description;
47     }
48
49     public Object getValue() {
50         return value;
51     }
52
53     public void setValue(Object value) {
54         this.value = value;
55     }
56
57     public Boolean getRequired() {
58         return required;
59     }
60
61     public void setRequired(Boolean required) {
62         this.required = required;
63     }
64
65     public Object get_default() {
66         return _default;
67     }
68
69     public void set_default(Object _default) {
70         this._default = _default;
71     }
72
73     public String getStatus() {
74         return status;
75     }
76
77     public void setStatus(String status) {
78         this.status = status;
79     }
80
81     public List<Constraint> getConstraints() {
82         return constraints;
83     }
84
85     public void setConstraints(List<Constraint> constraints) {
86         this.constraints = constraints;
87     }
88
89     public EntrySchema getEntry_schema() {
90         return entry_schema;
91     }
92
93     public void setEntry_schema(EntrySchema entry_schema) {
94         this.entry_schema = entry_schema;
95     }
96
97     @Override
98     public DefinitionOfDataType clone() {
99         DefinitionOfDataType definitionOfDataType = new DefinitionOfDataType();
100         definitionOfDataType.setType(this.getType());
101         definitionOfDataType.setDescription(this.getDescription());
102         definitionOfDataType.setRequired(this.getRequired());
103         definitionOfDataType.set_default(this.get_default());
104         definitionOfDataType.setStatus(this.getStatus());
105         definitionOfDataType.setEntry_schema(Objects.isNull(this.getEntry_schema()) ? null : this.getEntry_schema().clone());
106         definitionOfDataType.setConstraints(DataModelCloneUtil.cloneConstraints(this.getConstraints()));
107         return definitionOfDataType;
108     }
109 }