9d00532a30c93163607701f83ba6f736aa8c8ad8
[sdc.git] / common / onap-tosca-datatype / src / main / java / org / onap / sdc / tosca / datatypes / model / DefinitionOfDataType.java
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
17 package org.onap.sdc.tosca.datatypes.model;
18
19 import java.util.List;
20 import java.util.Objects;
21 import org.onap.sdc.tosca.services.DataModelCloneUtil;
22
23 public class DefinitionOfDataType implements Cloneable{
24
25   protected String type;
26   protected String description;
27   protected Object value;
28   protected Boolean required;
29   protected Object _default;
30   protected Status status;
31   protected List<Constraint> constraints;
32   protected EntrySchema entry_schema;
33
34   public String getType() {
35     return type;
36   }
37
38   public void setType(String type) {
39     this.type = type;
40   }
41
42   public String getDescription() {
43     return description;
44   }
45
46   public void setDescription(String description) {
47     this.description = description;
48   }
49
50   public Object getValue() {
51     return value;
52   }
53
54   public void setValue(Object value) {
55     this.value = value;
56   }
57
58   public Boolean getRequired() {
59     return required;
60   }
61
62   public void setRequired(Boolean required) {
63     this.required = required;
64   }
65
66   public Object get_default() {
67     return _default;
68   }
69
70   public void set_default(Object _default) {
71     this._default = _default;
72   }
73
74   public Status getStatus() {
75     return status;
76   }
77
78   public void setStatus(Status status) {
79     this.status = status;
80   }
81
82   public List<Constraint> getConstraints() {
83     return constraints;
84   }
85
86   public void setConstraints(List<Constraint> constraints) {
87     this.constraints = constraints;
88   }
89
90   public EntrySchema getEntry_schema() {
91     return entry_schema;
92   }
93
94   public void setEntry_schema(EntrySchema entry_schema) {
95     this.entry_schema = entry_schema;
96   }
97
98   @Override
99   public DefinitionOfDataType clone() {
100     DefinitionOfDataType definitionOfDataType = new DefinitionOfDataType();
101     definitionOfDataType.setType(this.getType());
102     definitionOfDataType.setDescription(this.getDescription());
103     definitionOfDataType.setRequired(this.getRequired());
104     definitionOfDataType.set_default(this.get_default());
105     definitionOfDataType.setStatus(this.getStatus());
106     definitionOfDataType.setEntry_schema(
107             Objects.isNull(this.getEntry_schema()) ? null : this.getEntry_schema().clone());
108     definitionOfDataType.setConstraints(DataModelCloneUtil.cloneConstraints(this.getConstraints()));
109     return definitionOfDataType;
110   }
111
112 }