Class ProductionTimeEnricher

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

public final class ProductionTimeEnricher extends Object implements InterpretationEnricherInterface
Enriches AI 8008 (PROD TIME — Date and time of production) with a complete set of date, time and date-time interpretations.

AI 8008 uses two components with formats not handled by the generic DateEnricher or TimeEnricher:

  • Component 0 (N8, yymmddhh) — mandatory: date and hour encoded as YYMMDDHH, e.g. "25061514" = 15 Jun 2025, 14:xx
  • Component 1 (N..4, mmoptss) — optional: minutes with optional seconds encoded as MM or MMSS, e.g. "30" = :30, "3045" = :30:45

This enricher is declared with no component or start/end in ai-content.json and reads the component values directly from the element rather than from the baseValue parameter.

Produced interpretations

Date formatting (order and separator) is controlled by the ParseConfig passed to the pipeline. The examples below use the default configuration (little-endian, slash).

  • DATE_VALUE — formatted date string, e.g. "15/06/2025"
  • DATE_FORMAT — date pattern string, e.g. "dd/mm/yyyy"
  • TIME_VALUE — "HH:mm" or "HH:mm:ss", e.g. "14:30" or "14:30:45"
  • TIME_FORMAT — "HH:mm" or "HH:mm:ss"
  • DATETIME_VALUE — combined date and time, e.g. "15/06/2025 14:30:45"
  • DATETIME_FORMAT — combined pattern, e.g. "dd/mm/yyyy HH:mm" or "dd/mm/yyyy HH:mm:ss"
Returns an empty list if component 0 is missing or malformed.