Class TekFieldDerivations
- java.lang.Object
-
- app.coronawarn.server.common.persistence.domain.config.TekFieldDerivations
-
@Configuration @ConfigurationProperties(prefix="tek-field-derivations") @PropertySource(value="classpath:derivation-maps.yaml", factory=YamlPropertySourceFactory.class) public class TekFieldDerivations extends Object
Wrapper over properties defined in derivation-maps.yaml. It provides convenience methods to derive properties from one another.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Integer
deriveDaysSinceSymptomsFromTransmissionRiskLevel(Integer transmissionRiskLevel)
Returns a mapped DSOS value for the given TRL or throws an exception if the TRL is not part of the mapping.Integer
deriveTransmissionRiskLevelFromDaysSinceSymptoms(Integer daysSinceSymptoms)
Returns a mapped TRL value for the given DSOS or the configured system default.static TekFieldDerivations
from(Map<Integer,Integer> dsosFromTrl, Map<Integer,Integer> trlFromDsos, Integer defaultTrl)
Constructs the configuration class from the given mappings.Map<Integer,Integer>
getDaysSinceSymptomsFromTransmissionRiskLevel()
Map<Integer,Integer>
getTransmissionRiskLevelFromDaysSinceSymptoms()
void
setDefaultTrl(Integer defaultTrl)
-
-
-
Method Detail
-
getDaysSinceSymptomsFromTransmissionRiskLevel
public Map<Integer,Integer> getDaysSinceSymptomsFromTransmissionRiskLevel()
-
getTransmissionRiskLevelFromDaysSinceSymptoms
public Map<Integer,Integer> getTransmissionRiskLevelFromDaysSinceSymptoms()
-
deriveDaysSinceSymptomsFromTransmissionRiskLevel
public Integer deriveDaysSinceSymptomsFromTransmissionRiskLevel(Integer transmissionRiskLevel)
Returns a mapped DSOS value for the given TRL or throws an exception if the TRL is not part of the mapping.
-
deriveTransmissionRiskLevelFromDaysSinceSymptoms
public Integer deriveTransmissionRiskLevelFromDaysSinceSymptoms(Integer daysSinceSymptoms)
Returns a mapped TRL value for the given DSOS or the configured system default.
-
from
public static TekFieldDerivations from(Map<Integer,Integer> dsosFromTrl, Map<Integer,Integer> trlFromDsos, Integer defaultTrl)
Constructs the configuration class from the given mappings.
-
setDefaultTrl
public void setDefaultTrl(Integer defaultTrl)
-
-