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