- All Implemented Interfaces:
Serializable,Comparable<QRCodeVersion>,Constable
Enumeration of QR Code versions with their corresponding symbol sizes.
QR Code versions are defined by ISO/IEC 18004 and range from version 1 (21x21 modules) to version 40 (177x177 modules). All QR Code symbols are square. Symbol sizes do not include the quiet zone.
The special constant AUTO allows automatic version selection, choosing the
smallest version that can accommodate the data to be encoded.
The unique numbers (0-40) 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 getNumber() and valueOf(int number).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionSelect optimal version based on dataQR Code version 1 (21x21 modules)QR Code version 2 (25x25 modules)QR Code version 3 (29x29 modules)QR Code version 4 (33x33 modules)QR Code version 5 (37x37 modules)QR Code version 6 (41x41 modules)QR Code version 7 (45x45 modules)QR Code version 8 (49x49 modules)QR Code version 9 (53x53 modules)QR Code version 10 (57x57 modules)QR Code version 11 (61x61 modules)QR Code version 12 (65x65 modules)QR Code version 13 (69x69 modules)QR Code version 14 (73x73 modules)QR Code version 15 (77x77 modules)QR Code version 16 (81x81 modules)QR Code version 17 (85x85 modules)QR Code version 18 (89x89 modules)QR Code version 19 (93x93 modules)QR Code version 20 (97x97 modules)QR Code version 21 (101x101 modules)QR Code version 22 (105x105 modules)QR Code version 23 (109x109 modules)QR Code version 24 (113x113 modules)QR Code version 25 (117x117 modules)QR Code version 26 (121x121 modules)QR Code version 27 (125x125 modules)QR Code version 28 (129x129 modules)QR Code version 29 (133x133 modules)QR Code version 30 (137x137 modules)QR Code version 31 (141x141 modules)QR Code version 32 (145x145 modules)QR Code version 33 (149x149 modules)QR Code version 34 (153x153 modules)QR Code version 35 (157x157 modules)QR Code version 36 (161x161 modules)QR Code version 37 (165x165 modules)QR Code version 38 (169x169 modules)QR Code version 39 (173x173 modules)QR Code version 40 (177x177 modules) -
Method Summary
Modifier and TypeMethodDescriptionintReturns the version number of this QR Code version.intgetSize()Returns the symbol size (width/height in modules) of this QR Code version.static QRCodeVersionvalueOf(int number) Returns the enum constant of this class corresponding to the specified version number.static QRCodeVersionReturns the enum constant of this class with the specified name.static QRCodeVersion[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AUTO
Select optimal version based on data -
V01
QR Code version 1 (21x21 modules) -
V02
QR Code version 2 (25x25 modules) -
V03
QR Code version 3 (29x29 modules) -
V04
QR Code version 4 (33x33 modules) -
V05
QR Code version 5 (37x37 modules) -
V06
QR Code version 6 (41x41 modules) -
V07
QR Code version 7 (45x45 modules) -
V08
QR Code version 8 (49x49 modules) -
V09
QR Code version 9 (53x53 modules) -
V10
QR Code version 10 (57x57 modules) -
V11
QR Code version 11 (61x61 modules) -
V12
QR Code version 12 (65x65 modules) -
V13
QR Code version 13 (69x69 modules) -
V14
QR Code version 14 (73x73 modules) -
V15
QR Code version 15 (77x77 modules) -
V16
QR Code version 16 (81x81 modules) -
V17
QR Code version 17 (85x85 modules) -
V18
QR Code version 18 (89x89 modules) -
V19
QR Code version 19 (93x93 modules) -
V20
QR Code version 20 (97x97 modules) -
V21
QR Code version 21 (101x101 modules) -
V22
QR Code version 22 (105x105 modules) -
V23
QR Code version 23 (109x109 modules) -
V24
QR Code version 24 (113x113 modules) -
V25
QR Code version 25 (117x117 modules) -
V26
QR Code version 26 (121x121 modules) -
V27
QR Code version 27 (125x125 modules) -
V28
QR Code version 28 (129x129 modules) -
V29
QR Code version 29 (133x133 modules) -
V30
QR Code version 30 (137x137 modules) -
V31
QR Code version 31 (141x141 modules) -
V32
QR Code version 32 (145x145 modules) -
V33
QR Code version 33 (149x149 modules) -
V34
QR Code version 34 (153x153 modules) -
V35
QR Code version 35 (157x157 modules) -
V36
QR Code version 36 (161x161 modules) -
V37
QR Code version 37 (165x165 modules) -
V38
QR Code version 38 (169x169 modules) -
V39
QR Code version 39 (173x173 modules) -
V40
QR Code version 40 (177x177 modules)
-
-
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 corresponding to the specified version number.- Parameters:
number- the version number (0 for AUTO, 1-40 for specific versions)- Returns:
- the enum constant corresponding to the specified version number
- Throws:
IllegalArgumentException- if the specified version number is outside the valid range
-
getNumber
public int getNumber()Returns the version number of this QR Code version.Returns 0 for
AUTO, or 1-40 for specific versions.- Returns:
- the version number of this QR Code version
- See Also:
-
getSize
public int getSize()Returns the symbol size (width/height in modules) of this QR Code version.- Returns:
- the symbol size (width/height in modules) of this QR Code version
-