Skip to content

Commit

Permalink
Add raw barcode data access (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudChirat authored Jan 11, 2023
1 parent 9aeba6c commit 07c758e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@
*/
public class Barcode {
private String barcode;
/**
* rawBarcode without trim, useful for 2D barcode who can have a structure based on some white space.
*/
private String rawBarcode;
private BarcodeType barcodeType = BarcodeType.UNKNOWN;

public Barcode(String barcode, BarcodeType barcodeType) {
this.rawBarcode = barcode;

this.barcode = barcode.trim();
this.barcodeType = barcodeType;
}
Expand All @@ -20,6 +26,8 @@ public BarcodeType getBarcodeType() {
return barcodeType;
}

public String getRawBarcode() {return rawBarcode;}

@Override
public String toString() {
return this.barcode + " (" + this.barcodeType.code + ")";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public static BarcodeType toBarcodeType(@Nullable final String symbologyString)
return BarcodeType.EAN13;
if (symbologyString.equals("QRCODE"))
return BarcodeType.QRCODE;
if (symbologyString.equals("AZTEC"))
if (symbologyString.equals("AZTEC_CODE"))
return BarcodeType.AZTEC;
return BarcodeType.UNKNOWN;
}
Expand Down

0 comments on commit 07c758e

Please sign in to comment.