Class 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
    • Constructor Detail

      • ErrorCorrectionLevel

        private ErrorCorrectionLevel​(int ordinal,
                                     int bits,
                                     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 class java.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