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
package com.megatim.fdxcommons.model.enumeration;
 
import com.fasterxml.jackson.annotation.JsonValue;
import com.megatim.fdxcommons.model.search.EnumValue;
 
/**
 *
 * @author ASUS
 */
public enum FonctionAggregation {
 
    MAX("MAXIMUM"),
    MIN("MINIMUM"),
    SUM("SOMME"),
    COUNT("COMPTE"),
    AVG("MOYENNE");
 
    private final String value;
 
    private FonctionAggregation(String value) {
        this.value = value;
    }
 
    @JsonValue
    public String getValue() {
        return value;
    }
 
    @EnumValue
    public static FonctionAggregation fromValeur(String value) {
        
        if (value.equalsIgnoreCase("MAXIMUM")) {
            return FonctionAggregation.MAX;
        } else if (value.equalsIgnoreCase("MINIMUM")) {
            return FonctionAggregation.MIN;
        } else if (value.equalsIgnoreCase("SOMME")) {
            return FonctionAggregation.SUM;
        } else if (value.equalsIgnoreCase("COMPTE")) {
            return FonctionAggregation.COUNT;
        } else if (value.equalsIgnoreCase("MOYENNE")) {
            return FonctionAggregation.AVG;
        } else {
            return null;
        }
        
    }
}