Class MandatoryAttributeCalculator

java.lang.Object
mc.core.system.base.BasePojo
mc.core.domain.base.dobj.calc.MandatoryAttributeCalculator

public class MandatoryAttributeCalculator extends mc.core.system.base.BasePojo
calculates a data quality score and simple quality gate based on which attributes are missing and which are maintained. Does not take content into account. the gate is < 40% RED, < 60% yellow and < 80% green by default could be extended/overwritten to calculate based on e.g. mandatory for a given channel or for other use cases.
  • Constructor Details

    • MandatoryAttributeCalculator

      public MandatoryAttributeCalculator(ComplexEntity entity, Locale locale)
      this constructor does not perform the mandatory calculation work initially.
      Parameters:
      entity -
      locale -
  • Method Details

    • mandatoryMissing

      public List<Attribute> mandatoryMissing()
      Returns:
      list of missing attributes defined as mandatory on type entity or classification
    • mandatoryAttributes

      public List<Attribute> mandatoryAttributes()
      return list of all mandatory type attributes and classification attributes
      Returns:
    • mandatoryAndMissingPair

      public mc.core.system.util.misc.Pair<List<Attribute>,List<Attribute>> mandatoryAndMissingPair()
      return the pair, keeping for legacy reasons.
      Returns:
      pair of left: mandatory right: missing mandatory attributes
    • mandatoryScore

      public float mandatoryScore()
      mandatory score calculated as (mandatory - missing )/mandatory
      Returns:
    • mandatoryCount

      public int mandatoryCount()
      count of mandatory attributes
    • missingCount

      public int missingCount()
      count of attributes missing values
      Returns:
    • qualityGate

      return a quality gate, a traffic light indicating data quality R Y G
      Returns:
      a MandatoryAttributeCalculator.QualityGate