Barcode-Lib4J requires Java 11+

Enum Class «TwoDType»

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

public enum TwoDType extends Enum<TwoDType>
Enumeration of all supported 2D code types.

Each 2D code type has a unique integer ID which can be used for efficient storage in a file or database. The IDs are small positive integers that can be safely cast to byte if needed. See getID() and valueOf(int id).

  • Enum Constant Details

    • QRCODE

      public static final TwoDType QRCODE
      Code type "QR Code"
    • DATAMATRIX

      public static final TwoDType DATAMATRIX
      Code type "DataMatrix"
    • PDF417

      public static final TwoDType PDF417
      Code type "PDF 417"
    • AZTEC

      public static final TwoDType AZTEC
      Code type "Aztec"
    • GS1_QRCODE

      public static final TwoDType GS1_QRCODE
      Code type "GS1 QR Code"
    • GS1_DATAMATRIX

      public static final TwoDType GS1_DATAMATRIX
      Code type "GS1 DataMatrix"
  • Method Details

    • values

      public static TwoDType[] 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 TwoDType 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 TwoDType valueOf(int id)
      Returns the enum constant of this class associated with the specified integer ID.
      Parameters:
      id - the ID of the enum constant to be returned.
      Returns:
      the enum constant associated with the specified ID
      Throws:
      IllegalArgumentException - if this enum class has no constant associated with the specified ID
    • getID

      public int getID()
      Returns the integer ID associated with this 2D code type.
      Returns:
      the integer ID associated with this 2D code type
    • isGS1

      public boolean isGS1()
      Convenience method that returns whether this enum constant represents a GS1 code type.

      It is a shortcut for:

          foo == TwoDType.GS1_QRCODE || foo == TwoDType.GS1_DATAMATRIX
      Returns:
      true if the enum constant represents a GS1 code type, false otherwise
    • getDefaultQuietZone

      public int getDefaultQuietZone()
      Returns the default quiet zone size for this 2D code type as specified in its respective specification.

      The quiet zone is the blank space around the 2D code that prevents interference of the code by surrounding elements that may cause misreading. The size is specified in modules, where a module is the smallest single element in a 2D code.

      Note: For QR Codes, the specification defines a minimum quiet zone size of 4 modules. However, in modern applications this value is often reduced and may vary depending on the specific use case or implementation requirements.

      Returns:
      the default quiet zone size in modules
    • getTypeName

      public String getTypeName()
      Returns the name of this 2D code type.
      Returns:
      the name of this 2D code type
    • toString

      public String toString()
      Returns the name of this 2D code type.

      Equivalent to getTypeName().

      Overrides:
      toString in class Enum<TwoDType>
      Returns:
      the name of this 2D code type