diff --git a/source/imaer-shared/src/main/java/nl/overheid/aerius/shared/domain/calculation/SubReceptorsMode.java b/source/imaer-shared/src/main/java/nl/overheid/aerius/shared/domain/calculation/SubReceptorsMode.java index 4bb281b2..1b5f638c 100644 --- a/source/imaer-shared/src/main/java/nl/overheid/aerius/shared/domain/calculation/SubReceptorsMode.java +++ b/source/imaer-shared/src/main/java/nl/overheid/aerius/shared/domain/calculation/SubReceptorsMode.java @@ -16,6 +16,10 @@ */ package nl.overheid.aerius.shared.domain.calculation; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + /** * Different modes we support for calculations with subreceptors. */ @@ -24,30 +28,46 @@ public enum SubReceptorsMode { /** * Never use subreceptors */ - DISABLED(false, false, true), + DISABLED(), + /** + * Always use subreceptors, but only inside relevant habitats. + */ + ENABLED(Option.ENABLED, Option.ONLY_INSIDE_HABITATS), /** * Always use subreceptors + * Only include subreceptors when inside nature area */ - ENABLED(true, false, true), + ENABLED_INSIDE_NATURE_AREAS(Option.ENABLED, Option.ONLY_INSIDE_NATURE_AREAS), /** * Use subreceptors only when calculating receptors * Do not use subreceptors when calculating custom points */ - ENABLED_RECEPTORS_ONLY(true, true, true), + ENABLED_RECEPTORS_ONLY(Option.ENABLED, Option.RECEPTORS_ONLY, Option.ONLY_INSIDE_HABITATS), /** * Always use subreceptors * Also include subreceptors outside relevant habitat areas */ - ENABLED_OUTSIDE_HABITATS(true, false, false); + ENABLED_OUTSIDE_HABITATS(Option.ENABLED); + + private enum Option { + ENABLED, + ONLY_INSIDE_NATURE_AREAS, + ONLY_INSIDE_HABITATS, + RECEPTORS_ONLY, + } private final boolean enabled; - private final boolean receptorsOnly; private final boolean onlyInsideHabitats; + private final boolean onlyInsideNatureAreas; + private final boolean receptorsOnly; + + SubReceptorsMode(final Option ...options) { + final Set