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.model;
23 import java.io.Serializable;
24 import java.util.HashMap;
26 import java.util.stream.Collectors;
28 import org.codehaus.jackson.annotate.JsonIgnore;
29 import org.openecomp.sdc.be.datatypes.elements.AdditionalInfoParameterDataDefinition;
30 import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
31 import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
34 * Definition of the operations that can be performed on (instances of) a Node
39 public class InterfaceDefinition extends InterfaceDataDefinition implements IOperationParameter, Serializable {
44 private static final long serialVersionUID = 8220887972866354746L;
48 private boolean definition;
50 public InterfaceDefinition() {
54 public InterfaceDefinition(String type, String description, Map<String, Operation> operations) {
55 super(type, description);
56 setOperationsMap(operations);
59 public InterfaceDefinition(InterfaceDataDefinition p) {
64 public boolean isDefinition() {
65 // TODO Auto-generated method stub
69 public void setDefinition(boolean definition) {
70 this.definition = definition;
73 public Map<String, Operation> getOperationsMap() {
74 Map<String, Operation> convertedOperation = getOperations().entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> new Operation(e.getValue())));
75 return convertedOperation;
78 public void setOperationsMap(Map<String, Operation> operations) {
79 Map<String, OperationDataDefinition> convertedOperation = operations.entrySet().stream().collect(Collectors.toMap(e -> e.getKey(), e -> new OperationDataDefinition(e.getValue())));
80 setOperations(convertedOperation);
84 public String toString() {
85 return "InterfaceDefinition [definition=" + definition + "]";