Package com.itextpdf.text.pdf.qrcode
Class ErrorCorrectionLevel
- java.lang.Object
-
- com.itextpdf.text.pdf.qrcode.ErrorCorrectionLevel
-
public final class ErrorCorrectionLevel extends java.lang.Object
See ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels defined by the QR code standard.
- Since:
- 5.0.2
-
-
Field Summary
Fields Modifier and Type Field Description private int
bits
private static ErrorCorrectionLevel[]
FOR_BITS
static ErrorCorrectionLevel
H
H = ~30% correctionstatic ErrorCorrectionLevel
L
L = ~7% correctionstatic ErrorCorrectionLevel
M
M = ~15% correctionprivate java.lang.String
name
private int
ordinal
static ErrorCorrectionLevel
Q
Q = ~25% correction
-
Constructor Summary
Constructors Modifier Constructor Description private
ErrorCorrectionLevel(int ordinal, int bits, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorCorrectionLevel
forBits(int bits)
int
getBits()
java.lang.String
getName()
int
ordinal()
java.lang.String
toString()
-
-
-
Field Detail
-
L
public static final ErrorCorrectionLevel L
L = ~7% correction
-
M
public static final ErrorCorrectionLevel M
M = ~15% correction
-
Q
public static final ErrorCorrectionLevel Q
Q = ~25% correction
-
H
public static final ErrorCorrectionLevel H
H = ~30% correction
-
FOR_BITS
private static final ErrorCorrectionLevel[] FOR_BITS
-
ordinal
private final int ordinal
-
bits
private final int bits
-
name
private final java.lang.String name
-
-
Method Detail
-
ordinal
public int ordinal()
-
getBits
public int getBits()
-
getName
public java.lang.String getName()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
forBits
public static ErrorCorrectionLevel forBits(int bits)
- Parameters:
bits
- int containing the two bits encoding a QR Code's error correction level- Returns:
ErrorCorrectionLevel
representing the encoded error correction level
-
-