9f51eacada919620abf4f16ce5e66e5e1c928488
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / StateType.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 /*
17  * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
18  * open API16.5 + applied TMF guideline 3.0
19  *
20  * OpenAPI spec version: 0.1.1_inProgress
21  * 
22  *
23  * NOTE: This class is auto generated by the swagger code generator program.
24  * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
25  *
26  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
27  * in compliance with the License. You may obtain a copy of the License at
28  *
29  * http://www.apache.org/licenses/LICENSE-2.0
30  *
31  * Unless required by applicable law or agreed to in writing, software distributed under the License
32  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
33  * or implied. See the License for the specific language governing permissions and limitations under
34  * the License.
35  */
36
37
38 package org.onap.nbi.apis.serviceorder.model;
39
40
41 import com.fasterxml.jackson.annotation.JsonCreator;
42 import com.fasterxml.jackson.annotation.JsonValue;
43 import java.util.ArrayList;
44 import java.util.List;
45
46 /**
47  *
48  */
49 public enum StateType {
50
51     ACKNOWLEDGED("acknowledged"),
52
53     REJECTED("rejected"),
54
55     PENDING("pending"),
56
57     HELD("held"),
58
59     INPROGRESS("inProgress"),
60
61     CANCELLED("cancelled"),
62
63     COMPLETED("completed"),
64
65     FAILED("failed"),
66
67     PARTIAL("partial"),
68
69     INPROGRESS_TASK_CREATED("inProgressTaskCreated"),
70
71     INPROGRESS_MODIFY_REQUEST_DELETE_SEND("inProgressModifyRequestDeleteSend"),
72
73     INPROGRESS_MODIFY_ITEM_TO_CREATE("inProgressModifyItemToCreate"),
74
75     INPROGRESS_MODIFY_REQUEST_CREATE_SEND("inProgressModifyRequestCreateSend");
76
77
78     private String value;
79
80     StateType(String value) {
81         this.value = value;
82     }
83
84     @Override
85     public String toString() {
86         return String.valueOf(value);
87     }
88
89     @JsonCreator
90     public static StateType fromValue(String text) {
91         for (StateType b : StateType.values()) {
92             if (String.valueOf(b.value).equals(text)) {
93                 return b;
94             }
95         }
96         return null;
97     }
98
99     public static List<StateType> fromValueSearch(String text){
100         List<StateType> values = new ArrayList<>();
101         for (StateType b : StateType.values()) {
102             if (String.valueOf(b.value).equals(text)) {
103                 if(b.equals(StateType.INPROGRESS)) {
104                     values.add(INPROGRESS_TASK_CREATED);
105                     values.add(INPROGRESS_MODIFY_REQUEST_DELETE_SEND);
106                     values.add(INPROGRESS_MODIFY_ITEM_TO_CREATE);
107                     values.add(INPROGRESS_MODIFY_REQUEST_CREATE_SEND);
108                 }
109                 values.add(b);
110             }
111         }
112         return values;
113     }
114
115     @JsonValue
116     public String value()
117     {
118         if("inProgressModifyRequestDeleteSend".equalsIgnoreCase(this.value) || "inProgressModifyItemToCreate".equalsIgnoreCase(this.value)
119             || "inProgressTaskCreated".equalsIgnoreCase(this.value)
120             || "inProgressModifyRequestCreateSend".equalsIgnoreCase(this.value)) {
121             return INPROGRESS.value;
122         }
123         return this.value;
124     }
125
126 }
127