Revision 2c0bb8e3
Added by Andreas Müller almost 3 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/ReferenceType.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.cdm.model.reference; |
11 | 11 |
|
12 | 12 |
import java.io.Serializable; |
13 |
import java.util.HashSet; |
|
13 |
import java.util.ArrayList; |
|
14 |
import java.util.List; |
|
14 | 15 |
import java.util.Set; |
15 | 16 |
import java.util.UUID; |
16 | 17 |
|
... | ... | |
184 | 185 |
* The type of the part for which the possible in-refrence types are to be returned. |
185 | 186 |
* @return a set, may be empty, never <code>null</code> |
186 | 187 |
*/ |
187 |
public static Set<ReferenceType> inReferenceContraints(ReferenceType subReferenceType){
|
|
188 |
Set<ReferenceType> inRefTypes = new HashSet<>();
|
|
188 |
public static List<ReferenceType> inReferenceContraints(ReferenceType subReferenceType){
|
|
189 |
List<ReferenceType> inRefTypes = new ArrayList<>();
|
|
189 | 190 |
|
190 | 191 |
if(subReferenceType != null && !subReferenceType.equals(ReferenceType.Generic)){ |
191 | 192 |
if(subReferenceType.isArticle()){ |
... | ... | |
199 | 200 |
inRefTypes.add(ReferenceType.Proceedings); |
200 | 201 |
} else if (subReferenceType == ReferenceType.Section) { |
201 | 202 |
inRefTypes.add(ReferenceType.Article); |
203 |
inRefTypes.add(ReferenceType.BookSection); |
|
202 | 204 |
inRefTypes.add(ReferenceType.Book); |
203 | 205 |
inRefTypes.add(ReferenceType.Thesis); |
204 | 206 |
inRefTypes.add(ReferenceType.Patent); |
205 | 207 |
inRefTypes.add(ReferenceType.Report); |
206 | 208 |
inRefTypes.add(ReferenceType.WebPage); |
207 | 209 |
inRefTypes.add(ReferenceType.InProceedings); |
208 |
inRefTypes.add(ReferenceType.BookSection); |
|
210 |
} else if (subReferenceType == ReferenceType.WebPage) { |
|
211 |
inRefTypes.add(ReferenceType.WebPage); |
|
212 |
inRefTypes.add(ReferenceType.Database); |
|
209 | 213 |
} |
210 | 214 |
} |
211 | 215 |
|
Also available in: Unified diff
ref #8547 make ReferenceType.inReferenceContraints() a list