2 * Copyright 2017 ZTE Corporation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.holmes.common.aai.entity;
19 import java.util.List;
25 public class RelationshipList {
27 private List<Relationship> relationships;
29 public Relationship getRelationship(String relatedTo) {
30 Relationship relationship = null;
31 if(null == relationships || relationships.size() == 0)
33 for(int i = 0; i < relationships.size(); i++) {
34 if (relatedTo.equals(relationships.get(i).getRelatedTo())) {
35 relationship = relationships.get(i);
44 public static class Relationship {
45 private String relatedLink;
46 private String relatedTo;
47 private List<RelatedToProperty> relatedToPropertyList;
48 private List<RelationshipData> relationshipDataList;
50 public String getRelatedToPropertyValue(String key) {
52 if (null == relatedToPropertyList || relatedToPropertyList.size() == 0) {
55 for(int i = 0; i < relatedToPropertyList.size(); i++) {
56 if (key.equals(relatedToPropertyList.get(i).getPropertyKey())) {
57 value = relatedToPropertyList.get(i).getPropertyValue();
64 public String getRelationshipDataValue(String key) {
66 if (null == relationshipDataList || relationshipDataList.size() == 0) {
69 for(int i = 0; i < relationshipDataList.size(); i++) {
70 if (key.equals(relationshipDataList.get(i).getRelationshipKey())) {
71 value = relationshipDataList.get(i).getRelationshipValue();
81 public static class RelationshipData {
82 private String relationshipKey;
83 private String relationshipValue;
88 public static class RelatedToProperty {
89 private String propertyKey;
90 private String propertyValue;