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=========================================================
20 package org.openecomp.sdc.be.tosca.model;
22 import java.util.HashMap;
26 import org.apache.commons.collections.MapUtils;
29 public class ToscaTopolgyTemplate {
32 private Map<String, ToscaProperty> inputs;
34 private Map<String, ToscaProperty> outputs;
36 private Map<String, ToscaNodeTemplate> node_templates;
37 private Map<String, ToscaGroupTemplate> groups;
38 private Map<String, ToscaPolicyTemplate> policies;
40 private SubstitutionMapping substitution_mappings;
42 private Map<String, ToscaRelationshipTemplate> relationshipTemplates;
44 public void addGroups(Map<String, ToscaGroupTemplate> groups) {
45 if (this.groups == null) {
46 this.groups = new HashMap<>();
48 this.groups.putAll(groups);
51 public void addPolicies(Map<String, ToscaPolicyTemplate> policiesMap) {
52 if (this.policies == null) {
53 this.policies = new HashMap<>();
55 this.policies.putAll(policiesMap);
58 public boolean isEmpty() {
59 return substitution_mappings == null &&
60 MapUtils.isEmpty(inputs) &&
61 MapUtils.isEmpty(outputs) &&
62 MapUtils.isEmpty(node_templates) &&
63 MapUtils.isEmpty(groups) &&
64 MapUtils.isEmpty(policies) &&
65 MapUtils.isEmpty(relationshipTemplates);