2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6 * Copyright © 2017-2018 Amdocs
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
21 package org.onap.aai.spike.schema;
23 import java.util.HashMap;
25 import javax.xml.bind.annotation.XmlElement;
26 import javax.xml.bind.annotation.XmlRootElement;
27 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
28 import com.google.gson.annotations.SerializedName;
32 * This class represents a relationship instance that can be used for marshalling and unmarshalling
33 * to/from a model compliant representation.
36 public class Relationship {
38 /** Unique identifier for this relationship. */
41 /** Relationship type. */
44 /** The source vertex for this edge. */
45 @SerializedName("source-node-type")
46 private String sourceNodeType;
48 /** The target vertex for this edge. */
49 @SerializedName("target-node-type")
50 private String targetNodeType;
52 /** The properties assigned to this edge. */
53 private Map<String, Object> properties = new HashMap<String, Object>();
56 public String getId() {
60 public void setId(String id) {
64 public String getType() {
68 public void setType(String type) {
72 public String getSourceNodeType() {
73 return sourceNodeType;
76 @XmlElement(name = "source-node-type")
77 public void setSourceNodeType(String sourceNodeType) {
78 this.sourceNodeType = sourceNodeType;
81 public String getTargetNodeType() {
82 return targetNodeType;
85 @XmlElement(name = "target-node-type")
86 public void setTargetNodeType(String targetNodeType) {
87 this.targetNodeType = targetNodeType;
90 @XmlJavaTypeAdapter(MapAdapter.class)
91 public Map<String, Object> getProperties() {
95 public void setProperties(Map<String, Object> properties) {
96 this.properties = properties;
99 public void setProperty(String key, Object property) {
100 properties.put(key, property);