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.be.datatypes.elements;
23 import java.io.Serializable;
25 public class PropertyDataDefinition implements Serializable {
30 private static final long serialVersionUID = 5798685557528432389L;
32 private String uniqueId;
34 // "boolean", "string", "float", "integer", "version" })
37 private Boolean required;
39 protected boolean definition = false;
41 private String defaultValue;
43 private String description;
45 private SchemaDefinition schema;
47 private boolean password;
49 public PropertyDataDefinition() {
53 public PropertyDataDefinition(PropertyDataDefinition p) {
54 this.uniqueId = p.uniqueId;
55 this.required = p.required;
56 this.defaultValue = p.defaultValue;
57 this.description = p.description;
58 this.schema = p.schema;
59 this.password = p.password;
64 public boolean isDefinition() {
68 public void setDefinition(boolean definition) {
69 this.definition = definition;
72 public String getType() {
76 public String getDefaultValue() {
80 public void setDefaultValue(String defaultValue) {
81 this.defaultValue = defaultValue;
84 public void setType(String type) {
88 public Boolean isRequired() {
92 public void setRequired(Boolean required) {
93 this.required = required;
96 public String getDescription() {
100 public void setDescription(String description) {
101 this.description = description;
104 public boolean isPassword() {
108 public void setPassword(boolean password) {
109 this.password = password;
112 public String getUniqueId() {
116 public void setUniqueId(String uniqueId) {
117 this.uniqueId = uniqueId;
120 public SchemaDefinition getSchema() {
124 public void setSchema(SchemaDefinition entrySchema) {
125 this.schema = entrySchema;
129 public String toString() {
130 return "PropertyDataDefinition [uniqueId=" + uniqueId + ", type=" + type + ", required=" + required
131 + ", defaultValue=" + defaultValue + ", description=" + description + ", entrySchema=" + schema
132 + ", password=" + password + "]";
136 public int hashCode() {
137 final int prime = 31;
139 result = prime * result + ((defaultValue == null) ? 0 : defaultValue.hashCode());
140 result = prime * result + (definition ? 1231 : 1237);
141 result = prime * result + ((description == null) ? 0 : description.hashCode());
142 result = prime * result + (password ? 1231 : 1237);
143 result = prime * result + ((required == null) ? 0 : required.hashCode());
144 result = prime * result + ((schema == null) ? 0 : schema.hashCode());
145 result = prime * result + ((type == null) ? 0 : type.hashCode());
146 result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode());
151 public boolean equals(Object obj) {
156 if (getClass() != obj.getClass())
158 PropertyDataDefinition other = (PropertyDataDefinition) obj;
159 if (defaultValue == null) {
160 if (other.defaultValue != null)
162 } else if (!defaultValue.equals(other.defaultValue))
164 if (definition != other.definition)
166 if (description == null) {
167 if (other.description != null)
169 } else if (!description.equals(other.description))
171 if (password != other.password)
173 if (required == null) {
174 if (other.required != null)
176 } else if (!required.equals(other.required))
178 if (schema == null) {
179 if (other.schema != null)
181 } else if (!schema.equals(other.schema))
184 if (other.type != null)
186 } else if (!type.equals(other.type))
188 if (uniqueId == null) {
189 if (other.uniqueId != null)
191 } else if (!uniqueId.equals(other.uniqueId))