Project

General

Profile

« Previous | Next » 

Revision 9341b749

Added by Andreas Müller over 2 years ago

rename static AggregationMode methods

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/description/AggregationMode.java
75 75
        return result;
76 76
    }
77 77

  
78
    public static List<AggregationMode> byAreasAndRanks(){
78
    public static List<AggregationMode> byWithinTaxonAndToParent(){
79 79
        return Arrays.asList(new AggregationMode[]{AggregationMode.WithinTaxon, AggregationMode.ToParent});
80 80
    }
81
    public static List<AggregationMode> byAreas(){
81
    public static List<AggregationMode> byWithinTaxon(){
82 82
        return Arrays.asList(new AggregationMode[]{AggregationMode.WithinTaxon});
83 83
    }
84
    public static List<AggregationMode> byRanks(){
84
    public static List<AggregationMode> byToParent(){
85 85
        return Arrays.asList(new AggregationMode[]{AggregationMode.ToParent});
86 86
    }
87 87

  
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/description/DistributionAggregationTest.java
202 202
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(null, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
203 203

  
204 204
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
205
                AggregationMode.byAreasAndRanks(), superAreas, filter, monitor);
205
                AggregationMode.byWithinTaxonAndToParent(), superAreas, filter, monitor);
206 206
        engine.invoke(config, repository);
207 207

  
208 208
        Taxon lapsana_communis_alpina  = (Taxon) taxonService.load(T_LAPSANA_COMMUNIS_ALPINA_UUID);
......
259 259
        classificationUuids.add(CLASSIFICATION_UUID);
260 260
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(classificationUuids, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
261 261
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
262
                AggregationMode.byAreas(), superAreas, filter, statusOrder, monitor);
262
                AggregationMode.byWithinTaxon(), superAreas, filter, statusOrder, monitor);
263 263
        engine.invoke(config, repository);
264 264

  
265 265
        lapsana_communis_alpina  = (Taxon) taxonService.load(T_LAPSANA_COMMUNIS_ALPINA_UUID);
......
308 308
        //aggregation
309 309
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(null, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
310 310
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
311
                AggregationMode.byAreasAndRanks(), superAreas, filter, monitor);
311
                AggregationMode.byWithinTaxonAndToParent(), superAreas, filter, monitor);
312 312
        config.setToParentSourceMode(AggregationSourceMode.ALL_SAMEVALUE);
313 313
        engine.invoke(config, repository);
314 314

  
......
462 462

  
463 463
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(null, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
464 464
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
465
                AggregationMode.byAreasAndRanks(), superAreas, filter, monitor);
465
                AggregationMode.byWithinTaxonAndToParent(), superAreas, filter, monitor);
466 466
        config.setToParentSourceMode(AggregationSourceMode.ALL_SAMEVALUE);
467 467
        engine.invoke(config, repository);
468 468

  
......
517 517

  
518 518
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(null, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
519 519
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
520
                AggregationMode.byAreasAndRanks(), superAreas, filter, monitor);
520
                AggregationMode.byWithinTaxonAndToParent(), superAreas, filter, monitor);
521 521
        config.setToParentSourceMode(AggregationSourceMode.ALL_SAMEVALUE);
522 522
        engine.invoke(config, repository);
523 523

  
......
577 577

  
578 578
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(null, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
579 579
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
580
                AggregationMode.byAreasAndRanks(), superAreas, filter, monitor);
580
                AggregationMode.byWithinTaxonAndToParent(), superAreas, filter, monitor);
581 581
        engine.invoke(config, repository);
582 582

  
583 583
        Taxon lapsana_communis = (Taxon) taxonService.load(T_LAPSANA_COMMUNIS_UUID);
......
620 620

  
621 621
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(null, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
622 622
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
623
                AggregationMode.byRanks(), superAreas, filter, monitor);
623
                AggregationMode.byToParent(), superAreas, filter, monitor);
624 624
        config.setToParentSourceMode(AggregationSourceMode.DESCRIPTION);
625 625
        engine.invoke(config, repository);
626 626

  
......
658 658
        //aggregate
659 659
        TaxonNodeFilter filter = TaxonNodeFilter.NewInstance(null, null, null, null, null, lowerRank.getUuid(), upperRank.getUuid());
660 660
        DistributionAggregationConfiguration config = DistributionAggregationConfiguration.NewInstance(
661
                AggregationMode.byAreasAndRanks(), superAreas, filter, monitor);
661
                AggregationMode.byWithinTaxonAndToParent(), superAreas, filter, monitor);
662 662
        config.setAggregatingSourceTypes(EnumSet.of(OriginalSourceType.PrimaryTaxonomicSource));
663 663
        config.setToParentSourceMode(AggregationSourceMode.ALL);
664 664
        engine.invoke(config, repository);
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/description/StructuredDescriptionAggregationTest.java
367 367
                StructuredDescriptionAggregationConfiguration.NewInstance(filter, monitor);
368 368
        config.setDatasetUuid(dataSet.getUuid());
369 369
        config.setAggregateToHigherRanks(true);
370
        config.setAggregationMode(AggregationMode.byAreasAndRanks());
370
        config.setAggregationMode(AggregationMode.byWithinTaxonAndToParent());
371 371
        return config;
372 372
    }
373 373

  
cdmlib-services/src/test/java/eu/etaxonomy/cdm/test/function/TestAggregations.java
122 122
		TaxonNodeFilter filter = TaxonNodeFilter.NewSubtreeInstance(uuidPlantae);
123 123
		filter.setRankMax(Rank.uuidGenus);
124 124

  
125
		List<AggregationMode> modes = AggregationMode.byRanks();
125
		List<AggregationMode> modes = AggregationMode.byToParent();
126 126
		List<UUID> areaList = areaPager.getRecords().stream().map(p ->p.getUuid()).collect(Collectors.toList());
127 127
		DistributionAggregationConfiguration config = DistributionAggregationConfiguration
128 128
		        .NewInstance(modes, areaList, filter, monitor);

Also available in: Unified diff