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");
\r
8 * you may not use this file except in compliance with the License.
\r
9 * You may obtain a copy of the License at
\r
11 * http://www.apache.org/licenses/LICENSE-2.0
\r
13 * Unless required by applicable law or agreed to in writing, software
\r
14 * distributed under the License is distributed on an "AS IS" BASIS,
\r
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
16 * See the License for the specific language governing permissions and
\r
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
\r
21 package org.openecomp.vid.asdc.beans.tosca;
\r
23 import java.util.Collection;
\r
24 import java.util.LinkedList;
\r
27 * The Class ToscaCsar.
\r
29 public class ToscaCsar {
\r
32 private final ToscaModel parent;
\r
34 /** The children. */
\r
35 private final Collection<ToscaModel> children;
\r
38 * The Class Builder.
\r
40 public static class Builder {
\r
43 private final ToscaModel parent;
\r
45 /** The children. */
\r
46 private Collection<ToscaModel> children = new LinkedList<ToscaModel> ();
\r
49 * Instantiates a new builder.
\r
51 * @param parent the parent
\r
53 public Builder(ToscaModel parent) {
\r
54 this.parent = parent;
\r
60 * @param child the child
\r
61 * @return the builder
\r
63 public Builder addVnf(ToscaModel child) {
\r
64 children.add(child);
\r
71 * @return the tosca csar
\r
73 public ToscaCsar build() {
\r
74 return new ToscaCsar(this);
\r
79 * Instantiates a new tosca csar.
\r
81 * @param builder the builder
\r
83 public ToscaCsar(Builder builder) {
\r
84 this.parent = builder.parent;
\r
85 this.children = builder.children;
\r
91 * @return the parent
\r
93 public ToscaModel getParent() { return parent; }
\r
96 * Gets the children.
\r
98 * @return the children
\r
100 public Collection<ToscaModel> getChildren() { return children; }
\r