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 RequirementImplData extends GraphNode {
34 private String uniqueId;
36 private Long creationTime;
38 private Long modificationTime;
44 public RequirementImplData() {
45 super(NodeTypeEnum.RequirementImpl);
48 public RequirementImplData(Map<String, Object> properties) {
52 this.setName((String) properties.get(GraphPropertiesDictionary.NAME.getProperty()));
54 this.setUniqueId((String) properties.get(GraphPropertiesDictionary.UNIQUE_ID.getProperty()));
56 this.setCreationTime((Long) properties.get(GraphPropertiesDictionary.CREATION_DATE.getProperty()));
58 this.setModificationTime((Long) properties.get(GraphPropertiesDictionary.LAST_UPDATE_DATE.getProperty()));
60 setPosX((String) properties.get(GraphPropertiesDictionary.POSITION_X.getProperty()));
62 setPosY((String) properties.get(GraphPropertiesDictionary.POSITION_Y.getProperty()));
67 public Map<String, Object> toGraphMap() {
69 Map<String, Object> map = new HashMap<>();
71 addIfExists(map, GraphPropertiesDictionary.UNIQUE_ID, uniqueId);
73 addIfExists(map, GraphPropertiesDictionary.NAME, name);
75 addIfExists(map, GraphPropertiesDictionary.CREATION_DATE, creationTime);
77 addIfExists(map, GraphPropertiesDictionary.LAST_UPDATE_DATE, modificationTime);
79 addIfExists(map, GraphPropertiesDictionary.POSITION_X, posX);
81 addIfExists(map, GraphPropertiesDictionary.POSITION_Y, posY);
86 public Long getCreationTime() {
90 public void setCreationTime(Long creationTime) {
91 this.creationTime = creationTime;
94 public Long getModificationTime() {
95 return modificationTime;
98 public void setModificationTime(Long modificationTime) {
99 this.modificationTime = modificationTime;
102 public void setUniqueId(String uniqueId) {
103 this.uniqueId = uniqueId;
107 public String getUniqueId() {
111 public String getName() {
115 public void setName(String name) {
119 public String getPosX() {
123 public void setPosX(String posX) {
127 public String getPosY() {
131 public void setPosY(String posY) {
136 public String toString() {
137 return "RequirementImplData [name=" + name + ", uniqueId=" + uniqueId + ", creationTime=" + creationTime
138 + ", modificationTime=" + modificationTime + ", posX=" + posX + ", posY=" + posY + "]";