Barcode-Lib4J requires Java 11+

Enum Class «DataMatrixShape»

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

public enum DataMatrixShape extends Enum<DataMatrixShape>
Enumeration of DataMatrix symbol shape preferences.

DataMatrix symbols can be square or rectangular. The special constant AUTO allows automatic shape selection based on the data.

The unique integer IDs (0-2) assigned to the constants can be used for efficient storage in files or databases. The IDs are small enough to be safely cast to byte if needed. See getID() and valueOf(int id).

  • Enum Constant Details

    • AUTO

      public static final DataMatrixShape AUTO
      Select optimal shape based on data
    • SQUARE

      public static final DataMatrixShape SQUARE
      Force square symbol shape
    • RECTANGLE

      public static final DataMatrixShape RECTANGLE
      Force rectangular symbol shape
  • Method Details

    • values

      public static DataMatrixShape[] 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 DataMatrixShape 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 DataMatrixShape 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 (0-2)
      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 shape preference.

      Returns 0 for AUTO, 1 for SQUARE, or 2 for RECTANGLE.

      Returns:
      the integer ID associated with this shape preference
      See Also: