aboutsummaryrefslogtreecommitdiffstats
path: root/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java
diff options
context:
space:
mode:
Diffstat (limited to 'common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java')
-rw-r--r--common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java48
1 files changed, 14 insertions, 34 deletions
diff --git a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java
index 745f49dcfa..2f629ef54a 100644
--- a/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java
+++ b/common/openecomp-tosca-datatype/src/main/java/org/openecomp/sdc/tosca/datatypes/model/InterfaceDefinition.java
@@ -1,9 +1,6 @@
-/*-
- * ============LICENSE_START=======================================================
- * SDC
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
+/*
+ * Copyright © 2016-2018 European Support Limited
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -15,44 +12,26 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- * ============LICENSE_END=========================================================
*/
-
package org.openecomp.sdc.tosca.datatypes.model;
import org.apache.commons.collections4.MapUtils;
import java.util.HashMap;
import java.util.Map;
-import java.util.Objects;
public class InterfaceDefinition {
-
- private String type;
- private Map<String, PropertyDefinition> inputs;
- private Map<String, OperationDefinition> operations;
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public Map<String, PropertyDefinition> getInputs() {
- return inputs;
- }
-
- public void setInputs(
- Map<String, PropertyDefinition> inputs) {
- this.inputs = inputs;
- }
+ protected Map<String, OperationDefinition> operations;
public Map<String, OperationDefinition> getOperations() {
return operations;
}
+ public void setOperations(
+ Map<String, OperationDefinition> operations) {
+ this.operations = operations;
+ }
+
public void addOperation(String operationName, OperationDefinition operationDefinition) {
if (MapUtils.isEmpty(this.operations)) {
this.operations = new HashMap<>();
@@ -68,14 +47,15 @@ public class InterfaceDefinition {
if (!(o instanceof InterfaceDefinition)) {
return false;
}
+
InterfaceDefinition that = (InterfaceDefinition) o;
- return Objects.equals(type, that.type) &&
- Objects.equals(inputs, that.inputs) &&
- Objects.equals(operations, that.operations);
+
+ return getOperations() != null ? getOperations().equals(that.getOperations())
+ : that.getOperations() == null;
}
@Override
public int hashCode() {
- return Objects.hash(type, inputs, operations);
+ return getOperations() != null ? getOperations().hashCode() : 0;
}
}