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.resources.data;
23 import org.openecomp.sdc.be.dao.graph.datatype.GraphNode;
24 import org.openecomp.sdc.be.dao.neo4j.GraphPropertiesDictionary;
25 import org.openecomp.sdc.be.dao.utils.Constants;
26 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
28 import java.util.HashMap;
31 public class HeatParameterValueData extends GraphNode {
33 public HeatParameterValueData() {
34 super(NodeTypeEnum.HeatParameterValue);
37 public HeatParameterValueData(Map<String, Object> properties) {
40 this.setUniqueId((String) properties.get(GraphPropertiesDictionary.UNIQUE_ID.getProperty()));
41 String value = (String) properties.get(GraphPropertiesDictionary.VALUE.getProperty());
42 if (Constants.GRAPH_EMPTY_VALUE.equals(value)) {
50 private String uniqueId;
55 public String getUniqueId() {
59 public String getValue() {
63 public void setValue(String value) {
67 public void setUniqueId(String uniqueId) {
68 this.uniqueId = uniqueId;
72 public Map<String, Object> toGraphMap() {
73 Map<String, Object> map = new HashMap<>();
75 addIfExists(map, GraphPropertiesDictionary.UNIQUE_ID, uniqueId);
77 String updatedValue = value;
78 if (updatedValue == null) {
79 updatedValue = Constants.GRAPH_EMPTY_VALUE;
81 addIfExists(map, GraphPropertiesDictionary.VALUE, updatedValue);
87 public String toString() {
88 return "HeatParameterValueData [uniqueId=" + uniqueId + ", value=" + value + "]";