Skip to contentPackage: CucConfig
CucConfig
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2017, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech
12: *******************************************************************************/
13: package org.eclipse.kapua.qa.common.cucumber;
14:
15: import java.util.Map;
16:
17: /**
18: * Data object used in Gherkin to transfer configuration data.
19: */
20: public class CucConfig {
21:
22: /** The scope ID of the configuration. */
23: private Integer scopeId;
24:
25: /** The scope ID of the parent scope. */
26: private Integer parentId;
27:
28: /** Name of type that config value has. */
29: private String type;
30:
31: /** Name of config parameter. */
32: private String name;
33:
34: /** String representation of parameter value. */
35: private String value;
36:
37: public Integer getScopeId() {
38: return scopeId;
39: }
40:
41: public void setScopeId(Integer scopeId) {
42: this.scopeId = scopeId;
43: }
44:
45: public Integer getParentId() {
46: return parentId;
47: }
48:
49: public void setParentId(Integer parentId) {
50: this.parentId = parentId;
51: }
52:
53: public String getType() {
54: return type;
55: }
56:
57: public void setType(String type) {
58: this.type = type;
59: }
60:
61: public String getName() {
62: return name;
63: }
64:
65: public void setName(String name) {
66: this.name = name;
67: }
68:
69: public String getValue() {
70: return value;
71: }
72:
73: public void setValue(String value) {
74: this.value = value;
75: }
76:
77: /**
78: * Adds this config parameter to specified map.
79: *
80: * @param valueMap
81: * map to add parameter to
82: */
83: public void addConfigToMap(Map<String, Object> valueMap) {
84:
85:• switch (type) {
86: case "integer":
87: valueMap.put(name, Integer.valueOf(value));
88: break;
89: case "string":
90: valueMap.put(name, value);
91: break;
92: case "boolean":
93: valueMap.put(name, Boolean.valueOf(value));
94: break;
95: }
96: }
97: }