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 com.fasterxml.jackson.annotation.JsonIgnore;
24 import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition;
25 import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition;
27 import java.io.Serializable;
29 import java.util.stream.Collectors;
32 * Definition of the operations that can be performed on (instances of) a Node
37 public class InterfaceDefinition extends InterfaceDataDefinition implements IOperationParameter, Serializable {
42 private static final long serialVersionUID = 8220887972866354746L;
45 private boolean definition;
47 public InterfaceDefinition() {
51 public InterfaceDefinition(String type, String description, Map<String, Operation> operations) {
52 super(type, description);
53 setOperationsMap(operations);
56 public InterfaceDefinition(InterfaceDataDefinition p) {
61 public boolean isDefinition() {
62 // TODO Auto-generated method stub
66 public void setDefinition(boolean definition) {
67 this.definition = definition;
71 public Map<String, Operation> getOperationsMap() {
72 Map<String, Operation> convertedOperation = getOperations().entrySet()
74 .collect(Collectors.toMap(e -> e.getKey(), e -> new Operation(e
76 return convertedOperation;
80 public void setOperationsMap(Map<String, Operation> operations) {
81 Map<String, OperationDataDefinition> convertedOperation = operations.entrySet()
83 .collect(Collectors.toMap(e -> e.getKey(), e -> new OperationDataDefinition(e
85 setOperations(convertedOperation);
89 public String toString() {
90 return "InterfaceDefinition [definition=" + definition + "]";