c56828a80273cb0e8a588fccc243aa6c9389417e
[ccsdk/sli/adaptors.git] / netbox-client / provider / src / main / java / org / onap / ccsdk / sli / adaptors / netbox / model / Status.java
1 /*
2  * Copyright (C) 2018 Bell Canada.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.ccsdk.sli.adaptors.netbox.model;
17
18 import com.google.gson.JsonElement;
19 import com.google.gson.JsonPrimitive;
20 import com.google.gson.annotations.SerializedName;
21
22 public class Status {
23
24     private Integer value;
25     private String label;
26
27     public Integer getValue() {
28         return value;
29     }
30
31     public void setValue(final Integer value) {
32         this.value = value;
33     }
34
35     public String getLabel() {
36         return label;
37     }
38
39     public void setLabel(final String label) {
40         this.label = label;
41     }
42
43     public JsonElement toJson() {
44         return new JsonPrimitive(value);
45     }
46
47     public enum Values {
48         @SerializedName("1")
49         ACTIVE(1, "Active"),
50         @SerializedName("2")
51         RESERVED(2, "Reserved");
52
53         private final int value;
54         private final String label;
55
56         Values(final int value, final String label) {
57             this.value = value;
58             this.label = label;
59         }
60
61         public int getValue() {
62             return value;
63         }
64
65         public String getLabel() {
66             return label;
67         }
68
69         public Status getStatus() {
70             final Status status = new Status();
71             status.setValue(value);
72             status.setLabel(label);
73             return status;
74         }
75
76     }
77 }