e4ce4afa7283ce2724171ab5292bbda60cc0e87b
[ccsdk/features.git] /
1 /*******************************************************************************
2  * ============LICENSE_START========================================================================
3  * ONAP : ccsdk feature sdnr wt
4  * =================================================================================================
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6  * =================================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14  * or implied. See the License for the specific language governing permissions and limitations under
15  * the License.
16  * ============LICENSE_END==========================================================================
17  ******************************************************************************/
18 package org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 public class InventoryInformation {
24
25     private static final String UNKNOWN = "unknown";
26     private static final List<String> EMPTY = new ArrayList<>();
27     private static final InventoryInformation DEFAULT = new InventoryInformation();
28
29     private String type;
30     private String model;
31     private String vendor;
32     private String deviceIpv4;
33     private String deviceIpv6;
34     private List<String> interfaceUuidList;
35
36     public InventoryInformation()
37     {
38         this.type=UNKNOWN;
39         this.model=UNKNOWN;
40         this.vendor=UNKNOWN;
41         this.deviceIpv4=UNKNOWN;
42         this.deviceIpv6=UNKNOWN;
43         this.interfaceUuidList=EMPTY;
44     }
45
46     public InventoryInformation(InventoryInformation inventoryInformation) {
47         this.type=inventoryInformation.type;
48         this.model=inventoryInformation.model;
49         this.vendor=inventoryInformation.vendor;
50         this.deviceIpv4=inventoryInformation.deviceIpv4;
51         this.deviceIpv6=inventoryInformation.deviceIpv6;
52         this.interfaceUuidList=new ArrayList<>(inventoryInformation.interfaceUuidList);
53     }
54
55     public InventoryInformation(
56                 String type, String model, String vendor, String deviceIpv4,
57                 String deviceIpv6, List<String> interfaceUuidList) {
58         setType(type);
59         setModel(model);
60         setVendor(vendor);
61         setDeviceIpv4(deviceIpv4);
62         setDeviceIpv6(deviceIpv6);
63         setInterfaceUuidList(interfaceUuidList);
64     }
65
66     public String getType() {
67         return type;
68     }
69
70     public String getModel() {
71         return model;
72     }
73
74     public String getVendor() {
75         return vendor;
76     }
77
78     public String getDeviceIpv4() {
79         return deviceIpv4;
80     }
81
82     public String getDeviceIpv6() {
83         return deviceIpv6;
84     }
85
86     public List<String> getInterfaceUuidList() {
87         return interfaceUuidList;
88     }
89
90     public InventoryInformation setType(String type) {
91         this.type = type != null ? type : UNKNOWN;
92         return this;
93     }
94
95     public InventoryInformation setModel(String model) {
96         this.model = model != null ? model : UNKNOWN;
97         return this;
98     }
99
100     public InventoryInformation setVendor(String vendor) {
101         this.vendor = vendor != null ? vendor : UNKNOWN;
102         return this;
103     }
104
105     public InventoryInformation setDeviceIpv4(String deviceIpv4) {
106         this.deviceIpv4 = deviceIpv4 != null ? deviceIpv4 : UNKNOWN;
107         return this;
108     }
109
110     public InventoryInformation setDeviceIpv6(String deviceIpv6) {
111         this.deviceIpv6 = deviceIpv6 != null ? deviceIpv6 : UNKNOWN ;
112         return this;
113     }
114
115     public InventoryInformation setInterfaceUuidList(List<String> interfaceUuidList) {
116         this.interfaceUuidList = interfaceUuidList != null ? interfaceUuidList : EMPTY;
117         return this;
118     }
119
120     public static InventoryInformation getDefault() {
121         return DEFAULT;
122     }
123
124     @Override
125     public String toString() {
126         return "InventoryInformation [type=" + type + ", model=" + model + ", vendor=" + vendor + ", deviceIpv4="
127                 + deviceIpv4 + ", deviceIpv6=" + deviceIpv6 + ", interfaceUuidList=" + interfaceUuidList + "]";
128     }
129
130 }