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;
| }
| }
|
|