66cb111b54e7b01eaad1f526eb7f53587d119077
[appc.git] / appc-sequence-generator / appc-sequence-generator-bundle / src / main / java / org / onap / appc / seqgen / objects / SequenceGeneratorInputBuilder.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APP-C
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.appc.seqgen.objects;
22
23 import org.onap.appc.dg.objects.InventoryModel;
24 import org.onap.appc.dg.objects.VnfcDependencyModel;
25
26 import java.util.HashMap;
27 import java.util.List;
28 import java.util.Map;
29
30 public class SequenceGeneratorInputBuilder {
31
32     private RequestInfo requestInfo;
33
34     private InventoryModel inventoryModel;
35
36     private VnfcDependencyModel dependencyModel;
37
38     private Map<String,String> tunableParams;
39
40     private Map<String,List<String>> capability;
41
42     public SequenceGeneratorInputBuilder requestInfo(RequestInfo requestInfo){
43         this.requestInfo = requestInfo;
44         return this;
45     }
46
47     public SequenceGeneratorInputBuilder capability(String level,List<String> capabilities){
48         if(this.capability ==null){
49             this.capability = new HashMap<>();
50         }
51         this.capability.put(level,capabilities);
52         return this;
53     }
54
55     public SequenceGeneratorInputBuilder tunableParameter(String key,String value){
56         if(this.tunableParams ==null){
57             this.tunableParams = new HashMap<>();
58         }
59         this.tunableParams.put(key,value);
60         return this;
61     }
62
63     public SequenceGeneratorInputBuilder inventoryModel(InventoryModel model){
64         this.inventoryModel = model;
65         return this;
66     }
67
68     public SequenceGeneratorInputBuilder dependendcyModel(VnfcDependencyModel model){
69         this.dependencyModel = model;
70         return this;
71     }
72
73     public SequenceGeneratorInput build(){
74         SequenceGeneratorInput input = new SequenceGeneratorInput();
75         input.setRequestInfo(this.requestInfo);
76         input.setCapability(this.capability);
77         input.setInventoryModel(this.inventoryModel);
78         input.setDependencyModel(this.dependencyModel);
79         input.setTunableParams(this.tunableParams);
80         return input;
81     }
82
83
84
85 }