This repository has been archived on 2024-05-07. You can view files and clone it, but cannot push or open issues or pull requests.
species-discovery/src/main/java/org/gcube/portlets/user/speciesdiscovery/shared/MainTaxonomicRankEnum.java

54 lines
955 B
Java

/**
*
*/
package org.gcube.portlets.user.speciesdiscovery.shared;
import java.util.ArrayList;
import java.util.List;
/**
* @author "Federico De Faveri defaveri@isti.cnr.it"
*
*/
public enum MainTaxonomicRankEnum {
KINGDOM("kingdom"),
PHYLUM("phylum"),
CLASS("class"),
ORDER("order"),
FAMILY("family"),
GENUS("genus"),
SPECIES("species");
protected String label;
MainTaxonomicRankEnum(String label)
{
this.label = label;
}
/**
* @return the label
*/
public String getLabel() {
return label;
}
public static List<String> getListLabels(){
List<String> listLabels = new ArrayList<String>();
for (MainTaxonomicRankEnum item : MainTaxonomicRankEnum.values())
listLabels.add(item.getLabel());
return listLabels;
}
public static MainTaxonomicRankEnum valueOfLabel(String label)
{
for (MainTaxonomicRankEnum value:values()) if (value.getLabel().equals(label)) return value;
return null;
}
}