Project

General

Profile

Download (1.02 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2012 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.dataportal.elements;
10

    
11
import eu.etaxonomy.cdm.model.common.CdmBase;
12
import eu.etaxonomy.cdm.model.name.NameTypeDesignation;
13
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation;
14

    
15
/**
16
 * @author andreas
17
 * @since Jul 30, 2012
18
 *
19
 */
20
public enum TypeDesignationType {
21

    
22
    nameTypeDesignation, specimenTypeDesignation;
23

    
24
    public static TypeDesignationType valueOfCdmClass(Class<? extends CdmBase> type){
25
        if(type.equals(SpecimenTypeDesignation.class)){
26
            return TypeDesignationType.specimenTypeDesignation;
27
        }
28
        if(type.equals(NameTypeDesignation.class)){
29
            return TypeDesignationType.nameTypeDesignation;
30
        }
31
        throw new IllegalArgumentException("no enum constant matching " + type.toString());
32
    }
33

    
34
}
(18-18/18)