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.
16 package org.openecomp.sdc.be.datatypes.elements;
18 import java.io.Serializable;
19 import java.util.HashMap;
21 import java.util.Objects;
22 import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields;
23 import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition;
25 public class InterfaceInstanceDataDefinition extends ToscaDataDefinition implements Serializable {
27 public InterfaceInstanceDataDefinition(InterfaceInstanceDataDefinition inter) {
28 this.toscaPresentation = null;
29 setInputs(inter.getInputs() == null ? new HashMap<String, Object>() : new HashMap<>(inter.getInputs()));
30 setOperations(new HashMap<>(inter.getOperations()));
33 public InterfaceInstanceDataDefinition() {
34 this.toscaPresentation = null;
37 public Map<String, Object> getInputs() {
38 return (Map<String, Object>) getToscaPresentationValue(JsonPresentationFields.INPUTS);
41 public void setInputs(Map<String, Object> inputs) {
42 setToscaPresentationValue(JsonPresentationFields.INPUTS, inputs);
45 public Map<String, OperationInstance> getOperations() {
46 return (Map<String, OperationInstance>) getToscaPresentationValue(JsonPresentationFields.OPERATIONS);
49 public void setOperations(Map<String, OperationInstance> operations) {
50 setToscaPresentationValue(JsonPresentationFields.OPERATIONS, operations);
54 public boolean equals(Object o) {
58 if (!(o instanceof InterfaceInstanceDataDefinition)) {
61 InterfaceInstanceDataDefinition that = (InterfaceInstanceDataDefinition) o;
62 return Objects.equals(this.getInputs(), that.getInputs());
66 public int hashCode() {
67 return Objects.hash(this.getInputs());