Kenmegne
7 days ago 23a46b4be35277e06ec89f48730eeb694e686be8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.megatim.fdxcommons.model.enumeration;
 
import com.fasterxml.jackson.annotation.JsonValue;
import com.megatim.fdxcommons.model.search.EnumValue;
 
public enum TypeOperation {
 
    AJOUTER("ajouter"),
    SUPPRIMER("supprimer"),
    MODIFIER("modifier"),
    CONSULTER("consulter");
 
    private final String name;
 
    private TypeOperation(String name) {
        this.name = name;
    }
 
    @Override
    public String toString() {
        return name;
    }
 
    @JsonValue
    public String getName() {
        return name;
    }
 
    @EnumValue
    public static TypeOperation fromValeur(String value) {
        if (value == null) {
            return null;
        }
        if (value.equalsIgnoreCase("ajouter")) {
            return TypeOperation.AJOUTER;
        } else if (value.equalsIgnoreCase("supprimer")) {
            return TypeOperation.SUPPRIMER;
        } else if (value.equalsIgnoreCase("modifier")) {
            return TypeOperation.MODIFIER;
        } else if (value.equalsIgnoreCase("consulter")) {
            return TypeOperation.CONSULTER;
        } else {
            return null;
 
        }
    }
 
}