2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.sdc.tosca.datatypes.model;
23 import org.openecomp.sdc.tosca.services.DataModelCloneUtil;
25 import java.util.List;
26 import java.util.Objects;
28 public class PropertyDefinition {
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;
38 public PropertyDefinition() {
39 status = Status.SUPPORTED;
43 public String getType() {
47 public void setType(String type) {
51 public String getDescription() {
55 public void setDescription(String description) {
56 this.description = description;
59 public Boolean getRequired() {
63 public void setRequired(Boolean required) {
64 this.required = required;
67 public Object get_default() {
71 public void set_default(Object _default) {
72 this._default = _default;
75 public Status getStatus() {
79 public void setStatus(Status status) {
83 public List<Constraint> getConstraints() {
87 public void setConstraints(List<Constraint> constraints) {
88 this.constraints = constraints;
91 public EntrySchema getEntry_schema() {
95 public void setEntry_schema(EntrySchema entry_schema) {
96 this.entry_schema = entry_schema;
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;