保誠-保戶業務員媒合平台
wayne
2022-01-22 e2fd08cfedded28d1679a4e3bcb4213e965be756
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.pollex.pam.enums;
 
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
 
public enum GenderEnum {
 
    @JsonProperty("male")
    MALE,
 
    @JsonProperty("female")
    FEMALE;
 
    @JsonCreator
    public static GenderEnum forName(String name) {
        for(GenderEnum c: values()) {
            if(c.name().equals(name.toUpperCase())) {
                return c;
            }
        }
 
        return null;
    }
}