Revision ef8f40dd
Added by Patrick Plitzner over 4 years ago
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/matrix/MatrixUtility.java | ||
---|---|---|
12 | 12 |
import java.util.stream.Collectors; |
13 | 13 |
|
14 | 14 |
import eu.etaxonomy.cdm.api.service.dto.TaxonRowWrapperDTO; |
15 |
import eu.etaxonomy.cdm.model.common.MarkerType;
|
|
15 |
import eu.etaxonomy.cdm.model.description.DescriptionType;
|
|
16 | 16 |
import eu.etaxonomy.cdm.model.description.DescriptiveDataSet; |
17 | 17 |
import eu.etaxonomy.cdm.model.description.Feature; |
18 | 18 |
import eu.etaxonomy.cdm.model.description.QuantitativeData; |
... | ... | |
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
public static boolean isDefaultTaxonDescription(TaxonRowWrapperDTO taxonRowWrapperDTO){ |
81 |
return hasMarker(taxonRowWrapperDTO, MarkerType.TO_BE_CHECKED());
|
|
81 |
return hasType(taxonRowWrapperDTO, DescriptionType.DEFAULT_VALUES_FOR_AGGREGATION);
|
|
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
public static boolean isAggregatedTaxonDescription(TaxonRowWrapperDTO taxonRowWrapperDTO){ |
85 |
return hasMarker(taxonRowWrapperDTO, MarkerType.COMPUTED());
|
|
85 |
return hasType(taxonRowWrapperDTO, DescriptionType.AGGREGATED);
|
|
86 | 86 |
} |
87 | 87 |
|
88 | 88 |
public static boolean isLiteratureTaxonDescription(TaxonRowWrapperDTO taxonRowWrapperDTO){ |
89 |
return hasMarker(taxonRowWrapperDTO, MarkerType.IN_BIBLIOGRAPHY());
|
|
89 |
return hasType(taxonRowWrapperDTO, DescriptionType.SECONDARY_DATA);
|
|
90 | 90 |
} |
91 | 91 |
|
92 |
private static boolean hasMarker(TaxonRowWrapperDTO taxonRowWrapperDTO, MarkerType markerType){
|
|
93 |
return taxonRowWrapperDTO.getDescription().getMarkers().stream()
|
|
94 |
.anyMatch(marker->marker.getMarkerType().equals(markerType));
|
|
92 |
private static boolean hasType(TaxonRowWrapperDTO taxonRowWrapperDTO, DescriptionType descriptionType){
|
|
93 |
return taxonRowWrapperDTO.getDescription().getTypes().stream()
|
|
94 |
.anyMatch(type->type.equals(descriptionType));
|
|
95 | 95 |
} |
96 | 96 |
} |
97 | 97 |
|
Also available in: Unified diff
fix #8480 Use DescriptionTypes for matrix descriptions