2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 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.onap.vid.model.aaiTree;
23 import org.apache.commons.lang3.StringUtils;
27 public class AAITreeNode {
30 private int uniqueNumber;
31 private String orchestrationStatus;
32 private String provStatus;
33 private Boolean inMaint = null;
34 private String modelVersionId;
35 private String modelCustomizationId;
36 private String modelInvariantId;
39 private String modelVersion;
40 private String modelName;
41 private String modelCustomizationName;
42 private final List<AAITreeNode> children = Collections.synchronizedList(new LinkedList<>());
43 private Map<String, Object> additionalProperties = new HashMap<>();
44 private String keyInModel;
45 private AAITreeNode parent;
47 public String getType() {
51 public void setType(String type) {
55 public int getUniqueNumber() {
59 public void setUniqueNumber(int uniqueNumber) {
60 this.uniqueNumber = uniqueNumber;
63 public String getOrchestrationStatus() {
64 return orchestrationStatus;
67 public void setOrchestrationStatus(String orchestrationStatus) {
68 this.orchestrationStatus = orchestrationStatus;
71 public String getProvStatus() {
75 public void setProvStatus(String provStatus) {
76 this.provStatus = provStatus;
79 public Boolean getInMaint() {
83 public void setInMaint(Boolean inMaint) {
84 this.inMaint = inMaint;
87 public String getModelVersionId() {
88 return modelVersionId;
91 public void setModelVersionId(String modelVersionId) {
92 this.modelVersionId = modelVersionId;
95 public String getModelCustomizationId() {
96 return modelCustomizationId;
99 public void setModelCustomizationId(String modelCustomizationId) {
100 this.modelCustomizationId = modelCustomizationId;
103 public String getModelInvariantId() {
104 return modelInvariantId;
107 public void setModelInvariantId(String modelInvariantId) {
108 this.modelInvariantId = modelInvariantId;
111 public String getId() {
115 public void setId(String id) {
119 public String getName() {
123 public void setName(String name) {
127 public String getModelVersion() {
131 public void setModelVersion(String modelVersion) {
132 this.modelVersion = modelVersion;
135 public String getModelName() {
139 public void setModelName(String modelName) {
140 this.modelName = modelName;
143 public String getModelCustomizationName() {
144 return modelCustomizationName;
147 public void setModelCustomizationName(String modelCustomizationName) {
148 this.modelCustomizationName = modelCustomizationName;
151 public List<AAITreeNode> getChildren() {
155 public Map<String, Object> getAdditionalProperties() {
156 return additionalProperties;
159 public void setAdditionalProperties(Map<String, Object> additionalProperties) {
160 this.additionalProperties = additionalProperties;
163 public String getNodeKey() {
164 if (this.keyInModel != null) {
165 return this.keyInModel;
168 return StringUtils.defaultIfEmpty(this.modelVersionId, "not provided");
171 public String getUniqueNodeKey() {
172 return getNodeKey() + ":" + String.format("%03d", this.uniqueNumber);
175 public void setKeyInModel(String keyInModel) {
176 this.keyInModel = keyInModel;
179 public String getKeyInModel() {
183 public AAITreeNode getParent() {
187 public void setParent(AAITreeNode parent) {
188 this.parent = parent;
191 public void addChildren(List<AAITreeNode> children) {
192 for (AAITreeNode child : children) {
193 child.setParent(this);
196 this.getChildren().addAll(children);