cadbb34aef112d66ea4e86964546d7c9fd6a1dc5
[vfc/nfvo/catalog.git] /
1 /**
2  * Copyright 2016 ZTE Corporation.
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.openo.commontosca.catalog.model.entity;
17
18 import java.util.HashMap;
19 import java.util.Map;
20
21 import lombok.AllArgsConstructor;
22 import lombok.Data;
23 import lombok.NoArgsConstructor;
24
25 import com.fasterxml.jackson.annotation.JsonIgnore;
26
27
28 @Data
29 @NoArgsConstructor
30 @AllArgsConstructor
31 public class SubstitutionMapping {
32   @JsonIgnore
33   private String serviceTemplateId;
34   private String nodeType;
35   private Map<String, String[]> requirements = new HashMap<String, String[]>();
36   private Map<String, String[]> capabilities = new HashMap<String, String[]>();
37
38   /**
39    * put requirement.
40    * @param key  key
41    * @param value value
42    * @return string list
43    */
44   public String[] putRequirement(String key, String[] value) {
45     return this.requirements.put(key, value);
46   }
47
48   /** 
49    * put capability.
50    * @param key key
51    * @param value value
52    * @return string list
53    */
54   public String[] putCapability(String key, String[] value) {
55     return this.capabilities.put(key, value);
56   }
57
58   /**
59    * substitution mapping.
60    * @param serviceTemplateId service template id
61    * @param nodeType node type
62    */
63   public SubstitutionMapping(String serviceTemplateId, String nodeType) {
64     super();
65     this.serviceTemplateId = serviceTemplateId;
66     this.nodeType = nodeType;
67   }
68 }