7e25f60351ea1c6cf4f4b10d10703ce566a18362
[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.types;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 /**
24  * Inventory information of a device, used by DCAE
25  */
26 public class InventoryInformationDcae {
27
28     private static final String UNKNOWN = "unknown";
29     private static final List<String> EMPTY = new ArrayList<>();
30     private static final InventoryInformationDcae DEFAULT = new InventoryInformationDcae();
31
32     private String type;
33     private String model;
34     private String vendor;
35     private String deviceIpv4;
36     private String deviceIpv6;
37     private List<String> interfaceUuidList;
38
39     public InventoryInformationDcae()
40     {
41         this.type=UNKNOWN;
42         this.model=UNKNOWN;
43         this.vendor=UNKNOWN;
44         this.deviceIpv4=UNKNOWN;
45         this.deviceIpv6=UNKNOWN;
46         this.interfaceUuidList=EMPTY;
47     }
48
49     public InventoryInformationDcae(InventoryInformationDcae inventoryInformation) {
50         this.type=inventoryInformation.type;
51         this.model=inventoryInformation.model;
52         this.vendor=inventoryInformation.vendor;
53         this.deviceIpv4=inventoryInformation.deviceIpv4;
54         this.deviceIpv6=inventoryInformation.deviceIpv6;
55         this.interfaceUuidList=new ArrayList<>(inventoryInformation.interfaceUuidList);
56     }
57
58     public InventoryInformationDcae(
59                 String type, String model, String vendor, String deviceIpv4,
60                 String deviceIpv6, List<String> interfaceUuidList) {
61         setType(type);
62         setModel(model);
63         setVendor(vendor);
64         setDeviceIpv4(deviceIpv4);
65         setDeviceIpv6(deviceIpv6);
66         setInterfaceUuidList(interfaceUuidList);
67     }
68
69     public String getType() {
70         return type;
71     }
72
73     public String getModel() {
74         return model;
75     }
76
77     public String getVendor() {
78         return vendor;
79     }
80
81     public String getDeviceIpv4() {
82         return deviceIpv4;
83     }
84
85     public String getDeviceIpv6() {
86         return deviceIpv6;
87     }
88
89     public List<String> getInterfaceUuidList() {
90         return interfaceUuidList;
91     }
92
93     public InventoryInformationDcae setType(String type) {
94         this.type = type != null ? type : UNKNOWN;
95         return this;
96     }
97
98     public InventoryInformationDcae setModel(String model) {
99         this.model = model != null ? model : UNKNOWN;
100         return this;
101     }
102
103     public InventoryInformationDcae setVendor(String vendor) {
104         this.vendor = vendor != null ? vendor : UNKNOWN;
105         return this;
106     }
107
108     public InventoryInformationDcae setDeviceIpv4(String deviceIpv4) {
109         this.deviceIpv4 = deviceIpv4 != null ? deviceIpv4 : UNKNOWN;
110         return this;
111     }
112
113     public InventoryInformationDcae setDeviceIpv6(String deviceIpv6) {
114         this.deviceIpv6 = deviceIpv6 != null ? deviceIpv6 : UNKNOWN ;
115         return this;
116     }
117
118     public InventoryInformationDcae setInterfaceUuidList(List<String> interfaceUuidList) {
119         this.interfaceUuidList = interfaceUuidList != null ? interfaceUuidList : EMPTY;
120         return this;
121     }
122
123     public static InventoryInformationDcae getDefault() {
124         return DEFAULT;
125     }
126
127     @Override
128     public String toString() {
129         return "InventoryInformation [type=" + type + ", model=" + model + ", vendor=" + vendor + ", deviceIpv4="
130                 + deviceIpv4 + ", deviceIpv6=" + deviceIpv6 + ", interfaceUuidList=" + interfaceUuidList + "]";
131     }
132
133 }