Skip to content

Package: KuraInventoryContainers

KuraInventoryContainers

nameinstructionbranchcomplexitylinemethod
KuraInventoryContainers()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
addInventoryContainer(KuraInventoryContainer)
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%
getInventoryContainers()
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%
setInventoryContainers(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) 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.call.kura.model.inventory.containers;
14:
15: import com.fasterxml.jackson.annotation.JsonProperty;
16: import com.fasterxml.jackson.annotation.JsonRootName;
17: import org.checkerframework.checker.nullness.qual.Nullable;
18:
19: import javax.validation.constraints.NotNull;
20: import java.util.ArrayList;
21: import java.util.List;
22:
23: /**
24: * {@link KuraInventoryContainers} definition.
25: *
26: * @since 2.0.0
27: */
28: @JsonRootName("inventoryContainer")
29: public class KuraInventoryContainers {
30:
31: @JsonProperty("containers")
32: public List<KuraInventoryContainer> inventoryContainers;
33:
34: /**
35: * Gets the {@link KuraInventoryContainer}s {@link List}.
36: *
37: * @return The {@link KuraInventoryContainer}s {@link List}.
38: * @since 2.0.0
39: */
40: public List<KuraInventoryContainer> getInventoryContainers() {
41:• if (inventoryContainers == null) {
42: inventoryContainers = new ArrayList<>();
43: }
44:
45: return inventoryContainers;
46: }
47:
48: /**
49: * Adds a {@link KuraInventoryContainer} to the {@link List}
50: *
51: * @param inventoryContainer The {@link KuraInventoryContainer} to add.
52: * @since 2.0.0
53: */
54: public void addInventoryContainer(@NotNull KuraInventoryContainer inventoryContainer) {
55: getInventoryContainers().add(inventoryContainer);
56: }
57:
58: /**
59: * Sets the {@link KuraInventoryContainer}s {@link List}.
60: *
61: * @param inventoryContainers The {@link KuraInventoryContainer}s {@link List}.
62: * @since 2.0.0
63: */
64: public void setInventoryContainers(@Nullable List<KuraInventoryContainer> inventoryContainers) {
65: this.inventoryContainers = inventoryContainers;
66: }
67:
68: }