2 * Copyright (C) 2017 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.cdm
.api
.service
.dto
;
11 import eu
.etaxonomy
.cdm
.model
.name
.Registration
;
14 * @author a.kohlbecker
18 public enum RegistrationType
{
21 * A <code>Registration</code> for a new name
25 * A <code>Registration</code> for a new name and one or more according
28 NAME_AND_TYPIFICATION
,
30 * A <code>Registration</code> for one or more typifications for an
31 * previously published name.
35 * A newly created <code>Registration</code> without any name and
44 public static RegistrationType
from(Registration reg
) {
46 if (reg
.getName() != null && reg
.getTypeDesignations() != null && reg
.getTypeDesignations().size() > 0) {
47 return NAME_AND_TYPIFICATION
;
49 if (reg
.getName() != null) {
52 if (reg
.getTypeDesignations().size() > 0) {
61 public boolean isName() {
62 return NAME
.equals(this);
69 public boolean isTypification() {
70 return TYPIFICATION
.equals(this);
76 public boolean isNameAndTypification() {
77 return NAME_AND_TYPIFICATION
.equals(this);
83 public boolean isEnmpty() {
84 return EMPTY
.equals(this);