Skip to content

Package: ServiceXmlConfigPropertyAdapted$ConfigPropertyType

ServiceXmlConfigPropertyAdapted$ConfigPropertyType

nameinstructionbranchcomplexitylinemethod
static {...}
M: 94 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 10 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2019, 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 - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.config;
14:
15: import javax.xml.bind.annotation.XmlAccessType;
16: import javax.xml.bind.annotation.XmlAccessorType;
17: import javax.xml.bind.annotation.XmlAttribute;
18: import javax.xml.bind.annotation.XmlElement;
19: import javax.xml.bind.annotation.XmlEnum;
20: import javax.xml.bind.annotation.XmlEnumValue;
21:
22: /**
23: * Represents a typed property.
24: * Various flags help in the interpretation and semantics of the property value.
25: * For example, a property value might be an array or the property value might have been encrypted.
26: *
27: * @since 1.0
28: */
29: @XmlAccessorType(XmlAccessType.FIELD)
30: public class ServiceXmlConfigPropertyAdapted {
31:
32: @XmlEnum
33: public enum ConfigPropertyType {
34: @XmlEnumValue("String")stringType,
35: @XmlEnumValue("Long")longType,
36: @XmlEnumValue("Double")doubleType,
37: @XmlEnumValue("Float")floatType,
38: @XmlEnumValue("Integer")integerType,
39: @XmlEnumValue("Byte")byteType,
40: @XmlEnumValue("Char")charType,
41: @XmlEnumValue("Boolean")booleanType,
42: @XmlEnumValue("Short")shortType,
43: // @XmlEnumValue("Password")passwordType
44: }
45:
46: /**
47: * The name of the property.
48: */
49: @XmlAttribute(name = "name")
50: private String name;
51:
52: /**
53: * Whether the property value is an array.
54: */
55: @XmlAttribute(name = "array")
56: private boolean array;
57:
58: /**
59: * Whether the property value is encrypted.
60: */
61: @XmlAttribute(name = "encrypted")
62: private boolean encrypted;
63:
64: /**
65: * The property type.
66: */
67: @XmlAttribute(name = "type")
68: private ConfigPropertyType type;
69:
70: /**
71: * The property value(s).
72: */
73: @XmlElement(name = "value")
74: private String[] values;
75:
76: public ServiceXmlConfigPropertyAdapted() {
77: }
78:
79: public ServiceXmlConfigPropertyAdapted(String name,
80: ConfigPropertyType type,
81: String[] values) {
82: super();
83:
84: this.type = type;
85: this.values = values;
86: this.encrypted = false;
87: }
88:
89: public String getName() {
90: return name;
91: }
92:
93: public void setName(String name) {
94: this.name = name;
95: }
96:
97: public boolean getArray() {
98: return array;
99: }
100:
101: public void setArray(boolean array) {
102: this.array = array;
103: }
104:
105: public ConfigPropertyType getType() {
106: return type;
107: }
108:
109: public void setType(ConfigPropertyType type) {
110: this.type = type;
111: }
112:
113: public boolean isEncrypted() {
114: return encrypted;
115: }
116:
117: public void setEncrypted(boolean encrypted) {
118: this.encrypted = encrypted;
119: }
120:
121: public String[] getValues() {
122: return values;
123: }
124:
125: public void setValues(String[] values) {
126: this.values = values;
127: }
128: }