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.openecomp.sdc.be.datatypes.elements;
23 import com.fasterxml.jackson.annotation.JsonCreator;
24 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
25 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
27 import java.io.Serializable;
28 import java.util.HashMap;
31 import static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
33 public class InterfaceDataDefinition extends ToscaDataDefinition implements Serializable {
36 public InterfaceDataDefinition() {
38 setOperations(new HashMap<>());
41 public InterfaceDataDefinition(String type, String description) {
44 setDescription(description);
48 public InterfaceDataDefinition(InterfaceDataDefinition p) {
49 setUniqueId(p.getUniqueId());
51 setDescription(p.getDescription());
52 setToscaResourceName(p.getToscaResourceName());
53 setOperations(p.getOperations());
56 public String getUniqueId() {
57 return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
60 public void setUniqueId(String uniqueId) {
61 setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
64 public String getType() {
65 return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
68 public void setType(String type) {
69 setToscaPresentationValue(JsonPresentationFields.TYPE, type);
72 public Long getCreationDate() {
73 return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_DATE);
76 public void setCreationDate(Long creationDate) {
77 setToscaPresentationValue(JsonPresentationFields.CREATION_DATE, creationDate);
80 public Long getLastUpdateDate() {
81 return (Long) getToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE);
84 public void setLastUpdateDate(Long lastUpdateDate) {
85 setToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE, lastUpdateDate);
88 public String getDescription() {
89 return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
92 public void setDescription(String description) {
93 setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
96 public Map<String, OperationDataDefinition> getOperations() {
97 return (Map<String, OperationDataDefinition>)
98 getToscaPresentationValue(JsonPresentationFields.INTERFACE_OPERATION);
101 public void setOperations(Map<String, OperationDataDefinition> operations) {
102 setToscaPresentationValue(JsonPresentationFields.INTERFACE_OPERATION, operations);
105 public String getToscaResourceName() {
106 return (String) getToscaPresentationValue(TOSCA_RESOURCE_NAME);
109 public void setToscaResourceName(String toscaResourceName) {
110 setToscaPresentationValue(TOSCA_RESOURCE_NAME, toscaResourceName);