Project

General

Profile

« Previous | Next » 

Revision b0fdf0ab

Added by Andreas Kohlbecker about 7 years ago

ref #6169 mock service for registrations

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/presenter/phycobank/RegistrationType.java
8 8
*/
9 9
package eu.etaxonomy.cdm.vaadin.presenter.phycobank;
10 10

  
11
import eu.etaxonomy.cdm.mock.Registration;
12

  
11 13
/**
12 14
 * @author a.kohlbecker
13 15
 * @since Mar 3, 2017
......
15 17
 */
16 18
public enum RegistrationType {
17 19

  
18
    name, typification;
20
    name, typification, invalid;
21

  
22
    /**
23
     * @param reg
24
     * @return
25
     */
26
    public static RegistrationType from(Registration reg) {
27
        if(reg.getName() != null){
28
            return name;
29
        }
30
        if(reg.getTypeDesignations().size() > 0){
31
            return typification;
32
        }
33
        return invalid;
34
    }
35

  
36
    /**
37
     * @return
38
     */
39
    public boolean isName() {
40
        return name.equals(this);
41

  
42
  }
43
    /**
44
     * @return
45
     */
46
    public boolean isTypification() {
47
        return typification.equals(this);
48
    }
19 49

  
20 50
}

Also available in: Unified diff