2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2020 AT&T Intellectual Property. All rights
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============================================
20 * ===================================================================
24 package org.onap.clamp.clds.tosca.update;
26 import java.util.ArrayList;
27 import java.util.LinkedHashMap;
29 public class Component {
32 * name parameter is used as "key", in the LinkedHashMap of Components.
35 private String derivedFrom;
36 private String version;
37 private String typeVersion;
38 private String description;
39 private LinkedHashMap<String, Property> properties;
48 * @param derivedFrom derivedFrom
49 * @param description description
51 @SuppressWarnings({"unchecked", "rawtypes"})
52 public Component(String name, String derivedFrom, String description) {
55 this.derivedFrom = derivedFrom;
56 this.description = description;
57 this.properties = new LinkedHashMap();
60 public String getName() {
64 public void setName(String name) {
68 public String getDerivedFrom() {
72 public void setDerivedFrom(String derivedFrom) {
73 this.derivedFrom = derivedFrom;
76 public String getVersion() {
80 public void setVersion(String version) {
81 this.version = version;
84 public String getTypeVersion() {
88 public void setTypeVersion(String typeVersion) {
89 this.typeVersion = typeVersion;
92 public String getDescription() {
96 public void setDescription(String description) {
97 this.description = description;
100 public LinkedHashMap<String, Property> getProperties() {
104 public void setProperties(LinkedHashMap<String, Property> properties) {
105 this.properties = properties;
108 public void addProperties(Property property) {
109 this.properties.put(property.getName(), property);
112 public ArrayList<String> propertiesNames() {
113 return new ArrayList<>(properties.keySet());
117 public String toString() {
118 return name + ": " + description + ", version: " + version + ", nb de properties: " + properties.size()
119 + System.getProperty("line.separator") + propertiesNames();