Added BarcodeFormat to Result, indicating what type of barcode was detected. Added...
[zxing.git] / core / src / com / google / zxing / Result.java
index 42f1947..d63743f 100644 (file)
@@ -25,10 +25,12 @@ public final class Result {
 
   private final String text;
   private final ResultPoint[] resultPoints;
+  private final BarcodeFormat format;
 
-  public Result(String text, ResultPoint[] resultPoints) {
+  public Result(String text, ResultPoint[] resultPoints, BarcodeFormat format) {
     this.text = text;
     this.resultPoints = resultPoints;
+    this.format = format;
   }
 
   /**
@@ -47,4 +49,11 @@ public final class Result {
     return resultPoints;
   }
 
+  /**
+   * @return {@link BarcodeFormat} representing the format of the barcode that was recognized and decoded
+   */
+  public BarcodeFormat getBarcodeFormat() {
+    return format;
+  }
+
 }