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.
17 package org.onap.sdc.tosca.datatypes.model;
19 import java.util.List;
20 import java.util.Objects;
21 import org.onap.sdc.tosca.services.DataModelCloneUtil;
23 public class DefinitionOfDataType implements Cloneable {
26 private String description;
28 private Boolean required;
29 private Object _default;
30 private Status status;
31 private List<Constraint> constraints;
32 private EntrySchema entry_schema;
34 public String getType() {
38 public void setType(String type) {
42 public String getDescription() {
46 public void setDescription(String description) {
47 this.description = description;
50 public Object getValue() {
54 public void setValue(Object value) {
58 public Boolean getRequired() {
62 public void setRequired(Boolean required) {
63 this.required = required;
66 public Object get_default() {
70 public void set_default(Object _default) {
71 this._default = _default;
74 public Status getStatus() {
78 public void setStatus(Status status) {
82 public List<Constraint> getConstraints() {
86 public void setConstraints(List<Constraint> constraints) {
87 this.constraints = constraints;
90 public EntrySchema getEntry_schema() {
94 public void setEntry_schema(EntrySchema entry_schema) {
95 this.entry_schema = entry_schema;
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;