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.vaadin.view.name;
|
10
|
|
11
|
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
|
12
|
import eu.etaxonomy.cdm.vaadin.model.TypedEntityReference;
|
13
|
|
14
|
public class TypeDesignationWorkingsetEditorIdSet {
|
15
|
|
16
|
Integer registrationId;
|
17
|
TypedEntityReference<IdentifiableEntity<?>> baseEntityRef;
|
18
|
Integer publicationId;
|
19
|
Integer typifiedNameId;
|
20
|
|
21
|
/**
|
22
|
* @param registrationId
|
23
|
* must be present
|
24
|
* @param workingsetId
|
25
|
* can <code>null</code>. In this case the <code>publicationId</code>
|
26
|
* and and typifiedNameId must be set.
|
27
|
* <code>RegistrationAndWorkingsetId</code> refers to a not yet
|
28
|
* existing working set, which should be created by the code in
|
29
|
* case this makes sense.
|
30
|
* @param publicationId
|
31
|
* Can <code>null</code> if the <code>workingsetId</code> is given.
|
32
|
* @param typifiedNameId
|
33
|
* Can <code>null</code> if the <code>workingsetId</code> is given
|
34
|
*/
|
35
|
protected TypeDesignationWorkingsetEditorIdSet(Integer registrationId, TypedEntityReference<IdentifiableEntity<?>> baseEntityRef, Integer publicationId, Integer typifiedNameId) {
|
36
|
this.registrationId = registrationId;
|
37
|
this.baseEntityRef = baseEntityRef;
|
38
|
this.publicationId = publicationId;
|
39
|
this.typifiedNameId = typifiedNameId;
|
40
|
if(baseEntityRef == null && publicationId == null|| baseEntityRef == null && typifiedNameId == null){
|
41
|
throw new NullPointerException("When workingsetId is null, publicationId and typifiedNameId must be non null.");
|
42
|
}
|
43
|
}
|
44
|
|
45
|
public TypeDesignationWorkingsetEditorIdSet(Integer registrationId, TypedEntityReference<IdentifiableEntity<?>> baseEntityRef) {
|
46
|
this(registrationId, baseEntityRef, null, null);
|
47
|
}
|
48
|
|
49
|
public TypeDesignationWorkingsetEditorIdSet(Integer registrationId, Integer publicationId, Integer typifiedNameId) {
|
50
|
this(registrationId, null, publicationId, typifiedNameId);
|
51
|
}
|
52
|
}
|