Revision 3fb08830
Added by Andreas Müller almost 2 years ago
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/name/TypeDesignationWorkingSet.java | ||
---|---|---|
17 | 17 |
|
18 | 18 |
import eu.etaxonomy.cdm.compare.name.NullTypeDesignationStatus; |
19 | 19 |
import eu.etaxonomy.cdm.model.common.VersionableEntity; |
20 |
import eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation; |
|
21 | 20 |
import eu.etaxonomy.cdm.model.name.TypeDesignationStatusBase; |
22 |
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit; |
|
23 |
import eu.etaxonomy.cdm.model.occurrence.FieldUnit; |
|
24 | 21 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
25 |
import eu.etaxonomy.cdm.ref.TypedEntityReference; |
|
26 | 22 |
|
27 | 23 |
/** |
28 | 24 |
* TypeDesignations which refer to the same FieldUnit (SpecimenTypeDesignation) or TaxonName |
... | ... | |
43 | 39 |
|
44 | 40 |
private String label = null; |
45 | 41 |
|
46 |
//maybe removed in future as redundant with baseEntity |
|
47 |
private TypedEntityReference<? extends VersionableEntity> baseEntityReference; |
|
42 |
private VersionableEntity baseEntity; |
|
48 | 43 |
|
49 | 44 |
private LinkedHashMap<TypeDesignationStatusBase<?>,Collection<TypeDesignationDTO>> designationByStatusMap = new LinkedHashMap<>(); |
50 | 45 |
|
51 |
private VersionableEntity baseEntity; |
|
52 | 46 |
|
53 | 47 |
public enum TypeDesignationWorkingSetType { |
54 | 48 |
SPECIMEN_TYPE_DESIGNATION_WORKINGSET, |
... | ... | |
61 | 55 |
|
62 | 56 |
public TypeDesignationWorkingSet(VersionableEntity baseEntity) { |
63 | 57 |
this.baseEntity = baseEntity; |
64 |
this.baseEntityReference = TypeDesignationSetManager.makeEntityReference(baseEntity); |
|
65 |
} |
|
66 |
|
|
67 |
public TypeDesignationWorkingSet(VersionableEntity baseEntity, TypedEntityReference<? extends VersionableEntity> baseEntityRef) { |
|
68 |
this.baseEntity = baseEntity; |
|
69 |
this.baseEntityReference = baseEntityRef; |
|
70 | 58 |
} |
71 | 59 |
|
72 | 60 |
// ***********************************************************************/ |
... | ... | |
117 | 105 |
this.label = representation; |
118 | 106 |
} |
119 | 107 |
|
120 |
/** |
|
121 |
* A reference to the entity which is the common base entity for all TypeDesignations in this workingset. |
|
122 |
* For a {@link SpecimenTypeDesignation} this is usually the {@link FieldUnit} if it is present. Otherwise it can also be |
|
123 |
* a {@link DerivedUnit} or something else depending on the specific use case. |
|
124 |
* |
|
125 |
* @return the baseEntityReference |
|
126 |
*/ |
|
127 |
public TypedEntityReference<? extends VersionableEntity> getBaseEntityReference() { |
|
128 |
return baseEntityReference; |
|
129 |
} |
|
108 |
//TODO if not needed anymore |
|
109 |
// /** |
|
110 |
// * A reference to the entity which is the common base entity for all TypeDesignations in this workingset. |
|
111 |
// * For a {@link SpecimenTypeDesignation} this is usually the {@link FieldUnit} if it is present. Otherwise it can also be |
|
112 |
// * a {@link DerivedUnit} or something else depending on the specific use case. |
|
113 |
// * |
|
114 |
// * @return the baseEntityReference |
|
115 |
// */ |
|
116 |
// public TypedEntityReference<? extends VersionableEntity> getBaseEntityReference() { |
|
117 |
// return baseEntityReference; |
|
118 |
// } |
|
130 | 119 |
|
131 | 120 |
public boolean isSpecimenWorkingSet() { |
132 | 121 |
return getWorkingsetType().isSpecimenType(); |
... | ... | |
156 | 145 |
return highestTypeStatus; |
157 | 146 |
} |
158 | 147 |
|
148 |
// **************************** toString() ************************************ |
|
149 |
|
|
159 | 150 |
@Override |
160 | 151 |
public String toString(){ |
161 | 152 |
if(label != null){ |
... | ... | |
164 | 155 |
return super.toString(); |
165 | 156 |
} |
166 | 157 |
} |
167 |
|
|
168 | 158 |
} |
Also available in: Unified diff
ref #10089 remove TypedEntityReference from TypeDesignationWorkingSet