170234769a21e858965d7390754ad27599bdd4cf
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / hub / model / EventType.java
1 /**
2  *     Copyright (c) 2018 Orange
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.nbi.apis.hub.model;
17
18 import com.fasterxml.jackson.annotation.JsonCreator;
19 import com.fasterxml.jackson.annotation.JsonValue;
20
21 public enum EventType {
22
23     SERVICE_ORDER_CREATION("ServiceOrderCreationNotification"),
24
25     SERVICE_ORDER_STATE_CHANGE("ServiceOrderStateChangeNotification"),
26
27     SERVICE_ORDER_ITEM_STATE_CHANGE("ServiceOrderItemStateChangeNotification");
28
29     private String value;
30
31     EventType(String value) {
32         this.value = value;
33     }
34
35     @Override
36     public String toString() {
37         return String.valueOf(value);
38     }
39
40     @JsonCreator
41     public static EventType fromValue(String text) {
42         for (EventType b : EventType.values()) {
43             if (String.valueOf(b.value).equals(text)) {
44                 return b;
45             }
46         }
47         return null;
48     }
49
50     @JsonValue
51     public String value() {
52         return this.value;
53     }
54
55 }