2 * Copyright © 2016-2018 European Support Limited
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onap.sdc.tosca.datatypes.model;
18 import java.util.List;
19 import java.util.Objects;
20 import org.onap.sdc.tosca.services.DataModelCloneUtil;
22 public class DefinitionOfDataType implements Cloneable {
25 private String description;
27 private Boolean required;
28 private Object _default;
29 private String status;
30 private List<Constraint> constraints;
31 private EntrySchema entry_schema;
33 public String getType() {
37 public void setType(String type) {
41 public String getDescription() {
45 public void setDescription(String description) {
46 this.description = description;
49 public Object getValue() {
53 public void setValue(Object value) {
57 public Boolean getRequired() {
61 public void setRequired(Boolean required) {
62 this.required = required;
65 public Object get_default() {
69 public void set_default(Object _default) {
70 this._default = _default;
73 public String getStatus() {
77 public void setStatus(String status) {
81 public List<Constraint> getConstraints() {
85 public void setConstraints(List<Constraint> constraints) {
86 this.constraints = constraints;
89 public EntrySchema getEntry_schema() {
93 public void setEntry_schema(EntrySchema entry_schema) {
94 this.entry_schema = entry_schema;
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;