Class AiExcludesEntry

java.lang.Object
tools.pantheum.gaia.gs1.registry.AiExcludesEntry

public class AiExcludesEntry extends Object
Represents one entry in an AI's excludes list: either an exact AI code or a start–end range.

None of the AI codes matched by an AiExcludesEntry may be present in the same element string as the AI that declares it.

  • Method Details

    • ofExact

      public static AiExcludesEntry ofExact(String ai)
      Of exact.
      Parameters:
      ai - the AI
      Returns:
      a new AiExcludesEntry
    • ofRange

      public static AiExcludesEntry ofRange(String start, String end)
      Of range.
      Parameters:
      start - the start
      end - the end
      Returns:
      a new AiExcludesEntry
    • isRange

      public boolean isRange()
      Returns true if this element is range.
      Returns:
      true if this element is range.
    • isExact

      public boolean isExact()
      Returns true if this element is exact.
      Returns:
      true if this element is exact.
    • getExactAi

      public String getExactAi()
      Returns the exact AI.
      Returns:
      the exact AI.
    • getRangeStart

      public String getRangeStart()
      Returns the range start.
      Returns:
      the range start.
    • getRangeEnd

      public String getRangeEnd()
      Returns the range end.
      Returns:
      the range end.
    • matches

      public boolean matches(String ai)
      Returns true if the given AI code is matched by this entry — either an exact match or within the range.
      Parameters:
      ai - the AI
      Returns:
      true if matches.
    • toString

      public String toString()
      Overrides:
      toString in class Object