Class RollDimensionsEnricher

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

public final class RollDimensionsEnricher extends Object implements InterpretationEnricherInterface
Enriches AI 8001 (DIMENSIONS — Roll products) by decomposing the 14-digit value into its five labelled measurement fields.

Value structure (14 digits)

  Component 0 (N4) : Roll width       — millimetres,  e.g. "1500" = 1500 mm
  Component 1 (N5) : Roll length      — metres,       e.g. "02000" = 2000 m
  Component 2 (N3) : Core diameter    — millimetres,  e.g. "076" = 76 mm
  Component 3 (N1) : Winding direction — 0 = not defined,
                                         1 = clockwise (viewed from outside),
                                         2 = counterclockwise (viewed from outside)
  Component 4 (N1) : Number of splices — 0–9

Produced interpretations

  • ROLL_WIDTH — roll width in mm, leading zeros stripped, e.g. "1500"
  • ROLL_LENGTH — roll length in m, leading zeros stripped, e.g. "2000"
  • CORE_DIAMETER — core diameter in mm, leading zeros stripped, e.g. "76"
  • WINDING_DIRECTION_CODE— single-digit winding code, e.g. "1"
  • WINDING_DIRECTION — human-readable direction, e.g. "Clockwise"; omitted if code is "0" (not defined)
  • SPLICES — number of splices, e.g. "2"
Returns an empty list if the element has fewer than 5 components.
  • Constructor Details

  • 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