Class TransmissionRiskLevelEncoding

  • All Implemented Interfaces:
    org.springframework.validation.Validator

    @Configuration
    @Validated
    @ConfigurationProperties(prefix="transmission-risk-encoding")
    @PropertySource(value="classpath:master-config/transmission-risk-encoding.yaml",
                    factory=YamlPropertySourceFactory.class)
    public class TransmissionRiskLevelEncoding
    extends Object
    implements org.springframework.validation.Validator
    Wrapper over properties defined in master-config/tranmission-risk-encoding.yaml. It provides convenience methods to derive properties from one another. Please see yaml file for more details on the reasoning / intent of encoding this field. This class also validates its own internal state at construction time as per Spring configuration class validation mechanisms.
    • Method Detail

      • getDaysSinceSymptomsForTransmissionRiskLevel

        public Integer getDaysSinceSymptomsForTransmissionRiskLevel​(Integer transmissionRiskLevel)
        Returns a mapped ENF v2 Days Since Symptoms value for the given Transmission Risk Level or throws an exception if the TRL is not part of the mapping.
      • getReportTypeForTransmissionRiskLevel

        public ReportType getReportTypeForTransmissionRiskLevel​(Integer transmissionRiskLevel)
        Returns a mapped ENF v2 Report Type value for the given Transmission Risk Level or throws an exception if the TRL is not part of the mapping.
      • supports

        public boolean supports​(Class<?> clazz)
        Specified by:
        supports in interface org.springframework.validation.Validator
      • validate

        public void validate​(Object target,
                             org.springframework.validation.Errors errors)
        Specified by:
        validate in interface org.springframework.validation.Validator
      • getTransmissionRiskToDaysSinceSymptoms

        public Map<Integer,​Integer> getTransmissionRiskToDaysSinceSymptoms()
      • getTransmissionRiskToReportType

        public Map<Integer,​Integer> getTransmissionRiskToReportType()