]> git.aero2k.de Git - tmp/jakarta-migration.git/blob
1be0f9c25084c55937e2ef08adf4c3043603b1cc
[tmp/jakarta-migration.git] /
1 package org.collectionspace.services.advancedsearch.model;
2
3 import java.util.List;
4
5 import org.collectionspace.services.collectionobject.CollectionobjectsCommon;
6 import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.CollectionobjectsNaturalhistory;
7 import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.TaxonomicIdentGroup;
8 import org.collectionspace.services.collectionobject.domain.naturalhistory_extension.TaxonomicIdentGroupList;
9
10 public class TaxonModel {
11
12         public static String taxon(final CollectionobjectsNaturalhistory naturalHistory) {
13                 String taxon = null;
14                 if (naturalHistory != null && naturalHistory.getTaxonomicIdentGroupList() != null) {
15                         TaxonomicIdentGroupList taxonomicIdentGroupList = naturalHistory.getTaxonomicIdentGroupList();
16                         List<TaxonomicIdentGroup> taxonomicIdentGroups = taxonomicIdentGroupList.getTaxonomicIdentGroup();
17                         if (!taxonomicIdentGroups.isEmpty()) {
18                                 TaxonomicIdentGroup taxonGroup = taxonomicIdentGroups.get(0);
19                                 taxon = taxonGroup.getTaxon();
20                         }
21                 }
22
23                 return taxon;
24         }
25
26         public static String preservationForm(final CollectionobjectsCommon common) {
27                 String form = null;
28                 if (common != null && common.getForms() != null) {
29                         List<String> forms = common.getForms().getForm();
30                         if (!forms.isEmpty()) {
31                                 form = forms.get(0);
32                         }
33                 }
34
35                 return form;
36         }
37 }