- All Implemented Interfaces:
Serializable,Comparable<TwoDType>,Constable
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).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCode type "Aztec"Code type "DataMatrix"Code type "GS1 DataMatrix"Code type "GS1 QR Code"Code type "PDF 417"Code type "QR Code" -
Method Summary
Modifier and TypeMethodDescriptionintReturns the default quiet zone size for this 2D code type as specified in its respective specification.intgetID()Returns the integer ID associated with this 2D code type.Returns the name of this 2D code type.booleanisGS1()Convenience method that returns whether this enum constant represents a GS1 code type.toString()Returns the name of this 2D code type.static TwoDTypevalueOf(int id) Returns the enum constant of this class associated with the specified integer ID.static TwoDTypeReturns the enum constant of this class with the specified name.static TwoDType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
QRCODE
Code type "QR Code" -
DATAMATRIX
Code type "DataMatrix" -
PDF417
Code type "PDF 417" -
AZTEC
Code type "Aztec" -
GS1_QRCODE
Code type "GS1 QR Code" -
GS1_DATAMATRIX
Code type "GS1 DataMatrix"
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
valueOf
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:
trueif the enum constant represents a GS1 code type,falseotherwise
-
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
Returns the name of this 2D code type.- Returns:
- the name of this 2D code type
-
toString
Returns the name of this 2D code type.Equivalent to
getTypeName().
-