Barcode-Lib4J requires Java 11+

Enum Class «PDF417ErrorCorrection»

java.lang.Object
java.lang.Enum<PDF417ErrorCorrection>
de.vwsoft.barcodelib4j.twod.PDF417ErrorCorrection
All Implemented Interfaces:
Serializable, Comparable<PDF417ErrorCorrection>, Constable

public enum PDF417ErrorCorrection extends Enum<PDF417ErrorCorrection>
Enumeration of PDF417 error correction levels.

PDF417 includes built-in error correction to recover from symbol damage. The error correction level determines how much data redundancy is added to the symbol. Higher levels provide better damage recovery but increase the symbol size.

PDF417 supports 9 error correction levels (0-8). Level 0 provides error detection only (no correction capability), while levels 1-8 provide increasing error correction capability with each level.

The unique level numbers (0-8) assigned to the constants can be used for efficient storage in files or databases. The numbers are small enough to be safely cast to byte if needed. See getLevelNumber() and valueOf(int levelNumber).

  • Enum Constant Details

  • Method Details

    • values

      public static PDF417ErrorCorrection[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PDF417ErrorCorrection valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueOf

      public static PDF417ErrorCorrection valueOf(int levelNumber)
      Returns the enum constant of this class associated with the specified level number.
      Parameters:
      levelNumber - the level number of the enum constant to be returned (0-8)
      Returns:
      the enum constant associated with the specified level number
      Throws:
      IllegalArgumentException - if this enum class has no constant associated with the specified level number
    • getLevelNumber

      public int getLevelNumber()
      Returns the level number (0-8) of this error correction level.
      Returns:
      the level number (0-8) of this error correction level
      See Also:
    • getErrorCorrectionCodewords

      public int getErrorCorrectionCodewords()
      Returns the number of error correction codewords for this level.

      According to ISO/IEC 15438, PDF417 uses 2^(level+1) error correction codewords, ranging from 2 at level 0 (detection only) to 512 at level 8 (maximum correction).

      This value can be combined with getLevelNumber() to create complete descriptions like "Level 3 (16 codewords)" for user interfaces or logging.

      Returns:
      the number of error correction codewords for this level