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