Implement E2EService activation/deactivation for NetworkSlicing
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / ServiceStateType.java
1 /**
2  * Copyright (c) 2020 Wipro Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  */
14
15 package org.onap.nbi.apis.serviceorder.model;
16
17 import com.fasterxml.jackson.annotation.JsonCreator;
18 import com.fasterxml.jackson.annotation.JsonValue;
19
20 public enum ServiceStateType {
21
22         ACTIVE("active"),
23
24         INACTIVE("inactive");
25
26         private String value;
27
28         ServiceStateType(String value) {
29         this.value = value;
30     }
31
32     @Override
33     public String toString() {
34         return String.valueOf(value);
35     }
36
37     @JsonCreator
38     public static ServiceStateType fromValue(String text) {
39         for (ServiceStateType b : ServiceStateType.values()) {
40             if (String.valueOf(b.value).equals(text)) {
41                 return b;
42             }
43         }
44         return null;
45     }
46
47     @JsonValue
48     public String value() {
49         return this.value;
50     }
51
52 }
53