Project

General

Profile

Download (4.1 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 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.mock;
10

    
11
import java.util.HashSet;
12
import java.util.Set;
13

    
14
import org.joda.time.DateTime;
15

    
16
import eu.etaxonomy.cdm.model.agent.Institution;
17
import eu.etaxonomy.cdm.model.common.CdmBase;
18
import eu.etaxonomy.cdm.model.common.User;
19
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
20
import eu.etaxonomy.cdm.model.name.TypeDesignationBase;
21

    
22
/**
23
 * @author a.kohlbecker
24
 * @since Mar 10, 2017
25
 *
26
 */
27
public class Registration extends CdmBase {
28

    
29
    private static final long serialVersionUID = -7214477130043178680L;
30

    
31
    private String identifier;
32

    
33
    private String specificIdentifier;   //id without http-domain
34

    
35
    private DateTime registrationDate;
36

    
37
    private RegistrationStatus status;
38

    
39
    private Institution institution;
40

    
41
    private TaxonNameBase name;
42

    
43
    private Set<TypeDesignationBase> typeDesignations = new HashSet<>();
44

    
45
    private Set<Registration> blockedBy = new HashSet<>();
46

    
47
    private User submitter;
48

    
49
    static int idAutoincrement = 100000;
50

    
51

    
52
    /**
53
     * @param name
54
     */
55
    public Registration() {
56
        super();
57
        status = RegistrationStatus.values()[(int) (Math.random() * RegistrationStatus.values().length)];
58
        specificIdentifier = Integer.toString(idAutoincrement++);
59
        identifier = "http://pyhcobank.org/" + specificIdentifier;
60
        registrationDate = DateTime.now();
61
    }
62

    
63
    /**
64
     * @return the identifier
65
     */
66
    public String getIdentifier() {
67
        return identifier;
68
    }
69

    
70
    /**
71
     * @param identifier the identifier to set
72
     */
73
    public void setIdentifier(String identifier) {
74
        this.identifier = identifier;
75
    }
76

    
77
    /**
78
     * @return the specificIdentifier
79
     */
80
    public String getSpecificIdentifier() {
81
        return specificIdentifier;
82
    }
83

    
84
    /**
85
     * @param specificIdentifier the specificIdentifier to set
86
     */
87
    public void setSpecificIdentifier(String specificIdentifier) {
88
        this.specificIdentifier = specificIdentifier;
89
    }
90

    
91
    /**
92
     * @return the registrationDate
93
     */
94
    public org.joda.time.DateTime getRegistrationDate() {
95
        return registrationDate;
96
    }
97

    
98
    /**
99
     * @param registrationDate the registrationDate to set
100
     */
101
    public void setRegistrationDate(org.joda.time.DateTime registrationDate) {
102
        this.registrationDate = registrationDate;
103
    }
104

    
105
    /**
106
     * @return the status
107
     */
108
    public RegistrationStatus getStatus() {
109
        return status;
110
    }
111

    
112
    /**
113
     * @param status the status to set
114
     */
115
    public void setStatus(RegistrationStatus status) {
116
        this.status = status;
117
    }
118

    
119
    /**
120
     * @return the institution
121
     */
122
    public Institution getInstitution() {
123
        return institution;
124
    }
125

    
126
    /**
127
     * @param institution the institution to set
128
     */
129
    public void setInstitution(Institution institution) {
130
        this.institution = institution;
131
    }
132

    
133
    /**
134
     * @return the name
135
     */
136
    public TaxonNameBase getName() {
137
        return name;
138
    }
139

    
140
    /**
141
     * @param name the name to set
142
     */
143
    public void setName(TaxonNameBase name) {
144
        this.name = name;
145
    }
146

    
147
    /**
148
     * @return the submitter
149
     */
150
    public User getSubmitter() {
151
        return submitter;
152
    }
153

    
154
    /**
155
     * @param submitter the submitter to set
156
     */
157
    public void setSubmitter(User submitter) {
158
        this.submitter = submitter;
159
    }
160

    
161
    public boolean addTypeDesignationBase(TypeDesignationBase typeDesignationBase){
162
        return typeDesignations.add(typeDesignationBase);
163
    }
164

    
165
    public boolean addBlockedBy(Registration registration){
166
        return blockedBy.add(registration);
167
    }
168

    
169
    /**
170
     * @return the typeDesignations
171
     */
172
    public Set<TypeDesignationBase> getTypeDesignations() {
173
        return typeDesignations;
174
    }
175

    
176
    /**
177
     * @return the blockedBy
178
     */
179
    public Set<Registration> getBlockedBy() {
180
        return blockedBy;
181
    }
182

    
183

    
184

    
185

    
186

    
187

    
188
}
(1-1/3)