Package com.google.zxing
Class Result
- java.lang.Object
-
- com.google.zxing.Result
-
public final class Result extends java.lang.ObjectEncapsulates the result of decoding a barcode within an image.
-
-
Constructor Summary
Constructors Constructor Description Result(java.lang.String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format)Result(java.lang.String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format, long timestamp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddResultPoints(ResultPoint[] newPoints)BarcodeFormatgetBarcodeFormat()byte[]getRawBytes()java.util.Map<ResultMetadataType,java.lang.Object>getResultMetadata()ResultPoint[]getResultPoints()java.lang.StringgetText()longgetTimestamp()voidputAllMetadata(java.util.Map<ResultMetadataType,java.lang.Object> metadata)voidputMetadata(ResultMetadataType type, java.lang.Object value)java.lang.StringtoString()
-
-
-
Constructor Detail
-
Result
public Result(java.lang.String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format)
-
Result
public Result(java.lang.String text, byte[] rawBytes, ResultPoint[] resultPoints, BarcodeFormat format, long timestamp)
-
-
Method Detail
-
getText
public java.lang.String getText()
- Returns:
- raw text encoded by the barcode
-
getRawBytes
public byte[] getRawBytes()
- Returns:
- raw bytes encoded by the barcode, if applicable, otherwise
null
-
getResultPoints
public ResultPoint[] getResultPoints()
- Returns:
- points related to the barcode in the image. These are typically points identifying finder patterns or the corners of the barcode. The exact meaning is specific to the type of barcode that was decoded.
-
getBarcodeFormat
public BarcodeFormat getBarcodeFormat()
- Returns:
BarcodeFormatrepresenting the format of the barcode that was decoded
-
getResultMetadata
public java.util.Map<ResultMetadataType,java.lang.Object> getResultMetadata()
- Returns:
MapmappingResultMetadataTypekeys to values. May benull. This contains optional metadata about what was detected about the barcode, like orientation.
-
putMetadata
public void putMetadata(ResultMetadataType type, java.lang.Object value)
-
putAllMetadata
public void putAllMetadata(java.util.Map<ResultMetadataType,java.lang.Object> metadata)
-
addResultPoints
public void addResultPoints(ResultPoint[] newPoints)
-
getTimestamp
public long getTimestamp()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-