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 static org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields.TOSCA_RESOURCE_NAME;
25 import com.fasterxml.jackson.annotation.JsonCreator;
26 import java.io.Serializable;
27 import java.util.HashMap;
29 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
30 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
32 public class InterfaceDataDefinition extends ToscaDataDefinition implements Serializable {
34 public InterfaceDataDefinition(String type, String description) {
37 setDescription(description);
42 public InterfaceDataDefinition() {
44 setOperations(new HashMap<>());
47 public InterfaceDataDefinition(InterfaceDataDefinition p) {
48 setUniqueId(p.getUniqueId());
50 setDescription(p.getDescription());
51 setToscaResourceName(p.getToscaResourceName());
52 setOperations(p.getOperations());
55 public String getUniqueId() {
56 return (String) getToscaPresentationValue(JsonPresentationFields.UNIQUE_ID);
59 public void setUniqueId(String uniqueId) {
60 setToscaPresentationValue(JsonPresentationFields.UNIQUE_ID, uniqueId);
63 public String getType() {
64 return (String) getToscaPresentationValue(JsonPresentationFields.TYPE);
67 public void setType(String type) {
68 setToscaPresentationValue(JsonPresentationFields.TYPE, type);
71 public String getDescription() {
72 return (String) getToscaPresentationValue(JsonPresentationFields.DESCRIPTION);
75 public void setDescription(String description) {
76 setToscaPresentationValue(JsonPresentationFields.DESCRIPTION, description);
79 public String getToscaResourceName() {
80 return (String) getToscaPresentationValue(TOSCA_RESOURCE_NAME);
83 public Map<String, OperationDataDefinition> getOperations() {
84 return (Map<String, OperationDataDefinition>) getToscaPresentationValue(JsonPresentationFields.OPERATIONS);
87 public void setOperations(Map<String, OperationDataDefinition> operations) {
88 setToscaPresentationValue(JsonPresentationFields.OPERATIONS, operations);
91 public void setToscaResourceName(String toscaResourceName) {
92 setToscaPresentationValue(TOSCA_RESOURCE_NAME, toscaResourceName);
95 public Long getCreationDate() {
96 return (Long) getToscaPresentationValue(JsonPresentationFields.CREATION_DATE);
99 public void setCreationDate(Long creationDate) {
100 setToscaPresentationValue(JsonPresentationFields.CREATION_DATE, creationDate);
103 public Long getLastUpdateDate() {
104 return (Long) getToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE);
107 public void setLastUpdateDate(Long lastUpdateDate) {
108 setToscaPresentationValue(JsonPresentationFields.LAST_UPDATE_DATE, lastUpdateDate);