2016-10-07 18:23:23 +02:00
|
|
|
package org.gcube.data_catalogue.grsf_publish_ws.utils.groups;
|
|
|
|
|
2016-10-08 22:16:08 +02:00
|
|
|
import com.fasterxml.jackson.annotation.JsonCreator;
|
|
|
|
|
2016-10-07 18:23:23 +02:00
|
|
|
/**
|
|
|
|
* Exploitation_Rate for Stock records
|
|
|
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
|
|
|
*/
|
|
|
|
public enum Exploitation_Rate {
|
|
|
|
|
2016-12-08 18:32:44 +01:00
|
|
|
Not_Applicable("Not applicable"),
|
2016-10-07 18:23:23 +02:00
|
|
|
Moderate_Fishing_Mortality("Moderate fishing mortality"),
|
|
|
|
High_Fishing_Mortality("High fishing mortality"),
|
2016-12-08 18:32:44 +01:00
|
|
|
No_Or_Low_Fishing_Mortality("No or low fishing mortality"),
|
|
|
|
Uncertain_Not_assessed("Uncertain/Not assessed");
|
2016-10-07 18:23:23 +02:00
|
|
|
|
|
|
|
private String subGroupNameOrig;
|
|
|
|
|
|
|
|
private Exploitation_Rate(String origName) {
|
|
|
|
this.subGroupNameOrig = origName;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the original name
|
|
|
|
* @return
|
|
|
|
*/
|
|
|
|
public String getOrigName(){
|
|
|
|
return subGroupNameOrig;
|
|
|
|
}
|
2016-10-08 22:16:08 +02:00
|
|
|
|
|
|
|
@JsonCreator
|
|
|
|
public static Exploitation_Rate onDeserialize(String exploitationString) {
|
|
|
|
if(exploitationString != null) {
|
|
|
|
for (Exploitation_Rate exploitationValue : Exploitation_Rate.values()) {
|
2017-07-28 14:48:46 +02:00
|
|
|
if(exploitationValue.getOrigName().replaceAll("[^A-Za-z]", " ").equalsIgnoreCase(exploitationString.trim().replaceAll("[^A-Za-z]", " ")))
|
2016-10-08 22:16:08 +02:00
|
|
|
return exploitationValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
}
|
2016-10-08 23:10:25 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return getOrigName();
|
|
|
|
}
|
2016-10-07 18:23:23 +02:00
|
|
|
}
|