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.DaoUtils;
26 import org.openecomp.sdc.be.datatypes.enums.NodeTypeEnum;
28 import java.util.HashMap;
31 public class UserFunctionalMenuData extends GraphNode {
33 private String uniqueId;
35 private String functionalMenu;
37 public UserFunctionalMenuData(String functionalMenu, String uniqueId) {
38 super(NodeTypeEnum.UserFunctionalMenu);
39 this.functionalMenu = functionalMenu;
40 this.uniqueId = uniqueId;
43 public UserFunctionalMenuData() {
44 super(NodeTypeEnum.UserFunctionalMenu);
47 public UserFunctionalMenuData(Map<String, Object> properties) {
48 super(NodeTypeEnum.UserFunctionalMenu);
50 setFunctionalMenu((String) properties.get(GraphPropertiesDictionary.FUNCTIONAL_MENU.getProperty()));
51 setUniqueId((String) properties.get(GraphPropertiesDictionary.UNIQUE_ID.getProperty()));
54 public String getFunctionalMenu() {
55 return functionalMenu;
58 public void setFunctionalMenu(String functionalMenu) {
59 this.functionalMenu = functionalMenu;
62 public void setUniqueId(String uniqueId) {
63 this.uniqueId = uniqueId;
67 public String toString() {
68 return "UserFunctionalMenuData [uniqueId=" + uniqueId + ", functionalMenu=" + functionalMenu + "]";
71 public String toJson() {
72 return DaoUtils.convertToJson(toGraphMap());
76 public Map<String, Object> toGraphMap() {
77 Map<String, Object> map = new HashMap<>();
79 addIfExists(map, GraphPropertiesDictionary.UNIQUE_ID, uniqueId);
80 addIfExists(map, GraphPropertiesDictionary.FUNCTIONAL_MENU, functionalMenu);
86 public String getUniqueIdKey() {
87 return GraphPropertiesDictionary.UNIQUE_ID.getProperty();
91 public String getUniqueId() {