Added oparent to sdc main
[sdc.git] / test-apis-ci / src / test / java / org / openecomp / sdc / cucumber / utils / RunnerSession.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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.openecomp.sdc.cucumber.utils;
22
23 import java.util.HashMap;
24 import java.util.Map;
25
26 /**
27  * Store Data here that is relevant for the whole runner and not just a single scenario.
28  * @author ms172g
29  *
30  */
31 public class RunnerSession {
32         private static final RunnerSession instance = new RunnerSession();
33         private Map<String, String> stringElements;
34         private Map<String, Integer> intElements;
35         private Map<String, Object> elements;
36         private RunnerSession(){
37                 stringElements = new HashMap<>();
38                 intElements = new HashMap<>();
39                 elements = new HashMap<>();
40         }
41         public static RunnerSession getSession(){
42                 return instance;
43         }
44
45         public void putInSession(String key, String value){
46                 stringElements.put(key, value);
47         }
48         
49         public String getString(String key){
50                 return stringElements.get(key);
51                 
52         }
53         
54         public void putInSession(String key, Integer value){
55                 intElements.put(key, value);
56         }
57         
58         
59         public Integer getInt(String key){
60                 return intElements.get(key);
61         }
62         
63         public void putInSession(String key, Object value) {
64                 elements.put(key, value);
65                 
66         }
67         
68         public Object get(String key){
69                 return elements.get(key);
70         }
71         
72         public void clean(){
73                 intElements.clear();
74                 stringElements.clear();
75         }
76         
77         
78         
79         
80         
81 }