2 * Copyright © 2016-2018 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.be.datatypes.elements;
19 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
20 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
22 import java.io.Serializable;
23 import java.util.HashMap;
25 import java.util.Objects;
27 public class InterfaceInstanceDataDefinition extends ToscaDataDefinition implements Serializable {
29 public InterfaceInstanceDataDefinition(
30 InterfaceInstanceDataDefinition inter) {
31 this.toscaPresentation = null;
32 setInputs(inter.getInputs() == null ? new HashMap() : new HashMap<>(inter.getInputs()));
33 setOperations(new HashMap<>(inter.getOperations()));
36 public InterfaceInstanceDataDefinition() {
37 this.toscaPresentation = null;
40 public Map<String, Object> getInputs() {
41 return (Map<String, Object>) getToscaPresentationValue(JsonPresentationFields.INPUTS);
44 public void setInputs(Map<String, Object> inputs) {
45 setToscaPresentationValue(JsonPresentationFields.INPUTS, inputs);
48 public Map<String, OperationInstance> getOperations() {
49 return (Map<String, OperationInstance>) getToscaPresentationValue(JsonPresentationFields.OPERATIONS);
52 public void setOperations(Map<String, OperationInstance> operations) {
53 setToscaPresentationValue(JsonPresentationFields.OPERATIONS, operations);
57 public boolean equals(Object o) {
61 if (!(o instanceof InterfaceInstanceDataDefinition)) {
64 InterfaceInstanceDataDefinition that = (InterfaceInstanceDataDefinition) o;
65 return Objects.equals(this.getInputs(), that.getInputs());
69 public int hashCode() {
71 return Objects.hash(this.getInputs());