Class YesNoEnricher

java.lang.Object
tools.pantheum.gaia.gs1.interpretation.enricher.YesNoEnricher
All Implemented Interfaces:
InterpretationEnricherInterface

public final class YesNoEnricher extends Object implements InterpretationEnricherInterface
Enriches GS1 yesno flag fields by mapping the single-digit value to a human-readable Yes/No label.

Applied to boolean flag AIs where 1 means true/yes and 0 means false/no:

  • AI 4321 — Dangerous goods flag
  • AI 4322 — Authority to leave
  • AI 4323 — Signature required flag

Produced interpretations

  • FLAG_VALUE — "Yes" for "1", "No" for "0"
Returns an empty list if the value is null, empty, or not "0" or "1".
  • Constructor Details

    • YesNoEnricher

      public YesNoEnricher()
      Creates a new YesNoEnricher.
  • Method Details

    • enrich

      public List<GS1AIInterpretation> enrich(String baseValue, AiDefinition aiDefinition, GS1AIObjectElement element)
      Description copied from interface: InterpretationEnricherInterface
      Produces additional interpretations from baseValue.
      Specified by:
      enrich in interface InterpretationEnricherInterface
      Parameters:
      baseValue - the extracted segment value (never null or empty)
      aiDefinition - the full AI definition for the element being interpreted
      element - the parent element, providing access to all component values and any interpretations already added in this pass
      Returns:
      additional interpretations to append; never null