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.aai.serialization.db;
23 import java.util.HashMap;
26 import org.apache.tinkerpop.gremlin.structure.Direction;
28 public class EdgeRule {
30 private String label = "";
31 private MultiplicityRule multiplicityRule = null;
32 private Direction direction = null;
33 private Map<String, String> edgeProperties = null;
34 private final String IS_PARENT = "isParent";
35 private final String USES_RESOURCE = "usesResource";
36 private final String HAS_DEL_TARGET = "hasDelTarget";
37 private final String SVC_INFRA = "SVC-INFRA";
40 * Instantiates a new edge rule.
43 edgeProperties = new HashMap<>();
51 public String getLabel() {
58 * @param label the new label
60 public void setLabel(String label) {
65 * Gets the multiplicity rule.
67 * @return the multiplicity rule
69 public MultiplicityRule getMultiplicityRule() {
70 return multiplicityRule;
74 * Sets the multiplicity rule.
76 * @param multiplicityRule the new multiplicity rule
78 public void setMultiplicityRule(MultiplicityRule multiplicityRule) {
79 this.multiplicityRule = multiplicityRule;
85 * @return the direction
87 public Direction getDirection() {
94 * @param direction the new direction
96 public void setDirection(Direction direction) {
97 this.direction = direction;
101 * Gets the checks if is parent.
103 * @return the checks if is parent
105 public String getIsParent() {
106 return this.getProp(this.IS_PARENT);
110 * Sets the checks if is parent.
112 * @param isParent the new checks if is parent
114 public void setIsParent(String isParent) {
115 this.setProp(this.IS_PARENT, isParent);
119 * Gets the uses resource.
121 * @return the uses resource
123 public String getUsesResource() {
124 return this.getProp(this.USES_RESOURCE);
128 * Sets the uses resource.
130 * @param usesResource the new uses resource
132 public void setUsesResource(String usesResource) {
133 this.setProp(this.USES_RESOURCE, usesResource);
137 * Gets the checks for del target.
139 * @return the checks for del target
141 public String getHasDelTarget() {
142 return this.getProp(this.HAS_DEL_TARGET);
146 * Sets the checks for del target.
148 * @param hasDelTarget the new checks for del target
150 public void setHasDelTarget(String hasDelTarget) {
151 this.setProp(this.HAS_DEL_TARGET, hasDelTarget);
155 * Gets the service infrastructure.
157 * @return the service infrastructure
159 public String getServiceInfrastructure() {
160 return this.getProp(this.SVC_INFRA);
164 * Sets the service infrastructure.
166 * @param serviceInfrastructure the new service infrastructure
168 public void setServiceInfrastructure(String serviceInfrastructure) {
169 this.setProp(this.SVC_INFRA, serviceInfrastructure);
173 * Gets the edge properties.
175 * @return the edge properties
177 public Map<String, String> getEdgeProperties() {
178 return this.edgeProperties;
185 * @param value the value
187 private void setProp(String key, String value) {
188 this.edgeProperties.put(key, value);
197 private String getProp(String key) {
198 return this.edgeProperties.get(key);