Added error correction level to Result
[zxing.git] / core / src / com / google / zxing / common / DecoderResult.java
index 137987c..ce0e3c5 100644 (file)
@@ -16,6 +16,8 @@
 
 package com.google.zxing.common;
 
+import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
+
 import java.util.Vector;
 
 /**
@@ -30,14 +32,16 @@ public final class DecoderResult {
   private final byte[] rawBytes;
   private final String text;
   private final Vector byteSegments;
+  private final ErrorCorrectionLevel ecLevel;
 
-  public DecoderResult(byte[] rawBytes, String text, Vector byteSegments) {
+  public DecoderResult(byte[] rawBytes, String text, Vector byteSegments, ErrorCorrectionLevel ecLevel) {
     if (rawBytes == null && text == null) {
       throw new IllegalArgumentException();
     }
     this.rawBytes = rawBytes;
     this.text = text;
     this.byteSegments = byteSegments;
+    this.ecLevel = ecLevel;
   }
 
   public byte[] getRawBytes() {
@@ -52,4 +56,8 @@ public final class DecoderResult {
     return byteSegments;
   }
 
+  public ErrorCorrectionLevel getECLevel() {
+    return ecLevel;
+  }
+
 }
\ No newline at end of file