Package: DeviceInventoryPackagesImpl
DeviceInventoryPackagesImpl
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DeviceInventoryPackagesImpl() |
|
|
|
|
|
||||||||||||||||||||
addPackage(DeviceInventoryPackage) |
|
|
|
|
|
||||||||||||||||||||
getPackages() |
|
|
|
|
|
||||||||||||||||||||
setPackages(List) |
|
|
|
|
|
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2021, 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.device.management.inventory.model.packages.internal;
14:
15: import org.eclipse.kapua.service.device.management.inventory.model.packages.DeviceInventoryPackage;
16: import org.eclipse.kapua.service.device.management.inventory.model.packages.DeviceInventoryPackages;
17: import org.eclipse.kapua.service.device.management.inventory.model.system.DeviceInventorySystemPackages;
18:
19: import java.util.ArrayList;
20: import java.util.List;
21:
22: /**
23: * {@link DeviceInventorySystemPackages} implementation.
24: *
25: * @since 1.5.0
26: */
27: public class DeviceInventoryPackagesImpl implements DeviceInventoryPackages {
28:
29: private static final long serialVersionUID = -8272540683907649241L;
30:
31: private List<DeviceInventoryPackage> packages;
32:
33: @Override
34: public List<DeviceInventoryPackage> getPackages() {
35:• if (packages == null) {
36: packages = new ArrayList<>();
37: }
38:
39: return packages;
40: }
41:
42: @Override
43: public void addPackage(DeviceInventoryPackage aPackage) {
44: getPackages().add(aPackage);
45: }
46:
47: @Override
48: public void setPackages(List<DeviceInventoryPackage> packages) {
49: this.packages = packages;
50: }
51: }