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=========================================================
21 package org.onap.sdc.tosca.datatypes.model;
23 import org.onap.sdc.tosca.services.DataModelCloneUtil;
25 import java.util.List;
28 public class CapabilityDefinition implements Cloneable {
31 private String description;
32 private Map<String, PropertyDefinition> properties;
33 private Map<String, AttributeDefinition> attributes;
34 private List<String> valid_source_types;
35 private Object[] occurrences;
41 public CapabilityDefinition() {
42 occurrences = new Object[2];
44 occurrences[1] = "UNBOUNDED";
47 public String getType() {
51 public void setType(String type) {
55 public String getDescription() {
59 public void setDescription(String description) {
60 this.description = description;
63 public Map<String, PropertyDefinition> getProperties() {
67 public void setProperties(Map<String, PropertyDefinition> properties) {
68 this.properties = properties;
71 public Map<String, AttributeDefinition> getAttributes() {
75 public void setAttributes(Map<String, AttributeDefinition> attributes) {
76 this.attributes = attributes;
79 public List<String> getValid_source_types() {
80 return valid_source_types;
83 public void setValid_source_types(List<String> valid_source_types) {
84 this.valid_source_types = valid_source_types;
87 public Object[] getOccurrences() {
91 public void setOccurrences(Object[] occurrences) {
92 this.occurrences = occurrences;
96 public CapabilityDefinition clone() {
97 CapabilityDefinition capabilityDefinition = new CapabilityDefinition();
99 .setOccurrences(new Object[]{this.getOccurrences()[0], this.getOccurrences()[1]});
101 .setProperties(DataModelCloneUtil.clonePropertyDefinitions(this.getProperties()));
102 capabilityDefinition.setType(this.getType());
104 .setAttributes(DataModelCloneUtil.cloneAttributeDefinitions(this.getAttributes()));
105 capabilityDefinition.setDescription(this.getDescription());
107 .setValid_source_types(DataModelCloneUtil.cloneListString(this.getValid_source_types()));
108 return capabilityDefinition;