* The contents of this file are subject to the Mozilla Public License Version 1.1
* See LICENSE.TXT at the top of this package for the full license terms.
*/
-
package eu.etaxonomy.taxeditor.model;
import java.util.ArrayList;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
/**
- * <p>NomenclaturalCodeHelper class.</p>
- *
* @author p.ciardelli
* @created 11.09.2009
- * @version 1.0
*/
public class NomenclaturalCodeHelper {
- /**
- * <p>getAllCodes</p>
- *
- * @return a {@link java.util.List} object.
- */
public static List<NomenclaturalCode> getAllCodes() {
return Arrays.asList(NomenclaturalCode.values());
}
-
- /**
- * <p>getSupportedCodes</p>
- *
- * @return a {@link java.util.List} object.
- */
public static List<NomenclaturalCode> getSupportedCodes() {
- List<NomenclaturalCode> supportedCodes = new ArrayList<NomenclaturalCode>();
+ List<NomenclaturalCode> supportedCodes = new ArrayList<>();
NomenclaturalCode nomenclaturalCode =PreferencesUtil.getPreferredNomenclaturalCode();
for (NomenclaturalCode code : getAllCodes()) {
if (isSupported(code)) {
return supportedCodes;
}
- /**
- * @param code
- * @return
- */
private static boolean isSupported(NomenclaturalCode code) {
if (code.equals(NomenclaturalCode.ICNAFP ) || code.equals(NomenclaturalCode.ICZN)) {
return true;
}
}
-
- /**
- * <p>getDescription</p>
- *
- * @param code a {@link eu.etaxonomy.cdm.model.name.NomenclaturalCode} object.
- * @return a {@link java.lang.String} object.
- */
public static String getDescription(NomenclaturalCode code) {
if (code.equals(NomenclaturalCode.ICNP)) {
return "International Code of Nomenclature of Bacteria (ICNP)";
return code.name();
}
- /**
- * <p>getDefaultCode</p>
- *
- * @return a {@link eu.etaxonomy.cdm.model.name.NomenclaturalCode} object.
- */
public static NomenclaturalCode getDefaultCode() {
return NomenclaturalCode.ICNAFP ;
}
-}
+}
\ No newline at end of file