Package com.itextpdf.barcodes.qrcode
Class ErrorCorrectionLevel
- java.lang.Object
-
- com.itextpdf.barcodes.qrcode.ErrorCorrectionLevel
-
public final class ErrorCorrectionLevel extends java.lang.ObjectSee ISO 18004:2006, 6.5.1. This enum encapsulates the four error correction levels defined by the QR code standard.
-
-
Field Summary
Fields Modifier and Type Field Description private intbitsprivate static ErrorCorrectionLevel[]FOR_BITSstatic ErrorCorrectionLevelHH = ~30% correctionstatic ErrorCorrectionLevelLL = ~7% correctionstatic ErrorCorrectionLevelMM = ~15% correctionprivate java.lang.Stringnameprivate intordinalstatic ErrorCorrectionLevelQQ = ~25% correction
-
Constructor Summary
Constructors Modifier Constructor Description privateErrorCorrectionLevel(int ordinal, int bits, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ErrorCorrectionLevelforBits(int bits)intgetBits()Gets the bits.java.lang.StringgetName()Gets the name.intordinal()Gets the ordinal value.java.lang.StringtoString()
-
-
-
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()
Gets the ordinal value.- Returns:
- the ordinal
-
getBits
public int getBits()
Gets the bits.- Returns:
- the bits
-
getName
public java.lang.String getName()
Gets the name.- Returns:
- the name
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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:
ErrorCorrectionLevelrepresenting the encoded error correction level
-
-