Skip to content

Package: DeviceConfigurationImpl

DeviceConfigurationImpl

nameinstructionbranchcomplexitylinemethod
DeviceConfigurationImpl()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
addComponentConfiguration(DeviceComponentConfiguration)
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getComponentConfigurations()
M: 11 C: 0
0%
M: 2 C: 0
0%
M: 2 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
setComponentConfigurations(List)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 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: * Red Hat Inc
13: *******************************************************************************/
14: package org.eclipse.kapua.service.device.management.configuration.internal;
15:
16: import org.eclipse.kapua.service.device.management.configuration.DeviceComponentConfiguration;
17: import org.eclipse.kapua.service.device.management.configuration.DeviceConfiguration;
18:
19: import java.util.ArrayList;
20: import java.util.List;
21:
22: /**
23: * {@link DeviceConfiguration} implementation.
24: *
25: * @since 1.0.0
26: */
27: public class DeviceConfigurationImpl implements DeviceConfiguration {
28:
29: private static final long serialVersionUID = -2167999497954676423L;
30:
31: private List<DeviceComponentConfiguration> configurations;
32:
33: /**
34: * Constructor.
35: *
36: * @since 1.0.0
37: */
38: public DeviceConfigurationImpl() {
39: }
40:
41: @Override
42: public List<DeviceComponentConfiguration> getComponentConfigurations() {
43:• if (configurations == null) {
44: configurations = new ArrayList<>();
45: }
46:
47: return configurations;
48: }
49:
50: @Override
51: public void addComponentConfiguration(DeviceComponentConfiguration componentConfiguration) {
52: getComponentConfigurations().add(componentConfiguration);
53: }
54:
55: @Override
56: public void setComponentConfigurations(List<DeviceComponentConfiguration> componentConfigurations) {
57: this.configurations = componentConfigurations;
58: }
59: }