Project

General

Profile

Download (3.08 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2018 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.cdm.persistence.dto;
10

    
11
import java.util.UUID;
12

    
13
import eu.etaxonomy.cdm.model.name.Rank;
14

    
15
public class TaxonNameParts {
16

    
17
    protected Integer taxonNameId;
18

    
19
    protected UUID taxonNameUuid;
20

    
21
    protected Rank rank;
22

    
23
    protected String genusOrUninomial;
24

    
25
    protected String infraGenericEpithet;
26

    
27
    protected String specificEpithet;
28

    
29
    protected String infraSpecificEpithet;
30

    
31
//************ CONSTRUCTOR ***********************/
32

    
33
    public TaxonNameParts() {
34
    }
35

    
36
    public TaxonNameParts(Integer taxonNameId, UUID taxonNameUuid, Rank rank, String genusOrUninomial, String infraGenericEpithet,
37
            String specificEpithet, String infraSpecificEpithet) {
38
        super();
39
        this.taxonNameId = taxonNameId;
40
        this.taxonNameUuid = taxonNameUuid;
41
        this.rank = rank;
42
        this.genusOrUninomial = genusOrUninomial;
43
        this.infraGenericEpithet = infraGenericEpithet;
44
        this.specificEpithet = specificEpithet;
45
        this.infraSpecificEpithet = infraSpecificEpithet;
46
    }
47

    
48
//***************** GETTER / SETTER ********************************/
49

    
50
    public UUID getTaxonNameUuid() {
51
        return taxonNameUuid;
52
    }
53

    
54
    public Integer getTaxonNameId() {
55
        return taxonNameId;
56
    }
57
    public void setTaxonNameId(Integer taxonNameId) {
58
        this.taxonNameId = taxonNameId;
59
    }
60

    
61
    public Rank getRank() {
62
        return rank;
63
    }
64
    public void setRank(Rank rank) {
65
        this.rank = rank;
66
    }
67

    
68
    public String getGenusOrUninomial() {
69
        return genusOrUninomial;
70
    }
71
    public void setGenusOrUninomial(String genusOrUninomial) {
72
        this.genusOrUninomial = genusOrUninomial;
73
    }
74

    
75
    public String getInfraGenericEpithet() {
76
        return infraGenericEpithet;
77
    }
78
    public void setInfraGenericEpithet(String infraGenericEpithet) {
79
        this.infraGenericEpithet = infraGenericEpithet;
80
    }
81

    
82
    public String getSpecificEpithet() {
83
        return specificEpithet;
84
    }
85
    public void setSpecificEpithet(String specificEpithet) {
86
        this.specificEpithet = specificEpithet;
87
    }
88

    
89
    public String getInfraSpecificEpithet() {
90
        return infraSpecificEpithet;
91
    }
92
    public void setInfraSpecificEpithet(String infraSpecificEpithet) {
93
        this.infraSpecificEpithet = infraSpecificEpithet;
94
    }
95

    
96
// ******************* METHODS *************************************/
97

    
98
    public String rankSpecificNamePart() {
99
        if(rank.isGenus() || rank.isSupraGeneric()){
100
            return getGenusOrUninomial();
101
        }
102
        if(rank.isInfraGeneric()){
103
            return getInfraGenericEpithet();
104
        }
105
        if(rank.isSpecies()){
106
            return getSpecificEpithet();
107
        }
108
        if(rank.isInfraSpecific()){
109
            return getInfraSpecificEpithet();
110
        }
111
        return "-- ERROR: INVALID OR UNSUPPORTED RANK (" + rank.getLabel() + ") --";
112
    }
113
}
(19-19/30)