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.datatypes.enums.NodeTypeEnum;
27 import java.util.HashMap;
30 public class TagData extends GraphNode {
34 protected TagData(NodeTypeEnum label) {
38 public TagData(String name) {
39 super(NodeTypeEnum.Tag);
44 super(NodeTypeEnum.Tag);
47 public TagData(Map<String, Object> properties) {
48 super(NodeTypeEnum.Tag);
49 setName((String) properties.get(GraphPropertiesDictionary.NAME.getProperty()));
53 public Map<String, Object> toGraphMap() {
54 Map<String, Object> map = new HashMap<>();
55 addIfExists(map, GraphPropertiesDictionary.NAME, name);
59 public String getName() {
63 public void setName(String name) {
68 public String toString() {
69 return "Tag [Name=" + name + "]";
73 public int hashCode() {
76 result = prime * result + ((name == null) ? 0 : name.hashCode());
81 public boolean equals(Object obj) {
88 if (getClass() != obj.getClass()) {
91 TagData other = (TagData) obj;
93 if (other.getClass() != null) {
96 } else if (!name.equals(other.getName())) {
103 public String getUniqueIdKey() {
104 return GraphPropertiesDictionary.NAME.getProperty();
108 public String getUniqueId() {