6066a9af18b4ca352fdbffcd2926579f00b6c6fa
[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 : APPC
4  * ================================================================================
5  * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  * ============LICENSE_END=========================================================
22  */
23
24 package org.onap.appc.seqgen.objects;
25
26 import org.onap.appc.dg.objects.InventoryModel;
27 import org.onap.appc.dg.objects.VnfcDependencyModel;
28
29 import java.util.HashMap;
30 import java.util.List;
31 import java.util.Map;
32
33 public class SequenceGeneratorInputBuilder {
34
35     private RequestInfo requestInfo;
36
37     private InventoryModel inventoryModel;
38
39     private VnfcDependencyModel dependencyModel;
40
41     private Map<String,String> tunableParams;
42
43     private CapabilityModel capabilityModel;
44     
45     public SequenceGeneratorInputBuilder requestInfo(RequestInfo requestInfo){
46         this.requestInfo = requestInfo;
47         return this;
48     }
49
50     public SequenceGeneratorInputBuilder tunableParameter(String key,String value){
51         if(this.tunableParams ==null){
52             this.tunableParams = new HashMap<>();
53         }
54         this.tunableParams.put(key,value);
55         return this;
56     }
57
58     public SequenceGeneratorInputBuilder inventoryModel(InventoryModel model){
59         this.inventoryModel = model;
60         return this;
61     }
62
63     public SequenceGeneratorInputBuilder dependendcyModel(VnfcDependencyModel model){
64         this.dependencyModel = model;
65         return this;
66     }
67
68     public SequenceGeneratorInputBuilder capabilityModel(CapabilityModel model) {
69         this.capabilityModel = model;
70         return this;
71     }
72     public SequenceGeneratorInput build(){
73         SequenceGeneratorInput input = new SequenceGeneratorInput();
74         input.setRequestInfo(this.requestInfo);
75         input.setCapabilityModel(this.capabilityModel);
76         input.setInventoryModel(this.inventoryModel);
77         input.setDependencyModel(this.dependencyModel);
78         input.setTunableParams(this.tunableParams);
79         return input;
80     }
81
82
83
84 }