Fix for prevent tool reported defects.
[platform/upstream/iotivity.git] / service / simulator / java / sdk / src / org / oic / simulator / clientcontroller / SimulatorVerificationType.java
1 /*
2  * Copyright 2015 Samsung Electronics All Rights Reserved.
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 package org.oic.simulator.clientcontroller;
18
19 /**
20  * Types of automatic verification.
21  */
22 public enum SimulatorVerificationType {
23     RQ_TYPE_GET(0), RQ_TYPE_PUT(1), RQ_TYPE_POST(2), RQ_TYPE_DELETE(3);
24
25     private int value;
26
27     private SimulatorVerificationType(int value) {
28         this.value = value;
29     }
30
31     public int getValue() {
32         return this.value;
33     }
34
35     /**
36      * Method to get the {@link SimulatorVerificationType} from an integer
37      * value.
38      *
39      * @param value
40      *            Integral value of {@link SimulatorVerificationType}.
41      * @return {@link SimulatorVerificationType} corresponding to the given
42      *         value.
43      */
44     public static SimulatorVerificationType getVerificationType(int value) {
45         SimulatorVerificationType result = null;
46         SimulatorVerificationType[] types = SimulatorVerificationType.values();
47         for (SimulatorVerificationType type : types) {
48             if (type.getValue() == value) {
49                 result = type;
50                 break;
51             }
52         }
53         return result;
54     }
55 }